]> Creatis software - creaImageIO.git/blobdiff - bbtk/src/bbcreaImageIOGimmick.xml_v1
*** empty log message ***
[creaImageIO.git] / bbtk / src / bbcreaImageIOGimmick.xml_v1
similarity index 69%
rename from bbtk/src/bbcreaImageIOGimmick.xml
rename to bbtk/src/bbcreaImageIOGimmick.xml_v1
index f4043572a4e0d842ce804af3044e009278110076..7d8f8837f18f06dfe1fda1df7e7494cb2c81ba4a 100644 (file)
 
   <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"/>
+  <input name="Output" type="int" description="What to output ? 0(default)=image and filenames/1=only filenames"/>
+  <typedef><PRE>typedef std::vector<std::string> OutputFilesType;</PRE></typedef>
+  <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
+
+ <output name="Out" type="vtkImageData*" description="The first selected image"/>
+ <output name="Out2" type="OutputImagesType" description="The selected images"/>
+ <output name="Files" type="OutputFilesType" description="The selected files"/>
  
  <!--========================================================================
     PROCESS section -->
    
    if (w.GetReturnCode() == wxID_OK)
      {
-       std::vector<vtkImageData*> images;
-       w.GetSelectedImages(images);
-       bbSetOutputOut(images[0]);
+     if (bbGetInputOutput()==0) 
+         {
+           std::vector<vtkImageData*> images;
+           w.GetSelectedImages(images);
+           bbSetOutputOut(images[0]);
+           bbSetOutputOut2(images);
+         }
+       std::vector<std::string> files;
+       w.GetSelectedFiles(files);
+       bbSetOutputFiles(files);
      }
    else if (w.GetReturnCode() == wxID_CANCEL)
      {
   <constructor><PRE> 
     bbSetInputImageDimension(3);
     bbSetInputTitle("Select image(s)");
+    bbSetInputOutput(0);
     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) -->
+  <!-- THE COPY-CONSTRUCTION METHOD BODY : -->
   <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 -->
+  <!-- THE DESTRUCTION METHOD BODY  -->
   <destructor>
   <PRE>
-    if (bbGetOutputOut()!=0) bbGetOutputOut()->Delete();
+    std::vector<vtkImageData*>::iterator i;
+    for (i=bbGetOutputOut2().begin();i!=bbGetOutputOut2().end();++i) (*i)->Delete();
   </PRE>
   </destructor>