From: eduardo.davila@creatis.insa-lyon.fr Date: Mon, 18 Nov 2024 13:11:18 +0000 (+0100) Subject: #3527 BinaryOperations box need the same size for both images X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d44088262a6bd756de8ec1e27292697b31cf1d8c;p=bbtk.git #3527 BinaryOperations box need the same size for both images --- 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: