// std::cout << "#### ImageReader::ImageReader()"<<std::endl;
if (mUnreadableImage!=0) return;
- Register(new VtkImageReader(vtkPNGReader::New()));
- Register(new VtkImageReader(vtkTIFFReader::New()));
+
+ Register(new VtkImageReader(vtkPNGReader::New(), "PNG", ".png"));
+ Register(new VtkImageReader(vtkTIFFReader::New(), "JPEG", ".jpeg"));
Register(new VtkImageReader(vtkJPEGReader::New()));
Register(new VtkImageReader(vtkBMPReader::New()));
Register(new VtkImageReader(vtkSLCReader::New()));
bool ImageReader::CanRead( const std::string& filename )
{
bool ok = false;
- std::vector<AbstractImageReader*>::iterator i;
- for (i=mReader.begin(); i!=mReader.end(); i++)
- {
- ok = (*i)->CanRead(filename);
- if (ok)
- {
- mLastFilename = filename;
- mLastReader = *i;
- break;
- }
- }
- return ok;
+ if(filename != "")
+ {
+ std::vector<AbstractImageReader*>::iterator i;
+ for (i=mReader.begin(); i!=mReader.end(); i++)
+ {
+ ok = (*i)->CanRead(filename);
+ if (ok)
+ {
+ mLastFilename = filename;
+ mLastReader = *i;
+ break;
+ }
+ }
+ }
+ return ok;
+
}
//=====================================================================