]> Creatis software - bbtk.git/blobdiff - packages/demo/bbs/appli/demoViewing1.bbs
NTU: Added write function... Hope it works
[bbtk.git] / packages / demo / bbs / appli / demoViewing1.bbs
index f74b23451bf07f4312de33b860beb1fbaeed157a..8e066e4668a84b388c7f5cb3f6eab3b3000a8918 100644 (file)
@@ -12,17 +12,22 @@ 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 downleft
 
-connect upright.Widget  main.Widget1
-connect upleft.Widget   main.Widget2
-connect downleft.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
 # -------------------
@@ -31,40 +36,88 @@ new LoadHola reader
 
 # uncomment next lines to have a file selector
 # --------------------------------------------
-#new FileSelector openFileDialog
-#new ImageReader reader
-#    connect openFileDialog.Out reader.In
+/*
+new FileSelector openFileDialog
+new ImageReader reader
+  connect openFileDialog.Out reader.In
+*/
+
+# uncomment next lines to use a vtkgdcmReader
+# -------------------------------------
+/*
+new FileSelector openFileDialog
+new GetInfoGdcmReader reader
+  connect openFileDialog.Out reader.In
+*/
 
 # uncomment next lines to use Gimmick
 # -----------------------------------
-#load creaImageIO
-#new Gimmick reader
+/*
+load creaImageIO
+new Gimmick reader
+*/
 
 # uncomment next lines to Read a MHD file (and nothing else !)
 # ------------------------------------------------------------
-#new FileSelector openFileDialog
-#new MetaImageReader reader
-#   connect openFileDialog.Out reader.In 
+/*
+new FileSelector openFileDialog
+ set openFileDialog.Wildcard  "(*.mhd)|*.mhd"
+new MetaImageReader reader
+   connect openFileDialog.Out reader.In
+*/
 
 # uncomment the following lines to read a 3D images stack
+# (only if file name order is meaningfull)
 # -------------------------------------------------------
+/*
 // To choose the directory
-#new DirectorySelector ds
+new DirectorySelector ds
 // To get the image names into a vector
-#new FilesFromDirectory fd
+new FilesFromDirectory fd
 // To read all the files, as a bbitk::ImagePointer
-#new ImageSeriesReader reader
+new ImageSeriesReader reader
+// user choosen directory as input
+connect ds.Out fd.In
+set fd.Recursive false
+// list of files as input
+#print "Files found in $ds.Out$\n
+connect fd.Out reader.FileNames
+*/
+
+# uncomment the following lines to read a 3D images stack
+# (if the directory contains a 'XCoherent" Serie)
+# -------------------------------------------------------
+/*
+// To choose the directory
+new DirectorySelector ds
+// To get the image names into a vector
+new FilesFromDirectory fd
 // user choosen directory as input
-#connect ds.Out fd.In
-#set fd.Recursive false
-// list of files as imput
-#connect fd.Out  reader.FileNames
+connect ds.Out fd.In 
+// order the files, computes an accurate ZSpacing
+new GetXCoherentInfoGdcmReader reader
+connect fd.Out reader.In
+*/
 
+# uncomment the following lines to read a 3D images stack
+# (with DICOMDirReader)
+# -------------------------------------------------------
+/*
+include itk/boxes/bbDICOMDirReader
+// To choose the directory
+new DirectorySelector ds
+new DICOMDirReader reader
+   connect ds.Out reader.In
+*/
+
+// We need that to set Sliders sizes
 
 #Get image dimensions, ...
 new ImageProperties mc
    connect reader.Out mc.In
 
+#print "Image properties : $reader.Out"
+
 #Get number of column (X)
 new GetVectorIntElement gveX
    connect mc.Size gveX.In
@@ -79,6 +132,7 @@ new GetVectorIntElement gveY
 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
@@ -95,7 +149,6 @@ new Div div2
   connect   gveZ.Out div2.In1
   set div2.In2 2
 
-
 // For X axis
 new SimpleSlicer viewerUL
   connect reader.Out viewerUL.In
@@ -109,7 +162,6 @@ new SimpleSlicer viewerUL
   set viewerUL.SliderOrientation H
   set viewerUL.SliderTitle "Planes YZ"
 
-
 // For Y axis
 new SimpleSlicer viewerUR
   connect reader.Out viewerUR.In
@@ -139,17 +191,28 @@ 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
 
-