]> Creatis software - creaRigidRegistration.git/blobdiff - PackRecalage/src/bbPackRecalageReSlicerBox.cxx
*** empty log message ***
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageReSlicerBox.cxx
index c30ee0f49a5635017baebd9ccb075312f709a5f4..7719669172df88cf7d90ce9aeee46b8c49b61b80 100644 (file)
@@ -8,18 +8,18 @@ BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,ReSlicerBox)
 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());
@@ -30,27 +30,26 @@ void ReSlicerBox::Process()
                }               
                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);
@@ -68,12 +67,7 @@ void ReSlicerBox::bbUserInitializeProcessing()
        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();