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 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 # 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 # uncomment next lines to use Gimmick # ----------------------------------- #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 # uncomment the following lines to read a 3D images stack # (only if file name order is meaningfull) # ------------------------------------------------------- /* // 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 // user choosen directory as input connect ds.Out fd.In set fd.Recursive false // list of files as imput connect fd.Out reader.FileNames */ #Get image dimensions, ... new ImageProperties mc connect reader.Out mc.In #Get number of column (X) 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 #Compute the number of the 'middle' slice on X axis new Div div0 connect gveX.Out div0.In1 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 #Compute the number of the 'middle' slice on Z axis new Div div2 connect gveZ.Out div2.In1 set div2.In2 2 // For X axis new SimpleSlicer viewerUL connect reader.Out viewerUL.In connect viewerUL.Widget upleft.Widget1 #initial slice is the middle one connect div0.Out viewerUL.Slice #Slider size is the number of planes connect gveX.Out viewerUL.SliderSize set viewerUL.SliderReactiveOnTrack 1 set viewerUL.Orientation 0 set viewerUL.SliderOrientation H set viewerUL.SliderTitle "Planes YZ" // For Y axis new SimpleSlicer viewerUR connect reader.Out viewerUR.In connect viewerUR.Widget upright.Widget1 #initial slice is the middle one connect div1.Out viewerUR.Slice #Slider size is the number of planes connect gveY.Out viewerUR.SliderSize set viewerUR.SliderReactiveOnTrack 1 set viewerUR.SliderOrientation H set viewerUR.Orientation 1 set viewerUR.SliderTitle "Planes XZ" // For Z axis new SimpleSlicer viewerTD connect reader.Out viewerTD.In connect viewerTD.Widget downleft.Widget1 #initial slice is the middle one connect div2.Out viewerTD.Slice #Slider size is the number of planes connect gveZ.Out viewerTD.SliderSize set viewerTD.SliderReactiveOnTrack 1 set viewerTD.SliderOrientation H set viewerTD.Orientation 2 set viewerTD.SliderTitle "Planes XY" //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 set main.WinTitle "demoViewing1" exec main exec viewerTD