X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkMIPCreator.cxx;h=58ee8ae42ec02c5da30f1e1239a353239079f01f;hb=a26b760bbfe886312cbe54bd83b7211f621edf80;hp=c4a04b87fd53180391e47c9cbe4b11066734929f;hpb=6575a389b71b1b85c79e4444885becb76ecf16e4;p=bbtk.git diff --git a/packages/vtk/src/bbvtkMIPCreator.cxx b/packages/vtk/src/bbvtkMIPCreator.cxx index c4a04b8..58ee8ae 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/10/17 08:18:30 $ - Version: $Revision: 1.4 $ + Date: $Date: 2010/04/08 14:37:59 $ + Version: $Revision: 1.7 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -33,39 +33,29 @@ * \brief */ - - #ifdef _USE_VTK_ - #include "bbvtkMIPCreator.h" #include "bbvtkPackage.h" namespace bbvtk { - - BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MIPCreator) BBTK_BLACK_BOX_IMPLEMENTATION(MIPCreator,bbtk::AtomicBlackBox); - - - - - - void MIPCreator::bbUserConstructor() - { - Init(); - bbSetInputShift(0); - bbSetInputScale(1.); - } - void MIPCreator::bbUserCopyConstructor() + + //--------------------------------------------------------------------- + void MIPCreator::bbUserSetDefaultValues() { - Init(); + bbSetInputShift(0); + bbSetInputScale(1.0); + mCast = NULL; + mMIP = NULL; + mMapper = NULL; + mVolume = NULL; } - - void MIPCreator::Init() - { - + //--------------------------------------------------------------------- + void MIPCreator::bbUserInitializeProcessing() + { // Create the pipeline mCast = vtkImageShiftScale::New(); mCast->SetOutputScalarTypeToUnsignedChar(); @@ -82,25 +72,44 @@ namespace bbvtk mVolume->SetMapper(mMapper); // mMapper->ScalarVisibilityOff(); - // mMapper->ImmediateModeRenderingOn(); + // mMapper->ImmediateModeRenderingOn(); 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; + } } //--------------------------------------------------------------------- void MIPCreator::Process() { mCast->SetInput( bbGetInputIn() ); - mCast->SetScale( bbGetInputScale() / 100. ); + mCast->SetScale( bbGetInputScale() / 100.0 ); mCast->SetShift( -bbGetInputShift() ); mMapper->Update();