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 $
=========================================================================*/
/* ---------------------------------------------------------------------
* \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();
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();