]> Creatis software - creaRigidRegistration.git/commitdiff
#3471 Add manual option to CompareImageSwitcherWidget
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 23 Apr 2024 11:03:15 +0000 (13:03 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 23 Apr 2024 11:03:15 +0000 (13:03 +0200)
PackRecalage/bbs/boxes/CompareImagesSwitcherWidget_3Dp.bbg
PackRecalage/bbs/boxes/CompareImagesSwitcherWidget_3Dp.bbs
PackRecalage/src/bbPackRecalageImageSwitcherFilter.cxx
PackRecalage/src/bbPackRecalageImageSwitcherFilter.h

index 2cc6c5c135c9dafe1ce0661a4963106e18f18fcd..6eb1472bc7ade93d3c2d9cb3f057bf3eb9440941 100644 (file)
@@ -29,18 +29,20 @@ COMPLEX_PORT
 windowcolorlevel
 26.116036:118.799900:-900.000000
 FIN_COMPLEX_PORT
-BOXES:47
+BOXES:60
 BOX
 PackRecalage:ImageSwitcherBox:switch
 ISEXEC:FALSE
-35.808314:39.559590:-900.000000
-60.328314:37.059590:-900.000000
+17.204325:54.153237:-900.000000
+41.724325:51.653237:-900.000000
+PORT
+Title:"200"
 FIN_BOX
 BOX
 wx:CheckBox:checkS
 ISEXEC:FALSE
-99.970091:48.296279:-900.000000
-121.755091:45.796279:-900.000000
+107.667949:73.655113:-900.000000
+129.452949:71.155113:-900.000000
 PORT
 In:"true"
 PORT
@@ -49,14 +51,14 @@ FIN_BOX
 BOX
 wx:Slider:sdrT
 ISEXEC:FALSE
-56.777333:48.066658:-900.000000
-86.577333:45.566658:-900.000000
+26.064277:72.980860:-900.000000
+55.864277:70.480860:-900.000000
 PORT
 In:"500"
 PORT
 Max:"1000"
 PORT
-Min:"0"
+Min:"200"
 PORT
 ReactiveOnTrack:"True"
 FIN_BOX
@@ -115,16 +117,16 @@ FIN_BOX
 BOX
 vtk:GetVectorVtkImageDataElement:Box19
 ISEXEC:FALSE
--138.982871:97.038762:-900.000000
--115.147871:94.538762:-900.000000
+-155.694844:97.038762:-900.000000
+-131.859844:94.538762:-900.000000
 PORT
 I:"1"
 FIN_BOX
 BOX
 vtk:GetVectorVtkImageDataElement:Box21
 ISEXEC:FALSE
--124.050297:90.126201:-900.000000
--100.215297:87.626201:-900.000000
+-140.762270:90.126201:-900.000000
+-116.927270:87.626201:-900.000000
 PORT
 I:"1"
 FIN_BOX
@@ -157,16 +159,16 @@ FIN_BOX
 BOX
 vtk:GetVectorVtkImageDataElement:Box26
 ISEXEC:FALSE
--207.179942:93.857994:-900.000000
--183.344942:91.357994:-900.000000
+-280.873704:87.012125:-900.000000
+-257.038704:84.512125:-900.000000
 PORT
 I:"0"
 FIN_BOX
 BOX
 vtk:GetVectorVtkImageDataElement:Box27
 ISEXEC:FALSE
--175.213103:88.435397:-900.000000
--151.378103:85.935397:-900.000000
+-255.551384:82.797623:-900.000000
+-231.716384:80.297623:-900.000000
 PORT
 I:"0"
 FIN_BOX
@@ -347,8 +349,8 @@ FIN_BOX
 BOX
 wx:CheckBox:Box64
 ISEXEC:FALSE
-126.816162:48.316211:-900.000000
-148.446162:45.816211:-900.000000
+134.633997:74.683788:-900.000000
+156.263997:72.183788:-900.000000
 PORT
 In:"true"
 PORT
@@ -357,24 +359,118 @@ FIN_BOX
 BOX
 std:MultipleInputs:Box65
 ISEXEC:FALSE
--114.976662:-4.084889:-900.000000
--93.006662:-6.584889:-900.000000
+-113.869242:-6.078245:-900.000000
+-91.899242:-8.578245:-900.000000
 FIN_BOX
 BOX
 std:MultipleInputs:Box66
 ISEXEC:FALSE
--11.875208:27.305416:-900.000000
-10.094792:24.805416:-900.000000
+28.760696:25.841059:-900.000000
+50.730696:23.341059:-900.000000
 FIN_BOX
 BOX
 wx:CommandButton:Box67
 ISEXEC:FALSE
-114.591980:18.682653:-900.000000
-136.866980:16.182653:-900.000000
+49.245053:54.559397:-900.000000
+71.520053:52.059397:-900.000000
 PORT
 Label:"Switch"
 FIN_BOX
-CONNECTIONS:75
+BOX
+vtk:AddImageToVector:Box70
+ISEXEC:FALSE
+-268.739369:73.708456:-900.000000
+-244.219369:71.208456:-900.000000
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box72
+ISEXEC:FALSE
+-276.390634:35.452131:-900.000000
+-252.555634:32.952131:-900.000000
+FIN_BOX
+BOX
+std:StringSelect:Box73
+ISEXEC:FALSE
+-94.572419:67.063936:-900.000000
+-70.052419:64.563936:-900.000000
+PORT
+In0:"0 1"
+PORT
+In1:"0 0"
+PORT
+In2:"1 1"
+FIN_BOX
+BOX
+wx:RadioButton:Box74
+ISEXEC:FALSE
+66.506842:73.507107:-900.000000
+103.346842:71.007107:-900.000000
+PORT
+In0:"A B"
+PORT
+In1:"A A"
+PORT
+In2:"B B"
+FIN_BOX
+BOX
+std:GetVectorIntElement:Box75
+ISEXEC:FALSE
+-104.841221:61.224813:-900.000000
+-82.181221:58.724813:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box76
+ISEXEC:FALSE
+-239.839538:35.411659:-900.000000
+-216.004538:32.911659:-900.000000
+FIN_BOX
+BOX
+std:GetVectorIntElement:Box77
+ISEXEC:FALSE
+-75.538692:61.184341:-900.000000
+-52.878692:58.684341:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+vtk:AddImageToVector:Box84
+ISEXEC:FALSE
+-162.521492:77.292267:-900.000000
+-138.001492:74.792267:-900.000000
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box85
+ISEXEC:FALSE
+-170.172757:39.035942:-900.000000
+-146.337757:36.535942:-900.000000
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box88
+ISEXEC:FALSE
+-133.621661:38.995470:-900.000000
+-109.786661:36.495470:-900.000000
+FIN_BOX
+BOX
+vtk:AddImageToVector:Box90
+ISEXEC:FALSE
+-62.344088:78.057191:-900.000000
+-37.824088:75.557191:-900.000000
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box91
+ISEXEC:FALSE
+-69.995353:39.800866:-900.000000
+-46.160353:37.300866:-900.000000
+FIN_BOX
+BOX
+vtk:GetVectorVtkImageDataElement:Box94
+ISEXEC:FALSE
+-33.444256:39.760394:-900.000000
+-9.609256:37.260394:-900.000000
+FIN_BOX
+CONNECTIONS:97
 CONNECTION
 checkS:Out:switch:On
 NumberOfControlPoints:0
@@ -418,24 +514,6 @@ CONNECTION
 Box23:Out:Box21:In
 NumberOfControlPoints:0
 CONNECTION
-Box19:Out:Box17:In1
-NumberOfControlPoints:0
-CONNECTION
-Box21:Out:Box17:In2
-NumberOfControlPoints:0
-CONNECTION
-Box26:Out:Box25:In1
-NumberOfControlPoints:0
-CONNECTION
-Box27:Out:Box25:In2
-NumberOfControlPoints:0
-CONNECTION
-Box31:Out:Box30:In1
-NumberOfControlPoints:0
-CONNECTION
-Box32:Out:Box30:In2
-NumberOfControlPoints:0
-CONNECTION
 Box29:Widget:Box10:Widget2
 NumberOfControlPoints:0
 CONNECTION
@@ -600,4 +678,88 @@ NumberOfControlPoints:0
 CONNECTION
 Box66:BoxChange:Box30:BoxExecute
 NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box70:In0
+NumberOfControlPoints:0
+CONNECTION
+Box27:Out:Box70:In1
+NumberOfControlPoints:0
+CONNECTION
+Box70:Out:Box72:In
+NumberOfControlPoints:0
+CONNECTION
+Box74:Widget:Box47:Widget4
+NumberOfControlPoints:0
+CONNECTION
+Box74:Out:Box73:In
+NumberOfControlPoints:0
+CONNECTION
+Box73:Out:Box75:In
+NumberOfControlPoints:0
+CONNECTION
+Box75:Out:Box72:I
+NumberOfControlPoints:0
+CONNECTION
+Box77:Out:Box76:I
+NumberOfControlPoints:0
+CONNECTION
+Box73:Out:Box77:In
+NumberOfControlPoints:0
+CONNECTION
+Box72:Out:Box25:In1
+NumberOfControlPoints:0
+CONNECTION
+Box76:Out:Box25:In2
+NumberOfControlPoints:0
+CONNECTION
+Box70:Out:Box76:In
+NumberOfControlPoints:0
+CONNECTION
+Box84:Out:Box85:In
+NumberOfControlPoints:0
+CONNECTION
+Box84:Out:Box88:In
+NumberOfControlPoints:0
+CONNECTION
+Box90:Out:Box91:In
+NumberOfControlPoints:0
+CONNECTION
+Box90:Out:Box94:In
+NumberOfControlPoints:0
+CONNECTION
+Box31:Out:Box90:In0
+NumberOfControlPoints:0
+CONNECTION
+Box32:Out:Box90:In1
+NumberOfControlPoints:0
+CONNECTION
+Box91:Out:Box30:In1
+NumberOfControlPoints:0
+CONNECTION
+Box94:Out:Box30:In2
+NumberOfControlPoints:0
+CONNECTION
+Box75:Out:Box85:I
+NumberOfControlPoints:0
+CONNECTION
+Box77:Out:Box88:I
+NumberOfControlPoints:0
+CONNECTION
+Box75:Out:Box91:I
+NumberOfControlPoints:0
+CONNECTION
+Box77:Out:Box94:I
+NumberOfControlPoints:0
+CONNECTION
+Box85:Out:Box17:In1
+NumberOfControlPoints:0
+CONNECTION
+Box88:Out:Box17:In2
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box84:In0
+NumberOfControlPoints:0
+CONNECTION
+Box21:Out:Box84:In1
+NumberOfControlPoints:0
 APP_END
index c64b9a6dd3ccc5cfe5e54efb3308938c5f36ef73..40fb2a33f66a1208597f3264408828b99c04be07 100644 (file)
@@ -19,6 +19,7 @@ description "creatisRecalage"
 category "example"
 
 new PackRecalage:ImageSwitcherBox switch
+  set switch.Title "200"
 
 new wx:CheckBox checkS
   set checkS.In "true"
@@ -27,7 +28,7 @@ new wx:CheckBox checkS
 new wx:Slider sdrT
   set sdrT.In "500"
   set sdrT.Max "1000"
-  set sdrT.Min "0"
+  set sdrT.Min "200"
   set sdrT.ReactiveOnTrack "True"
 
 new wx:LayoutSplit switchWindow
@@ -143,6 +144,40 @@ new std:MultipleInputs Box66
 new wx:CommandButton Box67
   set Box67.Label "Switch"
 
+new vtk:AddImageToVector Box70
+
+new vtk:GetVectorVtkImageDataElement Box72
+
+new std:StringSelect Box73
+  set Box73.In0 "0 1"
+  set Box73.In1 "0 0"
+  set Box73.In2 "1 1"
+
+new wx:RadioButton Box74
+  set Box74.In0 "A B"
+  set Box74.In1 "A A"
+  set Box74.In2 "B B"
+
+new std:GetVectorIntElement Box75
+  set Box75.I "0"
+
+new vtk:GetVectorVtkImageDataElement Box76
+
+new std:GetVectorIntElement Box77
+  set Box77.I "1"
+
+new vtk:AddImageToVector Box84
+
+new vtk:GetVectorVtkImageDataElement Box85
+
+new vtk:GetVectorVtkImageDataElement Box88
+
+new vtk:AddImageToVector Box90
+
+new vtk:GetVectorVtkImageDataElement Box91
+
+new vtk:GetVectorVtkImageDataElement Box94
+
 
 connect checkS.Out switch.On
 connect sdrT.Out switch.Time
@@ -155,12 +190,6 @@ connect Box12.Widget Box10.Widget1
 connect Box10.Widget switchWindow.Widget1
 connect Box22.Out Box19.In
 connect Box23.Out Box21.In
-connect Box19.Out Box17.In1
-connect Box21.Out Box17.In2
-connect Box26.Out Box25.In1
-connect Box27.Out Box25.In2
-connect Box31.Out Box30.In1
-connect Box32.Out Box30.In2
 connect Box29.Widget Box10.Widget2
 connect Box22.Out Box26.In
 connect Box23.Out Box27.In
@@ -215,6 +244,34 @@ connect Box67.BoxChange Box66.In2
 connect Box66.BoxChange Box25.BoxExecute
 connect Box66.BoxChange Box17.BoxExecute
 connect Box66.BoxChange Box30.BoxExecute
+connect Box26.Out Box70.In0
+connect Box27.Out Box70.In1
+connect Box70.Out Box72.In
+connect Box74.Widget Box47.Widget4
+connect Box74.Out Box73.In
+connect Box73.Out Box75.In
+connect Box75.Out Box72.I
+connect Box77.Out Box76.I
+connect Box73.Out Box77.In
+connect Box72.Out Box25.In1
+connect Box76.Out Box25.In2
+connect Box70.Out Box76.In
+connect Box84.Out Box85.In
+connect Box84.Out Box88.In
+connect Box90.Out Box91.In
+connect Box90.Out Box94.In
+connect Box31.Out Box90.In0
+connect Box32.Out Box90.In1
+connect Box91.Out Box30.In1
+connect Box94.Out Box30.In2
+connect Box75.Out Box85.I
+connect Box77.Out Box88.I
+connect Box75.Out Box91.I
+connect Box77.Out Box94.I
+connect Box85.Out Box17.In1
+connect Box88.Out Box17.In2
+connect Box19.Out Box84.In0
+connect Box21.Out Box84.In1
 
 # Complex input ports
 input ImageVector1 Box22.In " "
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)
index 3eed22f70ae08abccb5ff73352458a2530f2450f..66231887316313931a5c9ec662e811be4ee9ee4e 100644 (file)
@@ -20,6 +20,7 @@ class bbPackRecalage_EXPORT ImageSwitcherFilter
 //===== 
 // 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)
 //===== 
+  BBTK_DECLARE_INPUT(Active,bool);
   BBTK_DECLARE_INPUT(In1,vtkImageData*);
   BBTK_DECLARE_INPUT(In2,vtkImageData*);
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
@@ -33,19 +34,19 @@ class bbPackRecalage_EXPORT ImageSwitcherFilter
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSwitcherFilter,bbtk::AtomicBlackBox);
-BBTK_NAME("ImageSwitcherFilter");
-BBTK_AUTHOR("Info-Dev");
-BBTK_DESCRIPTION("Switch image between In1 and In2");
-BBTK_CATEGORY("empty");
-BBTK_INPUT(ImageSwitcherFilter,In1,"Input image 1",vtkImageData*,"");
-BBTK_INPUT(ImageSwitcherFilter,In2,"Input image 2",vtkImageData*,"");
-BBTK_OUTPUT(ImageSwitcherFilter,Out,"Output image",vtkImageData*,"");
+  BBTK_NAME("ImageSwitcherFilter");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("Switch image between In1 and In2");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(ImageSwitcherFilter,Active,"(default true)  true/false",bool,"");
+  BBTK_INPUT(ImageSwitcherFilter,In1,"Input image 1",vtkImageData*,"");
+  BBTK_INPUT(ImageSwitcherFilter,In2,"Input image 2",vtkImageData*,"");
+  BBTK_OUTPUT(ImageSwitcherFilter,Out,"Output image",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(ImageSwitcherFilter);
 //===== 
 // 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)
 //===== 
-}
-// EO namespace bbPackRecalage
+}// EO namespace bbPackRecalage
 
 #endif // __bbPackRecalageImageSwitcherFilter_h_INCLUDED__