]> Creatis software - bbtk.git/blobdiff - packages/demo/bbs/appli/demoViewing1.bbs
Feature #1774
[bbtk.git] / packages / demo / bbs / appli / demoViewing1.bbs
index 4370f423a2d871b54b78749b460d6510b57d4219..594564e8871ec715d94443c25e0a778ced25b022 100644 (file)
@@ -1,35 +1,70 @@
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
 description "3 slicers and a 3D view"
 author "jpr@creatis.insa-lyon.fr"
 category "demo"
 
 // To show how easy it is to add smthing
+// =====================================
 
-load wxvtk
-include wx
 load vtk
+include wxvtk
 load std
-load itkvtk
 load itk
+include vtk
+include wx
+load itkvtk
+load gdcmvtk
+
 include wxvtk/boxes/bbSimpleSlicer
 
 new LayoutX4 main
-new LayoutLine upright
-new LayoutLine upleft
-new LayoutLine down
 
-connect upright.Widget main.Widget1
-connect upleft.Widget main.Widget2
-connect down.Widget main.Widget3
+new LayoutLine  upright
+new LayoutLine  upleft
+new LayoutLine  downleft
+new LayoutSplit downright
+   set downright.Proportion 85
+
+connect upright.Widget   main.Widget1
+connect upleft.Widget    main.Widget2
+connect downleft.Widget  main.Widget3
+connect downright.Widget main.Widget4
+
+# Here loads 'hola.mhd'
+# ---------------------
 
-# Here loads hola.mhd
 include vtk/boxes/bbLoadHola
 new LoadHola reader
-# uncomment next lines to have a file selector
-#new FileSelector openFileDialog
-#new ImageReader reader
-#    connect openFileDialog.Out reader.In
-   
+
+# Have a look at exampleViewing1.1.bbs
+# If you want to know how to read different images.
+
+// We need that to set Sliders sizes
+
 #Get image dimensions, ...
 new ImageProperties mc
    connect reader.Out mc.In
@@ -38,33 +73,33 @@ new ImageProperties mc
 new GetVectorIntElement gveX
    connect mc.Size gveX.In
    set gveX.I 0
-   
+
 #Get number of rows (Y)
 new GetVectorIntElement gveY
    connect mc.Size gveY.In
    set gveY.I 1
-        
+
 #Get number of planes  (Z)
 new GetVectorIntElement gveZ
    connect mc.Size gveZ.In
    set gveZ.I 2
+//print "Dim Z $gveZ.Out"
 
 #Compute the number of the 'middle' slice on X axis
 new Div div0
   connect   gveX.Out div0.In1
-  set div0.In2 2    
+  set div0.In2 2
 
 #Compute the number of the 'middle' slice on Y axis
 new Div div1
   connect   gveY.Out div1.In1
-  set div1.In2 2  
+  set div1.In2 2
 
 #Compute the number of the 'middle' slice on Z axis
 new Div div2
   connect   gveZ.Out div2.In1
-  set div2.In2 2 
-  
-  
+  set div2.In2 2
+
 // For X axis
 new SimpleSlicer viewerUL
   connect reader.Out viewerUL.In
@@ -76,8 +111,7 @@ new SimpleSlicer viewerUL
   set viewerUL.SliderReactiveOnTrack 1
   set viewerUL.Orientation 0
   set viewerUL.SliderOrientation H
-  set viewerUL.SliderTitle "Planes YZ"  
-
+  set viewerUL.SliderTitle "Planes YZ"
 
 // For Y axis
 new SimpleSlicer viewerUR
@@ -90,12 +124,12 @@ new SimpleSlicer viewerUR
   set viewerUR.SliderReactiveOnTrack 1
   set viewerUR.SliderOrientation H
   set viewerUR.Orientation 1
-  set viewerUR.SliderTitle "Planes XZ" 
-  
+  set viewerUR.SliderTitle "Planes XZ"
+
 // For Z axis
 new SimpleSlicer viewerTD
   connect reader.Out viewerTD.In
-  connect viewerTD.Widget down.Widget1
+  connect viewerTD.Widget downleft.Widget1
   #initial slice is the middle one
   connect div2.Out viewerTD.Slice
   #Slider size is the number of planes
@@ -108,17 +142,27 @@ new SimpleSlicer viewerTD
 //For 3D Viewer
 
 new ImagePlanes planes
-   connect reader.Out planes.In
-   
+  connect reader.Out planes.In
+
 new Viewer3D viewer
-   connect planes.PlaneX viewer.Obs1
-   connect planes.PlaneY viewer.Obs2
-   connect planes.PlaneZ viewer.Obs3
+  connect planes.PlaneX viewer.Obs1
+  connect planes.PlaneY viewer.Obs2
+  connect planes.PlaneZ viewer.Obs3
+
+new CheckBox   chkbox
+  set chkbox.Title "Interpolate Pixels (in '2D' images)"
+  set chkbox.In 1
+  connect chkbox.BoxChange   viewerUL.BoxExecute
+  connect chkbox.BoxChange   viewerUR.BoxExecute
+  connect chkbox.BoxChange   viewerTD.BoxExecute
+
+  connect viewer.Widget downright.Widget1
+  connect chkbox.Widget downright.Widget2
+
+  connect chkbox.Out viewerUL.Interpolate
+  connect chkbox.Out viewerUR.Interpolate
+  connect chkbox.Out viewerTD.Interpolate
 
-   connect viewer.Widget main.Widget4
-       
 set main.WinTitle "demoViewing1"
 exec main
 exec viewerTD
-
-