]> Creatis software - creaVtk.git/commitdiff
#3480 bug ApplyMask
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 28 Jan 2022 14:45:09 +0000 (15:45 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 28 Jan 2022 14:45:09 +0000 (15:45 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx

index 8d346915a5c27c3a62e2b757ed69c2a52194e986..03baf29676d02b9081c2e107db594ec6424ac379 100644 (file)
@@ -38,7 +38,7 @@ void ApplyMask::Process()
                int                             extMask[6];
                vtkImageData            *resultImage=NULL;
                bbGetInputImage()->GetExtent( extImage );
-               bbGetInputImage()->GetExtent( extMask );
+        bbGetInputMask()->GetExtent( extMask );
                int dimXImage           = extImage[1]-extImage[0]+1;
                int dimYImage           = extImage[3]-extImage[2]+1;
                int dimZImage           = extImage[5]-extImage[4]+1;
@@ -133,7 +133,12 @@ if ( (k1omp==i) || (k2omp==i) || (k3omp==i) ||
                } //if dim
                resultImage->Modified();
                bbSetOutputOut( resultImage );
-       } // if Image && Mask   
+    } else {
+        if (bbGetInputType()==2)
+        {
+            bbSetOutputOut( bbGetInputImage() );
+        }
+    }// if Image && Mask
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)