BBTK_BLACK_BOX_IMPLEMENTATION(ReSlicerBox,bbtk::AtomicBlackBox);
void ReSlicerBox::Process()
{
-
- if(!bbGetInputOrigin().empty())
+ if(!bbGetInputOrigin().empty() && bbGetInputTransform() != NULL)
{
- image = vtkImageChangeInformation::New();
+ //image = vtkImageChangeInformation::New();
image->SetInput( bbGetInputIn() );
image->SetOutputSpacing( 1,1,1 );
+
if(bbGetInputCentered())
{
image->CenterImageOn();
}
-
- slicer =vtkImageReslice::New();
+
+ //slicer =vtkImageReslice::New();
slicer->SetInput( image->GetOutput() );
slicer->SetInformationInput( image->GetOutput() );
slicer->SetResliceTransform(bbGetInputTransform());
}
slicer->Update();
- imageResult = vtkImageChangeInformation::New();
+ //imageResult = vtkImageChangeInformation::New();
imageResult->SetInput( slicer->GetOutput() );
double spc[3];
bbGetInputIn()->GetSpacing(spc);
imageResult->SetOutputSpacing( spc );
imageResult->SetOutputOrigin( 0,0,0 );
- bbSetOutputOut( imageResult->GetOutput() );
+ bbSetOutputOut( imageResult->GetOutput() );
}
else
{
- bbSetOutputOut( bbGetInputIn() );
- }
-
+ bbSetOutputOut( NULL );
+ }
}
void ReSlicerBox::bbUserSetDefaultValues()
{
std::vector<int> empty;
bbSetInputOrigin(empty);
bbSetInputIn(NULL);
- bbSetInputTransform(vtkTransform::New());
+ bbSetInputTransform(NULL);
bbSetOutputOut(NULL);
bbSetInputCentered(false);
bbSetInputInterpolate(false);
imageResult = vtkImageChangeInformation::New();
}
void ReSlicerBox::bbUserFinalizeProcessing()
-{
-
-// THE FINALIZATION METHOD BODY :
-// Here does nothing
-// but this is where you should desallocate the internal/output pointers
-// if any
+{
image->Delete();
slicer->Delete();
imageResult->Delete();