-void FillFilter::SetImage(vtkImageData *image) // virtual
- {
- baseFilterManualPaint::SetImage(image);
+void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
+{
+ baseFilterManualPaint::SetImages(image,image2);
printf("R %ld \n", _countRecursiveFill);
_countProgressingFill = 0;
}
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
printf("R %ld \n", _countRecursiveFill);
_countProgressingFill = 0;
}
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
_auxImageFill->SetScalarComponentFromFloat(px, py, pz, 0, 0);
}
_tmpDistfill = (px - _pxfill) * (px - _pxfill)
+ (py - _pyfill) * (py - _pyfill)
+ (pz - _pzfill) * (pz - _pzfill);
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
_auxImageFill->SetScalarComponentFromFloat(px, py, pz, 0, 0);
}
_tmpDistfill = (px - _pxfill) * (px - _pxfill)
+ (py - _pyfill) * (py - _pyfill)
+ (pz - _pzfill) * (pz - _pzfill);
- _tmpiglfill = _image->GetScalarComponentAsDouble(px, py, pz, 0);
+ _tmpiglfill = _image->GetScalarComponentAsDouble(px, py, pz, 0);
+
+ if (_image2!=NULL)
+ {
+ _tmpiglfill2 = _image2->GetScalarComponentAsDouble(px, py, pz, 0);
+ } else {
+ _tmpiglfill2 = _tmpiglfill;
+ }
float grayLBFMTOL = _graylevelbasefill - _tolerancefill;
float grayLBFPTOL = _graylevelbasefill + _tolerancefill;
float grayLBFMTOL = _graylevelbasefill - _tolerancefill;
float grayLBFPTOL = _graylevelbasefill + _tolerancefill;
&& (_tmpiglfill >= grayLBFMTOL)
&& (_tmpiglfill <= grayLBFPTOL)
&& (_tmpDistfill <= _distbasefill); //DFCH
&& (_tmpiglfill >= grayLBFMTOL)
&& (_tmpiglfill <= grayLBFPTOL)
&& (_tmpDistfill <= _distbasefill); //DFCH
//DFCH
/*_auxGrayLevelValidationFill = (_tmpiglfill!=_graylevel) &&
(_tmpiglfill>=_graylevelbasefill-_tolerancefill) &&
(_tmpiglfill<=_graylevelbasefill+_tolerancefill) &&
(_tmpDistfill<=_distbasefill);*/ //DFCH
//DFCH
/*_auxGrayLevelValidationFill = (_tmpiglfill!=_graylevel) &&
(_tmpiglfill>=_graylevelbasefill-_tolerancefill) &&
(_tmpiglfill<=_graylevelbasefill+_tolerancefill) &&
(_tmpDistfill<=_distbasefill);*/ //DFCH
- _image->SetScalarComponentFromFloat(px, py, pz, 0,
- (float) _graylevel);
+ if (_image2!=NULL)
+ {
+ _image2->SetScalarComponentFromFloat(px, py, pz, 0,(float) _graylevel);
+ } else {
+ _image->SetScalarComponentFromFloat(px, py, pz, 0,(float) _graylevel);
+ }
//FillToolRecursive(px+1,py,pz);
//FillToolRecursive(px-1,py,pz);
FillToolRecursive(px, py + 1, pz);
//FillToolRecursive(px+1,py,pz);
//FillToolRecursive(px-1,py,pz);
FillToolRecursive(px, py + 1, pz);
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
&& (pz >= _minZ) && (pz <= _maxZ)) {
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
&& (pz >= _minZ) && (pz <= _maxZ)) {
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
_tolerancefill = tolerancefill;
}
//---------------------------------------------------------------------------
_tolerancefill = tolerancefill;
}
//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-void FillFilter::SetRangeMin(int min) {
- _RangeMin = min;
-}
-
-//---------------------------------------------------------------------------
-void FillFilter::SetRangeMax(int max) {
- _RangeMax = max;
-}
-
-//---------------------------------------------------------------------------
-int FillFilter::GetRangeMin() {
- return (_RangeMin);
-}