//===== // 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(); bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front()); BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export); bbSetOutputOutVImages(dlg->getVtkImagesSelected()); delete dlg; } template void ItkImagesChooserDialogBox::Export() { if (dlg->getImagesSelected().size() == 1) { bbSetOutputOut( dlg->getTemplatedImagesSelected().front().GetPointer() ); } else if (dlg->getImagesSelected().size() > 1) { OutputImagesITKType outVect; std::vector tempImgs= dlg->getTemplatedImagesSelected(); std::vector::iterator it = tempImgs.begin(); for(;it != tempImgs.end(); ++it) { outVect.push_back( (*it).GetPointer() ); } bbSetOutputOutIImages( outVect); } else { bbSetOutputOut( NULL); } // FCY To test the Output //typedef itk::Image 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