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>
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 -->
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"/>
26 typedef std::vector<std::string> VectorStringType;</PRE>
28 <input name="DicomTags" type="VectorStringType" description="Dicom Tags (vector of Dicom tags ex: D0028_0030 D0020_0037)"/>
33 typedef std::map<std::string, std::string> MapInfoDicom;</PRE>
38 typedef std::vector< MapInfoDicom > VectorMapInfoDicom;</PRE>
40 <output name="DicomInfo" type="VectorMapInfoDicom" description="vector of maps of Dicom tags"/>
43 <typedef><PRE>typedef std::vector<std::string> OutputFilesType; </PRE></typedef>
44 <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
46 <output name="Out" type="vtkImageData*" description="The first selected image"/>
47 <output name="Out2" type="OutputImagesType" description="The selected images"/>
48 <output name="Files" type="OutputFilesType" description="The selected files"/>
50 <!--========================================================================
56 creaImageIO::WxGimmickReaderDialog w(0,
58 "localdatabase_Descriptor.dscp",
60 crea::std2wx(bbGetInputTitle()),
63 bbGetInputImageMinDimension(),
64 bbGetInputImageMaxDimension(),
65 bbGetInputImageOutputDimension(),
69 if (w.GetReturnCode() == wxID_OK)
71 if (bbGetInputOutput()==0)
73 std::vector<vtkImageData*> images;
74 w.GetSelectedImages(images,bbGetInputImageOutputDimension());
75 bbSetOutputOut(images[0]);
76 bbSetOutputOut2(images);
78 std::vector<std::string> files;
79 w.GetSelectedFiles(files);
80 bbSetOutputFiles(files);
82 else if (w.GetReturnCode() == wxID_CANCEL)
84 // if (bbGetOutputOut()!=0)
86 // bbGetOutputOut()->Delete();
94 /// vtkImageData vector
95 std::vector<vtkImageData*> m_results;
96 std::vector< std::map<std::string,std::string> > m_resultsDicomAtr;
99 if (w.GetReturnCode() == wxID_OK)
102 std::vector<creaImageIO::OutStrGimmick> outStrGimmick;
103 w.getSelected(outStrGimmick, bbGetInputDicomTags() ,true,"");
105 int size=(int)outStrGimmick.size();
109 for (ii=0;ii<size;ii++)
111 outStrGimmick[ii].img->Modified();
112 m_results.push_back(outStrGimmick[ii].img);
113 m_resultsDicomAtr.push_back( outStrGimmick[ii].infos );
116 // for (ii=0;ii<size;ii++)
118 // m_resultsInfo.push_back(outStrGimmick[ii]);
122 // infoimage = _T("EED Missing info <void> ???");
123 // infoimageSource = _T("GIMMICK");
125 if (bbGetInputOutput()==0)
127 // std::vector<vtkImageData*> images;
128 // w.GetSelectedImages(images,bbGetInputImageOutputDimension());
129 bbSetOutputOut(m_results[0]);
130 bbSetOutputOut2(m_results);
132 std::vector<std::string> files;
133 w.GetSelectedFiles(files);
134 bbSetOutputFiles(files);
135 bbSetOutputDicomInfo( m_resultsDicomAtr );
146 <!--========================================================================
147 CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
149 bbSetInputImageMinDimension(2);
150 bbSetInputImageMaxDimension(3);
151 bbSetInputImageOutputDimension(3);
152 bbSetInputTitle("Select image(s)");
156 </PRE></defaultValues>
158 <initializeProcessing><PRE>
159 </PRE></initializeProcessing>
161 <finalizeProcessing><PRE>
162 std::vector<vtkImageData*>::iterator i;
163 for (i=bbGetOutputOut2().begin();i!=bbGetOutputOut2().end();++i) (*i)->Delete();
164 </PRE></finalizeProcessing>
165 <!--=====================================================================-->