]> Creatis software - creaImageIO.git/blob - bbtk/src/bbcreaImageIOGimmick.xml_v1
*** empty log message ***
[creaImageIO.git] / bbtk / src / bbcreaImageIOGimmick.xml_v1
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 medical image reader widget. It handles DICOM,jpg,tif,png,bmp and mhd. Images read are stored in sqlite3 databases and thus retrieved very quick next time. Screenshot : <img src=Gimmick1.jpg></img>"</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   <input name="Output" type="int" description="What to output ? 0(default)=image and filenames/1=only filenames"/>
21   <typedef><PRE>typedef std::vector<std::string> OutputFilesType;</PRE></typedef>
22   <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
23
24  <output name="Out" type="vtkImageData*" description="The first selected image"/>
25  <output name="Out2" type="OutputImagesType" description="The selected images"/>
26  <output name="Files" type="OutputFilesType" description="The selected files"/>
27  
28  <!--========================================================================
29     PROCESS section -->
30
31   <process><PRE>
32    int threads = 1;
33
34    creaImageIO::WxGimmickDialog w(0,
35                                   -1,
36                                   crea::std2wx(bbGetInputTitle()),
37                                   wxDefaultPosition,
38                                   wxSize(1200,800),
39                                   bbGetInputImageDimension(),
40                                   threads);
41    w.ShowModal();
42    
43    if (w.GetReturnCode() == wxID_OK)
44      {
45      if (bbGetInputOutput()==0) 
46          {
47            std::vector<vtkImageData*> images;
48            w.GetSelectedImages(images);
49            bbSetOutputOut(images[0]);
50            bbSetOutputOut2(images);
51          }
52        std::vector<std::string> files;
53        w.GetSelectedFiles(files);
54        bbSetOutputFiles(files);
55      }
56    else if (w.GetReturnCode() == wxID_CANCEL)
57      {
58 //    if (bbGetOutputOut()!=0) 
59 //     { 
60  //       bbGetOutputOut()->Delete();    
61 //          bbSetOutputOut(0);
62 // }
63      }
64   </PRE></process>
65
66  <!--======================================================================
67    CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
68
69   <constructor><PRE> 
70     bbSetInputImageDimension(3);
71     bbSetInputTitle("Select image(s)");
72     bbSetInputOutput(0);
73     bbSetOutputOut(0);
74   </PRE>
75   </constructor>
76
77
78   <!-- THE COPY-CONSTRUCTION METHOD BODY : -->
79   <copyconstructor>
80   <PRE>
81     bbSetOutputOut(0);
82   </PRE>
83   </copyconstructor>
84
85   <!-- THE DESTRUCTION METHOD BODY  -->
86   <destructor>
87   <PRE>
88     std::vector<vtkImageData*>::iterator i;
89     for (i=bbGetOutputOut2().begin();i!=bbGetOutputOut2().end();++i) (*i)->Delete();
90   </PRE>
91   </destructor>
92
93
94
95 </blackbox>
96