]> Creatis software - creaImageIO.git/blob - bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx
c035509b94a39bde08d4761e8a8035a2d602d9fc
[creaImageIO.git] / bbtk / src / bbcreaImageIOItkImagesChooserDialogBox.cxx
1 //===== 
2 // 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)
3 //===== 
4
5 #include "bbcreaImageIOItkImagesChooserDialogBox.h"
6 #include "bbcreaImageIOPackage.h"
7
8 namespace bbcreaImageIO
9 {
10
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaImageIO,ItkImagesChooserDialogBox)
12 BBTK_BLACK_BOX_IMPLEMENTATION(ItkImagesChooserDialogBox,bbtk::AtomicBlackBox);
13 //===== 
14 // 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)
15 //===== 
16 void ItkImagesChooserDialogBox::Process()
17 {
18  
19         dlg = new creaImageIO::WxAnySimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
20     dlg->ShowModal(); 
21         
22         // FCY to test
23         bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
24         BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
25         bbSetOutputOutVImages(dlg->getVtkImagesSelected());
26         delete dlg;
27 }
28 template <class TImage>
29 void ItkImagesChooserDialogBox::Export()
30 {
31          if (dlg->getImagesSelected().size() == 1)
32          { 
33                 bbSetOutputOut( dlg->getTemplatedImagesSelected<TImage>().front().GetPointer() ); 
34          } 
35           else if (dlg->getImagesSelected().size() > 1)
36           { 
37 //              bbSetOutputOutImages( bbSetOutputOutIImages( dlg->getTemplatedImagesSelected<TImage>() )); 
38       } 
39           else
40           {
41                 bbSetOutputOut( NULL); 
42           }
43          // FCY To test the Output
44           //typedef itk::Image <short, 3> ImageType;
45          //typedef itk::ImageFileReader< ImageType > itkReaderType;
46      //  typename itkReaderType::Pointer reader = itkReaderType::New();
47      //
48      //  reader->SetFileName("d:\test.hdr");
49      //   reader->Update(); 
50          //reader->GetOutput()->Register();
51      //  this->bbSetOutputOut(reader->GetOutput());
52 }
53 //===== 
54 // 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)
55 //===== 
56 void ItkImagesChooserDialogBox::bbUserSetDefaultValues()
57 {
58  
59  
60   
61 }
62 //===== 
63 // 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)
64 //===== 
65 void ItkImagesChooserDialogBox::bbUserInitializeProcessing()
66 {
67
68 }
69 //===== 
70 // 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)
71 //===== 
72 void ItkImagesChooserDialogBox::bbUserFinalizeProcessing()
73 {
74
75 }
76 }
77 // EO namespace bbcreaImageIO
78
79