]> Creatis software - bbtk.git/blob - packages/demo/bbs/appli/examplePlane3Pts.bbs
Feature #1774
[bbtk.git] / packages / demo / bbs / appli / examplePlane3Pts.bbs
1  # ---------------------------------------------------------------------
2  #
3  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4  #                        pour la SantÈ)
5  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8  #
9  #  This software is governed by the CeCILL-B license under French law and
10  #  abiding by the rules of distribution of free software. You can  use,
11  #  modify and/ or redistribute the software under the terms of the CeCILL-B
12  #  license as circulated by CEA, CNRS and INRIA at the following URL
13  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14  #  or in the file LICENSE.txt.
15  #
16  #  As a counterpart to the access to the source code and  rights to copy,
17  #  modify and redistribute granted by the license, users are provided only
18  #  with a limited warranty  and the software's author,  the holder of the
19  #  economic rights,  and the successive licensors  have only  limited
20  #  liability.
21  #
22  #  The fact that you are presently reading this means that you have had
23  #  knowledge of the CeCILL-B license and that you accept its terms.
24  # ------------------------------------------------------------------------ */
25  
26 description " How to choose points in a 3D image "
27 author "davila at creatis.insa-lyon.fr"
28 category "example"
29
30 load vtk
31 load wxvtk
32 load creaMaracasVisu
33 load std
34 load wx
35 load creaImageIO
36
37 # Use new box (choose the way you want to select images)
38 # -----------------------------------------------------
39 new ImagesChooserDialogBox chooser
40
41 # Concatenate all the supposed-to-be consistent 2D images into a single vtkImageData
42 # WARNING : File names alphabetical order is suposed to be meaningful ...
43
44 new ConcatImages reader
45    connect chooser.Out reader.In
46   
47 new ImagePlanes planes
48 connect reader.Out planes.In
49
50 #new Viewer3D viewer
51
52 #connect planes.PlaneX viewer.Obs1
53 #connect planes.PlaneY viewer.Obs2
54 #connect planes.PlaneZ viewer.Obs3
55 #connect planes.Plane3Pts viewer.Obs4
56 #set viewer.WinTitle "Show N Points"
57 #set viewer.WinWidth 350
58 #set viewer.WinHeight 400
59
60 new ViewerNV viewernv
61         #set viewernv.nTypeView "6 1 2 0"
62         set viewernv.nTypeView "6"
63         connect reader.Out viewernv.In
64
65 new ShowNPoints showpoints
66         connect reader.Out showpoints.Image
67         connect showpoints.lstPointsX planes.PointsX
68         connect showpoints.lstPointsY planes.PointsY
69         connect showpoints.lstPointsZ planes.PointsZ
70         #set planes.PointsX "10 10 50"
71         #set planes.PointsY "10 50 20"
72         #set planes.PointsZ "10 10 30"
73         connect viewernv.BoxChange showpoints.BoxExecute
74         connect viewernv.Point showpoints.In
75         connect viewernv.Renderer1 showpoints.Renderer
76         set showpoints.Radio 1
77
78 new ImageActor imgactor
79         connect planes.Image3Pts imgactor.In
80         connect viewernv.Renderer1 imgactor.Renderer
81         connect planes.Transform3Pts imgactor.Transform
82
83 new Viewer2D view2d
84 new CommandButton execplanes
85         set execplanes.Label "Refresh planes"
86         connect execplanes.BoxChange planes.BoxExecute  
87         connect execplanes.BoxChange view2d.BoxExecute  
88         connect execplanes.BoxChange imgactor.BoxExecute
89         #connect execplanes.BoxChange viewer.BoxExecute 
90
91 new LayoutLine layoutline0
92 connect showpoints.Widget layoutline0.Widget1
93 connect execplanes.Widget layoutline0.Widget2
94
95 new LayoutLine layoutline1
96 connect viewernv.Widget layoutline1.Widget1
97
98 new LayoutSplit mainSplit
99 set mainSplit.Orientation H
100 set mainSplit.Proportion 30
101 connect layoutline0.Widget mainSplit.Widget1
102 connect layoutline1.Widget mainSplit.Widget2
103
104 exec mainSplit
105
106 connect planes.Image3Pts view2d.In