]> Creatis software - bbtk.git/commitdiff
2024 Feature ( FLIP X Y Z ) and the original option or no flip
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 24 Jun 2013 12:42:04 +0000 (14:42 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 24 Jun 2013 12:42:04 +0000 (14:42 +0200)
packages/vtk/src/bbvtkFlip.cxx
packages/vtk/src/bbvtkFlip.h

index d37aa6fb2c8a9e759174bc23d8e19c56c10af017..a252888c5a04d9bffdaddef6a76f19e3dab1f7b8 100644 (file)
@@ -114,6 +114,7 @@ void Flip::Process()
                int scalarSize  = bbGetInputIn()->GetScalarSize();
                int lineSize    = inputdims[0]*scalarSize*nbScalComp;      
                int planeSize   = inputdims[1]*lineSize;
+                int volumeSize  = inputdims[2]*planeSize;
                char *pixelsIn  = (char *)bbGetInputIn()->GetScalarPointer();
                char *pixelsOut = (char *)mImageOut->GetScalarPointer();
        
@@ -123,7 +124,12 @@ void Flip::Process()
                char *debPlanOut;
                int i,j,k;
                
-               if ( (bbGetInputAxis()=="X") || (bbGetInputAxis()=="x") )
+               if ( (bbGetInputAxis()=="O") || (bbGetInputAxis()=="o") )
+               {  
+                       pixelsIn = (char *)bbGetInputIn()->GetScalarPointer(0,0,0);
+                       pixelsOut = (char *)mImageOut->GetScalarPointer(0,0,0);
+                       memcpy(pixelsOut,  pixelsIn, volumeSize );
+               } else if ( (bbGetInputAxis()=="X") || (bbGetInputAxis()=="x") )
                {  
 
                        for(k=0; k<inputdims[2]; k++)  // iterate  planes
index 3cf69561e19d438169f50410fb16a63e734ed533..48dcfd14c3a7813ced5c105e8e12ac56d2a1d6cc 100644 (file)
@@ -86,7 +86,7 @@ namespace bbvtk
   BBTK_DESCRIPTION("flips a <vtkImageData*>");
   BBTK_CATEGORY("application, image");
   BBTK_INPUT(Flip, In, "image", vtkImageData *, "");
-  BBTK_INPUT(Flip, Axis, "Axe (default Y)  X Y Z", std::string, "");
+  BBTK_INPUT(Flip, Axis, "Axe (default Y)  X Y Z O(original)", std::string, "");
   BBTK_OUTPUT(Flip, Out, "fliped image", vtkImageData *, "");
   BBTK_END_DESCRIBE_BLACK_BOX(Flip);   
   //=================================================================