From d44088262a6bd756de8ec1e27292697b31cf1d8c Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Mon, 18 Nov 2024 14:11:18 +0100 Subject: [PATCH] #3527 BinaryOperations box need the same size for both images --- packages/vtk/src/bbvtkBinaryOperations.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/vtk/src/bbvtkBinaryOperations.cxx b/packages/vtk/src/bbvtkBinaryOperations.cxx index 480534d..69ff24f 100644 --- a/packages/vtk/src/bbvtkBinaryOperations.cxx +++ b/packages/vtk/src/bbvtkBinaryOperations.cxx @@ -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: -- 2.47.1