]> Creatis software - creaImageIO.git/blob - bbtk/src/bbcreaImageIOGimmick.xml
8113d5c66fd6998b7ed4e15b9c74fc774ea1de8b
[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 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>creaImageIOWxGimmickReaderDialog.h</include>
15  <!--========================================================================
16     INPUTS/OUTPUTS DECLARATION -->
17
18   <input name="Title"                type="std::string" description="Title of the dialog"/>
19   <input name="ImageMinDimension"    type="int"         description="The minimal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
20   <input name="ImageMaxDimension"    type="int"         description="The maximal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
21   <input name="ImageOutputDimension" type="int"         description="The dimensionality of the output image, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
22   <input name="Output"               type="int"         description="What to output ? 0(default)=image and filenames/1=only filenames"/>
23
24   <typedef><PRE>typedef std::vector<std::string>   OutputFilesType; </PRE></typedef>
25   <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
26
27  <output name="Out"   type="vtkImageData*"    description="The first selected image"/>
28  <output name="Out2"  type="OutputImagesType" description="The selected images"/>
29  <output name="Files" type="OutputFilesType"  description="The selected files"/>
30  
31  <!--========================================================================
32     PROCESS section -->
33
34   <process><PRE>
35    int threads = 1;
36
37    creaImageIO::WxGimmickReaderDialog w(0,
38                                   -1,
39                                 "localdatabase_Descriptor.dscp", 
40                                 "Local Database",
41                                   crea::std2wx(bbGetInputTitle()),
42                                   wxDefaultPosition,
43                                   wxSize(1200,800),
44                                   bbGetInputImageMinDimension(),
45                                   bbGetInputImageMaxDimension(),
46                                   bbGetInputImageOutputDimension(),
47                                   threads);
48    w.ShowModal();
49      
50    if (w.GetReturnCode() == wxID_OK)
51      {
52        if (bbGetInputOutput()==0) 
53          {
54            std::vector<vtkImageData*> images;
55            w.GetSelectedImages(images,bbGetInputImageOutputDimension());
56            bbSetOutputOut(images[0]);
57            bbSetOutputOut2(images);
58          }
59        std::vector<std::string> files;
60        w.GetSelectedFiles(files);
61        bbSetOutputFiles(files);
62      }   
63    else if (w.GetReturnCode() == wxID_CANCEL)
64      {
65 //    if (bbGetOutputOut()!=0) 
66 //     { 
67 //       bbGetOutputOut()->Delete();
68 //          bbSetOutputOut(0);
69 //     }
70      }
71   </PRE></process>
72
73
74
75     <!--========================================================================
76     CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
77   <defaultValues><PRE> 
78     bbSetInputImageMinDimension(2);
79     bbSetInputImageMaxDimension(3);
80     bbSetInputImageOutputDimension(3);
81     bbSetInputTitle("Select image(s)");
82     bbSetInputOutput(0);
83         bbSetOutputOut(0);
84
85   </PRE></defaultValues>    
86   
87   <initializeProcessing><PRE>
88   </PRE></initializeProcessing>    
89   
90   <finalizeProcessing><PRE>
91     std::vector<vtkImageData*>::iterator i;
92     for (i=bbGetOutputOut2().begin();i!=bbGetOutputOut2().end();++i) (*i)->Delete();
93   </PRE></finalizeProcessing>    
94   <!--=====================================================================-->
95
96
97
98 </blackbox>
99