34 #if defined (USE_GDCM)
37 #if defined(USE_GDCM2)
41 #include <vtkPNGReader.h>
42 #include <vtkTIFFReader.h>
43 #include <vtkJPEGReader.h>
44 #include <vtkBMPReader.h>
45 #include <vtkSLCReader.h>
46 #include <vtkMetaImageReader.h>
49 #include "boost/filesystem/path.hpp"
58 mLastFilename(
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
64 Register( boost::shared_ptr<AbstractImageReader>(
new VtkImageReader(vtkPNGReader::New() ,
"PNG",
".png")));
65 Register(boost::shared_ptr<AbstractImageReader>(
new VtkImageReader(vtkTIFFReader::New(),
"TIFF",
".tiff")));
66 Register(boost::shared_ptr<AbstractImageReader>(
new VtkImageReader(vtkJPEGReader::New(),
"JPEG",
".jpeg")));
69 Register(boost::shared_ptr<AbstractImageReader>(
new VtkImageReader(vtkMetaImageReader::New(),
"MHD",
".mhd")));
78 dim[0] = dim[1] = 128;
83 for (
int i=0;i<dim[0];i++)
84 for (
int j=0;j<dim[1];j++)
86 for (
int i=0;i<dim[0];i++)
132 std::vector<std::string >::iterator i ;
136 if ( (*i).c_str() == filename)
158 std::vector<boost::shared_ptr<AbstractImageReader> >::iterator i;
161 ok = (*i)->CanRead(filename);
182 vtkImageData* im = vtkImageData::New();
190 i = vtkImageData::New();
198 std::map <std::string , std::string> &infos, std::vector<std::string> i_attr)
207 mLastReader->getAttributes(filename, infos, i_attr);
211 std::map<std::string,std::string>& attr)
229 std::vector<boost::shared_ptr<AbstractImageReader> >::iterator i;
232 (*i)->PushBackExtensions(v);