]> Creatis software - bbtk.git/commitdiff
#3527 BinaryOperations box need the same size for both images
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 18 Nov 2024 13:11:18 +0000 (14:11 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 18 Nov 2024 13:11:18 +0000 (14:11 +0100)
packages/vtk/src/bbvtkBinaryOperations.cxx

index 480534dd2014617dca2a4c44a377767bedd9b227..69ff24f80b83883cef7292897b3310f5723e17f3 100644 (file)
@@ -53,12 +53,9 @@ void BinaryOperations::Process()
         bbSetOutputOut(NULL);
         return;
     }
-    
-    
+
     if ( (bbGetInputOperation()>=0) &&  (bbGetInputOperation()<=5) )
     {
-        
         if (ope!=NULL)
         {
             ope->Delete();
@@ -73,7 +70,6 @@ void BinaryOperations::Process()
     #if (VTK_MAJOR_VERSION >= 6)
         ope->SetInput1Data((vtkDataObject*)bbGetInputIn1());
     #endif
-        
      
         if (bbGetInputIn2() != NULL)
         {
@@ -90,6 +86,17 @@ void BinaryOperations::Process()
             return;
         }
 
+        int ext1[6];
+        int ext2[6];
+        bbGetInputIn1()->GetExtent(ext1);
+        bbGetInputIn2()->GetExtent(ext2);
+        if ( (ext1[0]!=ext2[0]) || (ext1[1]!=ext2[1]) || (ext1[2]!=ext2[2])  || (ext1[3]!=ext2[3])  || (ext1[4]!=ext2[4])  || (ext1[5]!=ext2[5]) )
+        {
+            printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Sizes of images are not the same.\n", bbGetFullName().c_str() );
+            bbSetOutputOut(NULL);
+            return;
+        }
+        
         switch ( bbGetInputOperation() )
         {
             case 0: