X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOImageReader.cpp;h=1ef6ce428a84d1c61fd7f9d6fb5b166e9995c6ab;hb=da80530068246081505e9649523d10e8da8e6acd;hp=54257c1abc7fa45ea2fe87807f48ee28c5d6ddc5;hpb=c3995376cec80f027b3639ba919883590849df27;p=creaImageIO.git diff --git a/src2/creaImageIOImageReader.cpp b/src2/creaImageIOImageReader.cpp index 54257c1..1ef6ce4 100644 --- a/src2/creaImageIOImageReader.cpp +++ b/src2/creaImageIOImageReader.cpp @@ -15,7 +15,6 @@ //#include - #include "boost/filesystem/path.hpp" namespace creaImageIO @@ -29,23 +28,20 @@ namespace creaImageIO ImageReader::ImageReader() : mUnreadableImage(0), - mLastFilename("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"), - mLastReader(0) - + mLastFilename("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") { // std::cout << "#### ImageReader::ImageReader()"<(new VtkImageReader(vtkPNGReader::New(), "PNG", ".png"))); + Register(boost::shared_ptr(new VtkImageReader(vtkTIFFReader::New(), "JPEG", ".jpeg"))); + Register(boost::shared_ptr(new VtkImageReader(vtkJPEGReader::New()))); + Register(boost::shared_ptr(new VtkImageReader(vtkBMPReader::New()))); + Register(boost::shared_ptr(new VtkImageReader(vtkSLCReader::New()))); + Register(boost::shared_ptr(new VtkImageReader(vtkMetaImageReader::New(),"MHD",".mhd"))); // Register(new VtkImageReader(vtkGESignalReader::New())); - Register(new DicomImageReader); - Register(new UltrasonixImageReader); + Register(boost::shared_ptr(new DicomImageReader)); + Register(boost::shared_ptr(new UltrasonixImageReader)); mUnreadableImage = vtkImageData::New(); @@ -72,12 +68,12 @@ namespace creaImageIO //===================================================================== ImageReader::~ImageReader() { - std::vector::iterator i; - for (i=mReader.begin(); i!=mReader.end(); i++) - { - delete (*i); - } - mReader.clear(); + + // for (i=mReader.begin(); i!=mReader.end(); i++) + // { + //delete (*i); + // } +// mReader.clear(); if (mUnreadableImage!=0) { mUnreadableImage->Delete(); @@ -87,7 +83,7 @@ namespace creaImageIO //===================================================================== //===================================================================== - void ImageReader::Register(AbstractImageReader* r) + void ImageReader::Register(boost::shared_ptr r) { mReader.push_back(r); @@ -101,7 +97,7 @@ namespace creaImageIO bool ok = false; if(filename != "") { - std::vector::iterator i; + std::vector >::iterator i; for (i=mReader.begin(); i!=mReader.end(); i++) { ok = (*i)->CanRead(filename); @@ -162,7 +158,7 @@ namespace creaImageIO /// Pushes back all kwown extensions (without dot) in the vector given void ImageReader::PushBackExtensions(std::vector& v) { - std::vector::iterator i; + std::vector >::iterator i; for (i=mReader.begin(); i!=mReader.end(); i++) { (*i)->PushBackExtensions(v);