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"/>
24 <typedef><PRE>typedef std::vector<std::string> OutputFilesType; </PRE></typedef>
25 <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
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"/>
31 <!--========================================================================
37 creaImageIO::WxGimmickReaderDialog w(0,
39 "localdatabase_Descriptor.dscp",
41 crea::std2wx(bbGetInputTitle()),
44 bbGetInputImageMinDimension(),
45 bbGetInputImageMaxDimension(),
46 bbGetInputImageOutputDimension(),
50 if (w.GetReturnCode() == wxID_OK)
52 if (bbGetInputOutput()==0)
54 std::vector<vtkImageData*> images;
55 w.GetSelectedImages(images,bbGetInputImageOutputDimension());
56 bbSetOutputOut(images[0]);
57 bbSetOutputOut2(images);
59 std::vector<std::string> files;
60 w.GetSelectedFiles(files);
61 bbSetOutputFiles(files);
63 else if (w.GetReturnCode() == wxID_CANCEL)
65 // if (bbGetOutputOut()!=0)
67 // bbGetOutputOut()->Delete();
75 <!--========================================================================
76 CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
78 bbSetInputImageMinDimension(2);
79 bbSetInputImageMaxDimension(3);
80 bbSetInputImageOutputDimension(3);
81 bbSetInputTitle("Select image(s)");
85 </PRE></defaultValues>
87 <initializeProcessing><PRE>
88 </PRE></initializeProcessing>
90 <finalizeProcessing><PRE>
91 std::vector<vtkImageData*>::iterator i;
92 for (i=bbGetOutputOut2().begin();i!=bbGetOutputOut2().end();++i) (*i)->Delete();
93 </PRE></finalizeProcessing>
94 <!--=====================================================================-->