]> Creatis software - creaRigidRegistration.git/blobdiff - PackRecalage/src/bbPackRecalageImageSwitcherFilter.cxx
#3471 Add manual option to CompareImageSwitcherWidget
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageImageSwitcherFilter.cxx
index 4605dfec7f7ba32932036b59596c60c24bce6c82..ad45b047a2513378b376e00a99a7e6e960aa269f 100644 (file)
@@ -30,19 +30,19 @@ void ImageSwitcherFilter::Process()
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
 
 
-   if (flag==0)
-   {
-    bbSetOutputOut( bbGetInputIn1() );
-   }
-  
-   if (flag==1)
-   {
-    bbSetOutputOut( bbGetInputIn2() );
-   }
-
-    flag++;
-    flag=(flag%2);
-
+    if (bbGetInputActive()==true)
+    {
+        if (flag==0)
+        {
+            bbSetOutputOut( bbGetInputIn1() );
+        }
+        if (flag==1)
+        {
+            bbSetOutputOut( bbGetInputIn2() );
+        }
+        flag++;
+        flag=(flag%2);
+    } // if Active
 }
 //===== 
 // 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)
@@ -52,10 +52,10 @@ void ImageSwitcherFilter::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-   flag=0;
-   bbSetInputIn1(NULL);
-   bbSetInputIn2(NULL);
-     
+    flag=0;
+    bbSetInputActive(true);
+    bbSetInputIn1(NULL);
+    bbSetInputIn2(NULL);
 }
 //===== 
 // 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)