X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fdemo%2Fbbs%2Fappli%2FSaveAsMhd.bbs;h=06e3c22645ce07010f757ab898a702294d4af2dc;hb=c610230c431c264976c8b37f4f96adf4c33b7bd1;hp=332ada5b48b6aee29e832097cd93c8c42ae7e672;hpb=d06bbad0f02d16ad30f006b451fbec67f780111f;p=bbtk.git diff --git a/packages/demo/bbs/appli/SaveAsMhd.bbs b/packages/demo/bbs/appli/SaveAsMhd.bbs index 332ada5..06e3c22 100644 --- a/packages/demo/bbs/appli/SaveAsMhd.bbs +++ b/packages/demo/bbs/appli/SaveAsMhd.bbs @@ -1,6 +1,32 @@ -//description "Example of the box Viewer2D." -author "jpr@creatis.univ-lyon1.fr" -category "tool, writer" + # --------------------------------------------------------------------- + # + # 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 "Reads and image file / stack of image files, writes it as a MHD file" +author "jpr@creatis.insa-lyon.fr" +category "tool, read/write" load vtk include wxvtk @@ -9,17 +35,67 @@ load itk include vtk include wx load itkvtk -load creaImageIO +new LayoutLine main + +# Use new box (choose the way you want to select images) +# ----------------------------------------------------- +load creaImageIO +//new ImagesChooserDialogBox chooser +new ImagesChooserDialogBox reader + +# Concatenate all the supposed-to-be consistent 2D images into a single vtkImageData +# WARNING : File names alphabetical order is suposed to be meaningful ... + +//new ConcatImages reader +// connect chooser.OutImages reader.In + + +new CommandButton cb1 + set cb1.Label "1) Select File" + set cb1.WinDialog true + connect cb1.Widget main.Widget1 + +connect cb1.BoxChange reader.BoxExecute + +new SimpleSlicer slc + set slc.Orientation 2 + set slc.SliderReactiveOnTrack 1 + connect reader.Out slc.In + // It doesn't work ?!?, needs to "exec slc" // JPR + connect reader.BoxChange slc.BoxExecute + +exec slc -new Gimmick reader +new CommandButton cb + connect cb.Widget main.Widget2 + set cb.Label "2) Write (no '.mhd' extention needed!" + set cb.WinDialog true + +new CommandButton next + connect next.Widget main.Widget3 + set next.Label "Next !" + set next.WinDialog true + // It doesn't work : <> + set next.In "delete main" -new FileSelector fs - set fs.OpenSave "Save" +# Choose where you want to write +# ------------------------------ +new FileSelector fileDialog + set fileDialog.OpenSave Save + set fileDialog.Wildcard "*.mhd" +new MakeFileName mfn + connect fileDialog.Out mfn.File + set mfn.Extent ".mhd" + +# Write! +# ------ + new MetaImageWriter writer - connect reader.Out writer.In - connect fs.Out writer.Filename + connect reader.Out writer.In + connect mfn.Out writer.Filename + connect cb.BoxChange writer.BoxExecute + +exec main -exec reader -exec writer