]> Creatis software - creaImageIO.git/blobdiff - bbtk/src/bbcreaImageIOGimmick.xml
bbtk package creation
[creaImageIO.git] / bbtk / src / bbcreaImageIOGimmick.xml
diff --git a/bbtk/src/bbcreaImageIOGimmick.xml b/bbtk/src/bbcreaImageIOGimmick.xml
new file mode 100644 (file)
index 0000000..574bad1
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--==========================================================================
+   STARTS THE DESCRIPTION OF THE BLACK BOX -->
+<blackbox name="Gimmick">
+ <!--========================================================================
+    THE BOX DOCUMENTATION -->
+  <author>laurent.guigues@creatis.insa-lyon.fr</author>
+  <description>Gimmick! (Gimme my medical images quick!) is a ...</description>
+  <category>image;reader;dicom</category>
+
+<!--========================================================================
+    #include directives to be put in the .h generated
+    There must be one tag per file to include -->
+<include>creaImageIOWxGimmickDialog.h</include>
+ <!--========================================================================
+    INPUTS/OUTPUTS DECLARATION -->
+
+  <input name="Title" type="std::string" description="Title of the dialog"/>
+  <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,..."/>
+ <output name="Out", type="vtkImageData*" description="The selected image"/>
+ <!--========================================================================
+    PROCESS section -->
+
+  <process><PRE>
+   int threads = 1;
+
+   creaImageIO::WxGimmickDialog w(0,
+                                  -1,
+                                  crea::std2wx(bbGetInputTitle()),
+                                  wxDefaultPosition,
+                                  wxSize(1200,800),
+                                  bbGetInputImageDimension(),
+                                  threads);
+   w.ShowModal();
+   
+   if (w.GetReturnCode() == wxID_OK)
+     {
+       std::vector<vtkImageData*> images;
+       w.GetSelectedImages(images);
+       bbSetOutputOut(images[0]);
+     }
+   else if (w.GetReturnCode() == wxID_CANCEL)
+     {
+//    if (bbGetOutputOut()!=0) 
+//     { 
+ //       bbGetOutputOut()->Delete();    
+//          bbSetOutputOut(0);
+// }
+     }
+  </PRE></process>
+
+ <!--======================================================================
+   CONSTRUCTORS / DESTRUCTORS (OPTIONAL) -->
+
+  <constructor><PRE> 
+    bbSetInputImageDimension(3);
+    bbSetInputTitle("Select image(s)");
+    bbSetOutputOut(0);
+  </PRE>
+  </constructor>
+
+
+  <!-- THE COPY-CONSTRUCTION METHOD BODY :
+    Here does nothing 
+    But this is where you should allocate the output pointers if any
+    and copy the pointed values (to avoid bug caused by multiple references) -->
+  <copyconstructor>
+  <PRE>
+    bbSetOutputOut(0);
+  </PRE>
+  </copyconstructor>
+
+  <!-- THE DESTRUCTION METHOD BODY :
+    Here does nothing 
+    but this is where you should desallocate the output pointers if any -->
+  <destructor>
+  <PRE>
+    if (bbGetOutputOut()!=0) bbGetOutputOut()->Delete();
+  </PRE>
+  </destructor>
+
+
+
+</blackbox>
+