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)
5 #include "bbcreaImageIOItkImagesChooserDialogBox.h"
6 #include "bbcreaImageIOPackage.h"
8 namespace bbcreaImageIO
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaImageIO,ItkImagesChooserDialogBox)
12 BBTK_BLACK_BOX_IMPLEMENTATION(ItkImagesChooserDialogBox,bbtk::AtomicBlackBox);
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)
16 void ItkImagesChooserDialogBox::Process()
19 dlg = new creaImageIO::WxAnySimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database");
22 bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
23 BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
24 bbSetOutputOutVImages(dlg->getVtkImagesSelected());
27 template <class TImage>
28 void ItkImagesChooserDialogBox::Export()
30 if (dlg->getImagesSelected().size() == 1)
32 bbSetOutputOut( dlg->getTemplatedImagesSelected<TImage>().front().GetPointer() );
34 else if (dlg->getImagesSelected().size() > 1)
36 OutputImagesITKType outVect;
37 std::vector<TImage::Pointer> tempImgs= dlg->getTemplatedImagesSelected<TImage>();
38 std::vector<TImage::Pointer>::iterator it = tempImgs.begin();
39 for(;it != tempImgs.end(); ++it)
41 outVect.push_back( (*it).GetPointer() );
43 bbSetOutputOutIImages( outVect);
47 bbSetOutputOut( NULL);
49 // FCY To test the Output
50 //typedef itk::Image <short, 3> ImageType;
51 //typedef itk::ImageFileReader< ImageType > itkReaderType;
52 // typename itkReaderType::Pointer reader = itkReaderType::New();
54 // reader->SetFileName("d:\test.hdr");
56 //reader->GetOutput()->Register();
57 // this->bbSetOutputOut(reader->GetOutput());
60 // 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)
62 void ItkImagesChooserDialogBox::bbUserSetDefaultValues()
69 // 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 void ItkImagesChooserDialogBox::bbUserInitializeProcessing()
76 // 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)
78 void ItkImagesChooserDialogBox::bbUserFinalizeProcessing()
83 // EO namespace bbcreaImageIO