// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+ std::vector<vtkImageData*> lstImages;
- std::vector<vtkImageData*> lstImages;
+ if ( bbGetInputFileNames().size()>0 )
+ {
+ if (bbGetInputType()==0)
+ {
+ vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New();
+ if ( bbGetInputFileNames().size()==1)
+ {
+ reader->SetFileName( bbGetInputFileNames()[0].c_str() );
+ reader->Update();
+ } else {
+ vtkStringArray *lstFileNames=vtkStringArray::New();
+ int i,size=bbGetInputFileNames().size();
+ for (i=0;i<size;i++)
+ {
+ lstFileNames->InsertNextValue( bbGetInputFileNames()[i].c_str() );
+ } // for i
+ reader->SetFileNames( lstFileNames );
+ reader->Update();
+ } // FileNames
+ lstImages.push_back( reader->GetOutput() );
+ } // Type 0
- if (bbGetInputType()==0)
- {
- vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New();
- if ( bbGetInputFileNames().size()==1)
- {
- reader->SetFileName( bbGetInputFileNames()[0].c_str() );
- reader->Update();
- } else {
- vtkStringArray *lstFileNames=vtkStringArray::New();
- int i,size=bbGetInputFileNames().size();
- for (i=0;i<size;i++)
- {
-printf("EED Warnning, somethin is not working ???? NIFTIImageReader::Process() %s\n ", bbGetInputFileNames()[i].c_str() );
- lstFileNames->InsertNextValue( bbGetInputFileNames()[i].c_str() );
- } // for i
- reader->SetFileNames( lstFileNames );
- reader->Update();
- } // FileNames
- lstImages.push_back( reader->GetOutput() );
- } // Type 0
-
- if (bbGetInputType()==1)
- {
- int i,size=bbGetInputFileNames().size();
- for (i=0;i<size;i++)
- {
- vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New();
- reader->SetFileName( bbGetInputFileNames()[i].c_str() );
- reader->Update();
- lstImages.push_back( reader->GetOutput() );
- } // for i
- } // Type 1
+ if (bbGetInputType()==1)
+ {
+ int i,size=bbGetInputFileNames().size();
+ for (i=0;i<size;i++)
+ {
+ vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New();
+ reader->SetFileName( bbGetInputFileNames()[i].c_str() );
+ reader->Update();
+ lstImages.push_back( reader->GetOutput() );
+ } // for i
+ } // Type 1
+ } // if
if (lstImages.size()>=1) { bbSetOutputOut( lstImages[0] ); } else {bbSetOutputOut( NULL ); }
bbSetOutputOutVector( lstImages );
+
}
//=====
// 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)