]> Creatis software - creaImageIO.git/blobdiff - bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx
Add Analyze Reader to creaImageIO
[creaImageIO.git] / bbtk / src / bbcreaImageIOItkImagesChooserDialogBox.cxx
diff --git a/bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx b/bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx
new file mode 100644 (file)
index 0000000..c1c6e4c
--- /dev/null
@@ -0,0 +1,79 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+
+#include "bbcreaImageIOItkImagesChooserDialogBox.h"
+#include "bbcreaImageIOPackage.h"
+
+namespace bbcreaImageIO
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaImageIO,ItkImagesChooserDialogBox)
+BBTK_BLACK_BOX_IMPLEMENTATION(ItkImagesChooserDialogBox,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ItkImagesChooserDialogBox::Process()
+{
+       dlg = new creaImageIO::WxAnySimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
+    dlg->ShowModal(); 
+       
+       // FCY to test
+       bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
+       BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
+       bbSetOutputOutVImages(dlg->getVtkImagesSelected());
+       delete dlg;
+}
+template <class TImage>
+void ItkImagesChooserDialogBox::Export()
+{
+        if (dlg->getImagesSelected().size() == 1)
+        { 
+               bbSetOutputOut( dlg->getTemplatedImagesSelected<TImage>().front() ); 
+        } 
+         else if (dlg->getImagesSelected().size() > 1)
+         { 
+//             bbSetOutputOutImages( bbSetOutputOutIImages( dlg->getTemplatedImagesSelected<TImage>() )); 
+      } 
+         else
+         {
+               bbSetOutputOut( NULL); 
+         }
+        // FCY To test the Output
+         //typedef itk::Image <short, 3> ImageType;
+        //typedef itk::ImageFileReader< ImageType > itkReaderType;
+     //  typename itkReaderType::Pointer reader = itkReaderType::New();
+     //
+     //  reader->SetFileName("d:\test.hdr");
+     //   reader->Update(); 
+        //reader->GetOutput()->Register();
+     //  this->bbSetOutputOut(reader->GetOutput());
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ItkImagesChooserDialogBox::bbUserSetDefaultValues()
+{
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ItkImagesChooserDialogBox::bbUserInitializeProcessing()
+{
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ItkImagesChooserDialogBox::bbUserFinalizeProcessing()
+{
+
+}
+}
+// EO namespace bbcreaImageIO
+
+