]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkInversCrop.cxx
#3013 BBTK Feature New Normal - package vtk box InvertCrop Type option
[bbtk.git] / packages / vtk / src / bbvtkInversCrop.cxx
index b56a85132101be44898637c72898c9b8aa352809..97963bca7327d6d4f3edc07a6ac10e4ba8019d7f 100644 (file)
@@ -38,13 +38,21 @@ void InversCrop::Process()
        dim[0]= ext[1]-ext[0]+1;
        dim[1]= ext[3]-ext[2]+1;
        dim[2]= ext[5]-ext[4]+1;
-               
-       _imageoutput = vtkImageData::New();
-       _imageoutput->Initialize();
-       _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() );
-       _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() );
-       _imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
-       _imageoutput->AllocateScalars();
+
+       if (bbGetInputType()==0)
+       {
+               _imageoutput = vtkImageData::New();
+               _imageoutput->Initialize();
+               _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() );
+               _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() );
+               _imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
+               _imageoutput->AllocateScalars();
+       }
+       if (bbGetInputType()==1)
+       {
+               _imageoutput=bbGetInputImageFix();
+       }
+
 
         // Duplicating Fix Image
        long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize();    
@@ -109,6 +117,7 @@ void InversCrop::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
+   bbSetInputType(0);
    bbSetInputImageFix(NULL);
    bbSetInputImageMove(NULL);