X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkInversCrop.cxx;h=b43fa796d68ca05f3d859f3d8a6eaca78aeaab86;hb=aaa8070f20da168c0ef2f8aa94c30015386cd100;hp=9e8c578b470416080901a12985baac01141fae44;hpb=68154940389c885479294aca34c0c8fe34b19a44;p=bbtk.git diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx index 9e8c578..b43fa79 100644 --- a/packages/vtk/src/bbvtkInversCrop.cxx +++ b/packages/vtk/src/bbvtkInversCrop.cxx @@ -71,8 +71,6 @@ void InversCrop::Process() _imageoutput=bbGetInputImageFix(); } - - // Copy the Move Image int j,k; int px,py,pz; @@ -87,26 +85,24 @@ void InversCrop::Process() int dimMoveX = ext[1]-ext[0]+1; int dimMoveY = ext[3]-ext[2]+1; int dimMoveZ = ext[5]-ext[4]+1; - int spxM = 0; // start px MoveImage int sizeXM = 0; // sizeX MoveImage - px = bbGetInputOrigin()[0]; spxM = 0; if (px<0) { - spxM=px*(-1); - px=0; + spxM = px*(-1); + px = 0; } sizeXM = dimMoveX-spxM; if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px; - sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize(); + sizeXM = sizeXM * bbGetInputImageFix()->GetScalarSize(); for (k=0; k=0) && (pz>=0) && (sizeXM>0) ) @@ -117,17 +113,15 @@ void InversCrop::Process() } // for j } // for k _imageoutput->Modified(); - } // If Image Fixe Move the same GetScalarType - else { + } else { // If Image Fixe Move the same GetScalarType printf ("ERROR: InversCrop both ImageFixe and ImageMove need the same format.\n"); printf (" type ImageFix:%d type ImageMove:%d\n", bbGetInputImageFix()->GetScalarType(), bbGetInputImageMove()->GetScalarType() ); } - } // If Image Fixe Move != NULL - else { - printf ("ERROR: InversCrop need ImageFixe and ImageMove to run.\n"); - } - bbSetOutputOut(_imageoutput); + } else { // If Image Fixe Move != NULL + printf ("ERROR: InversCrop need ImageFixe and ImageMove to run.\n"); + } + bbSetOutputOut(_imageoutput); } // if Active