X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=packages%2Fvtk%2Fsrc%2FbbvtkMIPCreator.cxx;h=0e737bd9b168464c798c046abe9ade27fd5ac494;hb=4743efc603c9eeac3b8bc509b5112a76d12b1375;hp=a398952569dd1540f40619886e4926da3c9fc138;hpb=1e2df7fb6ae571ce1cf72e6af1715f0e34675cbf;p=bbtk.git diff --git a/packages/vtk/src/bbvtkMIPCreator.cxx b/packages/vtk/src/bbvtkMIPCreator.cxx index a398952..0e737bd 100644 --- a/packages/vtk/src/bbvtkMIPCreator.cxx +++ b/packages/vtk/src/bbvtkMIPCreator.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbvtkMIPCreator.cxx,v $ Language: C++ - Date: $Date: 2008/11/25 11:17:23 $ - Version: $Revision: 1.5 $ + Date: $Date: 2009/05/15 14:58:01 $ + Version: $Revision: 1.6 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -52,20 +52,21 @@ namespace bbvtk - void MIPCreator::bbUserConstructor() + //--------------------------------------------------------------------- + void MIPCreator::bbUserSetDefaultValues() { - Init(); - bbSetInputShift(0); - bbSetInputScale(1.); + bbSetInputShift(0); + bbSetInputScale(1.0); + mCast = NULL; + mMIP = NULL; + mMapper = NULL; + mVolume = NULL; } - void MIPCreator::bbUserCopyConstructor(bbtk::BlackBox::Pointer) - { - Init(); - } - - void MIPCreator::Init() - { - + + //--------------------------------------------------------------------- + void MIPCreator::bbUserInitializeProcessing() + { + // Create the pipeline mCast = vtkImageShiftScale::New(); mCast->SetOutputScalarTypeToUnsignedChar(); @@ -87,12 +88,33 @@ namespace bbvtk bbSetOutputOut(mVolume); } - void MIPCreator::bbUserDestructor() + //--------------------------------------------------------------------- + void MIPCreator::bbUserFinalizeProcessing() { - mCast->Delete(); - mMIP->Delete(); - mMapper->Delete(); - mVolume->Delete(); + if (mCast!=NULL) + { + mCast->Delete(); + mCast=NULL; + } + + if (mMIP!=NULL) + { + mMIP->Delete(); + mMIP=NULL; + } + + if (mMapper!=NULL) + { + mMapper->Delete(); + mMapper=NULL; + } + + if (mVolume!=NULL) + { + mVolume->Delete(); + mVolume=NULL; + } + } //--------------------------------------------------------------------- @@ -100,7 +122,7 @@ namespace bbvtk void MIPCreator::Process() { mCast->SetInput( bbGetInputIn() ); - mCast->SetScale( bbGetInputScale() / 100. ); + mCast->SetScale( bbGetInputScale() / 100.0 ); mCast->SetShift( -bbGetInputShift() ); mMapper->Update();