]> Creatis software - bbtk.git/commitdiff
To extract/ display the vtkImadeData from a vtkImagePlaneWidget
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 3 Dec 2008 16:14:16 +0000 (16:14 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 3 Dec 2008 16:14:16 +0000 (16:14 +0000)
packages/demo/bbs/appli/demoViewing3Try.bbs [new file with mode: 0644]

diff --git a/packages/demo/bbs/appli/demoViewing3Try.bbs b/packages/demo/bbs/appli/demoViewing3Try.bbs
new file mode 100644 (file)
index 0000000..1939324
--- /dev/null
@@ -0,0 +1,118 @@
+
+  
+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 vtk
+include wxvtk
+load std
+load itk
+include vtk
+include wx
+load itkvtk
+
+//include wxvtk/boxes/bbSimpleSlicer
+//include wx/boxes/LayoutX4
+
+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
+
+// Uncomment the following lines to be able to read a 3D images stack
+/* -----------------
+// To choose the directory
+new DirectorySelector ds
+// To get the image names into a vector
+new FilesFromDirectory fd
+// To read all the files, as a bbitk::ImagePointer
+new ImageSeriesReader reader
+
+connect ds.Out fd.In
+set fd.Recursive false
+print "Files found in $ds.Out$\n"
+print "-Not recursive----------------------------"
+//print " : $fd.Out$\n"
+
+set reader.XSpacing 23.4
+set reader.YSpacing 23.4
+set reader.ZSpacing 35
+
+connect fd.Out  reader.FileNames
+*/
+
+
+
+// Comment out to following line if you want to be able to read  a 3D images stack
+new LoadHola reader
+
+
+print "Image properties : $reader.Out"
+
+    
+
+//For 3D Viewer
+
+new ImagePlanes planes
+   connect reader.Out planes.In
+   
+new Viewer3D viewer
+   connect planes.PlaneX viewer.Obs1
+   connect planes.PlaneY viewer.Obs2
+   connect planes.PlaneZ viewer.Obs3
+
+   connect viewer.Widget main.Widget4
+     
+  
+// For X axis
+// ----------
+new Viewer2D viewerUL
+  set viewerUL.BoxProcessMode Always
+  connect planes.ImageX viewerUL.In
+   # contains only one slice
+  set viewerUL.Slice 0
+  connect viewerUL.Widget upleft.Widget1
+
+//  print "planes.BoxChange $planes.BoxChange"
+//  print "viewer.BoxChange $viewer.BoxChange"
+  
+ connect planes.BoxChange viewerUL.BoxExecute
+
+print "===============planes.ImageX $planes.ImageX"
+
+// For Y axis
+// ----------
+new Viewer2D viewerUR
+  set viewerUR.BoxProcessMode Always
+  connect planes.ImageY viewerUR.In
+  connect viewerUR.Widget upright.Widget1
+ # contains only one  slice
+  set viewerUR.Slice 0
+ connect planes.BoxChange viewerUR.BoxExecute 
+
+ print "===============planes.ImageY $planes.ImageY"  
+   
+// For Z axis
+// ----------
+new Viewer2D viewerDL
+  set viewerDL.BoxProcessMode Always
+  connect planes.ImageZ viewerDL.In
+  connect viewerDL.Widget downleft.Widget1
+ # contains only one  slice
+  set viewerDL.Slice 0
+  connect planes.BoxChange viewerDL.BoxExecute 
+
+ print "===============planes.ImageZ $planes.ImageZ" 
+          
+set main.WinTitle "demoViewing3"
+
+exec main
+