From 879c32e4e9dab882f99c737dc8ec1d82327a36e9 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 16 Jun 2021 23:01:28 +0200 Subject: [PATCH] #3467 Bug: InvertCrop Dimension of 2D or 3D --- packages/vtk/src/bbvtkInversCrop.cxx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx index b43fa79..68b2b1c 100644 --- a/packages/vtk/src/bbvtkInversCrop.cxx +++ b/packages/vtk/src/bbvtkInversCrop.cxx @@ -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" ); } -- 2.47.1