2 description "Reads and image file / stack of image files, writes it as a MHD file"
3 author "jpr@creatis.insa-lyon.fr"
4 category "tool, read/write"
16 # Use new box (choose the way you want to select images)
17 # -----------------------------------------------------
19 //new ImagesChooserDialogBox chooser
20 new ImagesChooserDialogBox reader
22 # Concatenate all the supposed-to-be consistent 2D images into a single vtkImageData
23 # WARNING : File names alphabetical order is suposed to be meaningful ...
25 //new ConcatImages reader
26 // connect chooser.OutImages reader.In
30 set cb1.Label "1) Select File"
31 set cb1.WinDialog true
32 connect cb1.Widget main.Widget1
34 connect cb1.BoxChange reader.BoxExecute
38 set slc.SliderReactiveOnTrack 1
39 connect reader.Out slc.In
40 // It doesn't work ?!?, needs to "exec slc" // JPR
41 connect reader.BoxChange slc.BoxExecute
46 connect cb.Widget main.Widget2
47 set cb.Label "2) Write (no '.mhd' extention needed!"
50 new CommandButton next
51 connect next.Widget main.Widget3
52 set next.Label "Next !"
53 set next.WinDialog true
54 // It doesn't work : <<the black box "main" is still connected">>
55 set next.In "delete main"
57 # Choose where you want to write
58 # ------------------------------
59 new FileSelector fileDialog
60 set fileDialog.OpenSave Save
61 set fileDialog.Wildcard "*.mhd"
64 connect fileDialog.Out mfn.File
70 new MetaImageWriter writer
71 connect reader.Out writer.In
72 connect mfn.Out writer.Filename
73 connect cb.BoxChange writer.BoxExecute