-void FillFilter::SetImage(vtkImageData *image) // virtual
- {
- baseFilterManualPaint::SetImage(image);
+void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
+{
+ baseFilterManualPaint::SetImages(image,image2);
_auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
_auxImageFill->SetOrigin(0, 0, 0);
_auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
_auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
_auxImageFill->SetOrigin(0, 0, 0);
_auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
_auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
_auxImageFill->SetScalarTypeToUnsignedChar();
_auxImageFill->AllocateScalars();
_auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
_auxImageFill->SetScalarTypeToUnsignedChar();
_auxImageFill->AllocateScalars();
memset(pImage, 0, _maxX * _maxY * _maxZ);
FillToolRecursive(_px, _py, _pz);
memset(pImage, 0, _maxX * _maxY * _maxZ);
FillToolRecursive(_px, _py, _pz);
} // while
} //if _minX _maxX _minY _maxY _minZ _maxZ
}
//---------------------------------------------------------------------------
} // while
} //if _minX _maxX _minY _maxY _minZ _maxZ
}
//---------------------------------------------------------------------------
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);
-}
-
-//---------------------------------------------------------------------------
-int FillFilter::GetRangeMax() {
- return (_RangeMax);
-}