BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MetaImageReader)
BBTK_BLACK_BOX_IMPLEMENTATION(MetaImageReader,bbtk::AtomicBlackBox);
+
+
+void MetaImageReader::Read_mhdb( std::string filename )
+{
+ printf("EED MetaImageReader::Read_mhdb \n");
+}
+
+
//=====
// 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)
//=====
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- FILE *ff=fopen(bbGetInputIn().c_str(),"r");
- if (ff)
- {
- fclose(ff);
- vtkMetaImageReader *reader = vtkMetaImageReader::New();
- reader->SetFileName(bbGetInputIn().c_str());
- reader->Update();
- bbSetOutputOut(reader->GetOutput());
- } else {
- bbSetOutputOut(NULL);
- }
+ if (bbGetInputIn().length()!=0)
+ {
+ if (bbGetInputIn().substr(bbGetInputIn().size()-5) == ".mhdb")
+ {
+ Read_mhdb( bbGetInputIn() );
+ } else {
+ FILE *ff = fopen( bbGetInputIn().c_str() , "r" );
+ if (ff)
+ {
+ fclose(ff);
+ vtkMetaImageReader *reader = vtkMetaImageReader::New();
+ reader->SetFileName( bbGetInputIn().c_str() );
+ reader->Update();
+ bbSetOutputOut( reader->GetOutput() );
+ } else {
+ bbSetOutputOut(NULL);
+ } // ff
+ }// .mhdb
+ } else {
+ bbSetOutputOut(NULL);
+ } // if In.length
}
+
//=====
// 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)
//=====