]> Creatis software - creaImageIO.git/blob - bbtk/src/bbcreaImageIOGimmick.xml
bbtk package creation
[creaImageIO.git] / bbtk / src / bbcreaImageIOGimmick.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!--==========================================================================
3    STARTS THE DESCRIPTION OF THE BLACK BOX -->
4 <blackbox name="Gimmick">
5  <!--========================================================================
6     THE BOX DOCUMENTATION -->
7   <author>laurent.guigues@creatis.insa-lyon.fr</author>
8   <description>Gimmick! (Gimme my medical images quick!) is a ...</description>
9   <category>image;reader;dicom</category>
10
11 <!--========================================================================
12     #include directives to be put in the .h generated
13     There must be one tag per file to include -->
14 <include>creaImageIOWxGimmickDialog.h</include>
15  <!--========================================================================
16     INPUTS/OUTPUTS DECLARATION -->
17
18   <input name="Title" type="std::string" description="Title of the dialog"/>
19   <input name="ImageDimension" type="int" description="The maximal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
20  <output name="Out", type="vtkImageData*" description="The selected image"/>
21  
22  <!--========================================================================
23     PROCESS section -->
24
25   <process><PRE>
26    int threads = 1;
27
28    creaImageIO::WxGimmickDialog w(0,
29                                   -1,
30                                   crea::std2wx(bbGetInputTitle()),
31                                   wxDefaultPosition,
32                                   wxSize(1200,800),
33                                   bbGetInputImageDimension(),
34                                   threads);
35    w.ShowModal();
36    
37    if (w.GetReturnCode() == wxID_OK)
38      {
39        std::vector<vtkImageData*> images;
40        w.GetSelectedImages(images);
41        bbSetOutputOut(images[0]);
42      }
43    else if (w.GetReturnCode() == wxID_CANCEL)
44      {
45 //    if (bbGetOutputOut()!=0) 
46 //     { 
47  //       bbGetOutputOut()->Delete();    
48 //          bbSetOutputOut(0);
49 // }
50      }
51   </PRE></process>
52
53  <!--======================================================================
54    CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
55
56   <constructor><PRE> 
57     bbSetInputImageDimension(3);
58     bbSetInputTitle("Select image(s)");
59     bbSetOutputOut(0);
60   </PRE>
61   </constructor>
62
63
64   <!-- THE COPY-CONSTRUCTION METHOD BODY :
65     Here does nothing 
66     But this is where you should allocate the output pointers if any
67     and copy the pointed values (to avoid bug caused by multiple references) -->
68   <copyconstructor>
69   <PRE>
70     bbSetOutputOut(0);
71   </PRE>
72   </copyconstructor>
73
74   <!-- THE DESTRUCTION METHOD BODY :
75     Here does nothing 
76     but this is where you should desallocate the output pointers if any -->
77   <destructor>
78   <PRE>
79     if (bbGetOutputOut()!=0) bbGetOutputOut()->Delete();
80   </PRE>
81   </destructor>
82
83
84
85 </blackbox>
86