]> Creatis software - bbtk.git/commitdiff
#3467 Bug: InvertCrop Dimension of 2D or 3D
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 21 Jun 2021 13:25:52 +0000 (15:25 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 21 Jun 2021 13:25:52 +0000 (15:25 +0200)
kernel/src/bbtkBlackBox.cxx
packages/vtk/src/bbvtkInversCrop.cxx

index 38b018b4a75e95c8ab205da1760d92e95a439ffe..4b000f0e65acf32f76f242175a99c702252436b0 100644 (file)
@@ -748,9 +748,9 @@ namespace bbtk
                           ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
                         )
                        {
-printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
+//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
                                this->bbProcess();              
-printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
+//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
                    } // Manual analysis
                  
 //EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
index 1c71fe01fafe20e98a37f7568354ab36c9e5fd25..9064a09d20cce394198cdd96199bf18c550db20d 100644 (file)
@@ -26,8 +26,6 @@ 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) )
@@ -52,10 +50,6 @@ printf("\n\n EED InversCrop::Process Start \n" );
                {
                        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)
                {
                        _imageoutput = vtkImageData::New();
@@ -70,7 +64,7 @@ printf("EED InversCrop::Process 2   %d %d  %d \n",dim[0],dim[1],dim[2]  );
 #if (VTK_MAJOR_VERSION >= 6) 
                        _imageoutput->AllocateScalars(bbGetInputImageFix()->GetScalarType() , 1);
 #endif
-                       
+               
                        // Duplicating Fix Image
                        long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize();    
                        memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage);
@@ -98,38 +92,27 @@ printf("EED InversCrop::Process 2   %d %d  %d \n",dim[0],dim[1],dim[2]  );
                {
                        dimMoveZ = ext[5]-ext[4]+1;
                } 
-printf("EED InversCrop::Process 3   %d %d  %d \n",dimMoveX,dimMoveY,dimMoveZ  );
-
-
                double org[3];
                org[0]=0;
                org[1]=0;
-               org[2]=0;
-               
+               org[2]=0;               
                if (bbGetInputOrigin().size()==3)
                {
                        org[0]=bbGetInputOrigin()[0];
                        org[1]=bbGetInputOrigin()[1];
                        org[2]=bbGetInputOrigin()[2];
                }
-               
                if (bbGetInputOrigin().size()==2)
                {
                        org[0]=bbGetInputOrigin()[0];
                        org[1]=bbGetInputOrigin()[1];
                }
-
                if (bbGetInputOrigin().size()==1)
                {
                        org[0]=bbGetInputOrigin()[0];
                }
-
-               
                int spxM                = 0;  // start px MoveImage
                int sizeXM              = 0;  // sizeX MoveImage
-printf("EED InversCrop::Process 3.1   sizeOrigin %d \n", bbGetInputOrigin().size() );
-printf("EED InversCrop::Process 3.1   Origin %f  %f %f\n", org[0],org[1],org[2] );
-
                px                              = org[0];
                spxM                    = 0;
                if (px<0)
@@ -140,7 +123,6 @@ printf("EED InversCrop::Process 3.1   Origin %f  %f %f\n", org[0],org[1],org[2]
                sizeXM  = dimMoveX-spxM;
                if (px+sizeXM>=dim[0]) { sizeXM=dim[0]-px; }
                sizeXM  = sizeXM * bbGetInputImageFix()->GetScalarSize();
-printf("4. \n");
                for (k=0; k<dimMoveZ; k++)
                {
                   for (j=0; j<dimMoveY; j++)
@@ -156,17 +138,10 @@ printf("4. \n");
                                 (py>=0)    && (pz>=0)  &&
                                         (sizeXM>0) ) 
                                {
-printf("5. \n");
-
                                        memcpy( _imageoutput->GetScalarPointer(px,py,pz) , bbGetInputImageMove()->GetScalarPointer(spxM,j,k) , sizeXM );
-printf("6. \n");
-
                                }
-
                   } // for j
                } // for k
-printf("EED InversCrop::Process 7   %d %d  %d \n",px,py,pz  );
-
                _imageoutput->Modified();
        } else { // If Image Fixe Move the same GetScalarType
                   printf ("ERROR: InversCrop  both ImageFixe and ImageMove need the same format.\n");
@@ -177,10 +152,7 @@ printf("EED InversCrop::Process 7   %d %d  %d \n",px,py,pz  );
                        printf ("ERROR: InversCrop  need ImageFixe and ImageMove to run.\n");
           } 
         bbSetOutputOut(_imageoutput);
-
        } // if Active
-printf("EED InversCrop::Process End \n" );
-
 }
 
 //=====