Program: bbtk
Module: $RCSfile: bbitkImageSeriesReader.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:21 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/26 10:13:32 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
}
std::string filename = filenames[0];
-
+
itk::ImageIOBase::Pointer genericReader =
itk::ImageIOFactory::CreateImageIO(filename.c_str(),
itk::ImageIOFactory::ReadMode);
+
if (!genericReader)
{
- bbtkError(bbGetFullName()<<" : File format unknown (while reading \"" << filename << "\")");
+ bbtkError(bbGetFullName()<<" : File format unknown (while reading [" << filename << "])");
}
genericReader->SetFileName(filename.c_str());
- genericReader->ReadImageInformation();
+ genericReader->ReadImageInformation();
- bbtk::TypeInfo typ = GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(genericReader->GetComponentTypeInfo(), genericReader->GetNumberOfDimensions());
+ int plusUn;
+ if (filenames.size()>1)
+ plusUn = 1;
+ else
+ plusUn = 0;
+ bbtk::TypeInfo typ = GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(genericReader->GetComponentTypeInfo(), genericReader->GetNumberOfDimensions() + plusUn);
+
BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ,Read);
-
+
}
/**
}
-
-
-
-
}
// eo namespace bbtk
Program: bbtk
Module: $RCSfile: bbitkImageSeriesReader.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/11/26 10:13:32 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
typedef std::vector<std::string> vectorofstring;
BBTK_INPUT(ImageSeriesReader,FileNames,
"vector of file names with complete paths",vectorofstring,"file names list");
- BBTK_OUTPUT(ImageSeriesReader,Out,"Output itk::image<T,D> with type T and dimension D determined by the content of the files",anyImagePointer,"");
+ BBTK_OUTPUT(ImageSeriesReader,Out,"Output itk::image<T,D> with type T and dimension D determined by the content of the files + vector size",anyImagePointer,"");
BBTK_END_DESCRIBE_BLACK_BOX(ImageSeriesReader);
//=================================================================