]> Creatis software - bbtk.git/commitdiff
#3467 Bug: InvertCrop Dimension of 2D or 3D
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 16 Jun 2021 21:01:28 +0000 (23:01 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 16 Jun 2021 21:01:28 +0000 (23:01 +0200)
packages/vtk/src/bbvtkInversCrop.cxx

index b43fa796d68ca05f3d859f3d8a6eaca78aeaab86..68b2b1c4797895febcef1449f6f40a6a74030f32 100644 (file)
@@ -26,6 +26,8 @@ void InversCrop::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
+printf("\n\n EED InversCrop::Process Start \n" );
+
        if (bbGetInputActive()==true)
        {
            if ( (bbGetInputImageFix()!=NULL) && (bbGetInputImageMove()!=NULL) )
@@ -45,7 +47,14 @@ void InversCrop::Process()
 #endif
                dim[0]= ext[1]-ext[0]+1;
                dim[1]= ext[3]-ext[2]+1;
-               dim[2]= ext[5]-ext[4]+1;
+               dim[2] = 1;
+               if (bbGetInputImageFix()->GetDataDimension()==3) 
+               {
+                       dim[2] = ext[5]-ext[4]+1;
+               } 
+               
+printf("EED InversCrop::Process 1   %d\n", bbGetInputImageFix()->GetDataDimension()    );
+printf("EED InversCrop::Process 2   %d %d  %d \n",dim[0],dim[1],dim[2]  );
 
                if (bbGetInputType()==0)
                {
@@ -84,7 +93,17 @@ void InversCrop::Process()
 #endif
                int dimMoveX    = ext[1]-ext[0]+1;
                int dimMoveY    = ext[3]-ext[2]+1;
-               int dimMoveZ    = ext[5]-ext[4]+1;
+               int dimMoveZ    = 1;
+               if (bbGetInputImageMove()->GetDataDimension()==3) 
+               {
+                       dimMoveZ = ext[5]-ext[4]+1;
+               } 
+
+               
+               printf("EED InversCrop::Process 3   %d %d  %d \n",dimMoveX,dimMoveY,dimMoveZ  );
+
+               
+               
                int spxM                = 0;  // start px MoveImage
                int sizeXM              = 0;  // sizeX MoveImage
                px                              = bbGetInputOrigin()[0];
@@ -124,6 +143,7 @@ void InversCrop::Process()
         bbSetOutputOut(_imageoutput);
 
        } // if Active
+printf("EED InversCrop::Process End \n" );
 
 }