Concrete image reader based on a vtkImageReader2. More...
#include <creaImageIOVtkImageReader.h>


Public Member Functions | |
| VtkImageReader (vtkImageReader2 *reader, const std::string &name="", const std::string &extensions="") | |
| virtual | ~VtkImageReader () |
| virtual void | PushBackExtensions (std::vector< std::string > &) |
| Add file extensions read by the reader. | |
| virtual bool | CanRead (const std::string &filename) |
| Test if file is read by this reader. | |
| virtual vtkImageData * | ReadImage (const std::string &filename) |
| return for a file a 2D VTkImage | |
| virtual void | ReadAttributes (const std::string &filename, tree::AttributeMapType &attr) |
| Read the attributes for a file. | |
| virtual void | getAttributes (const std::string filename, std::map< std::string, std::string > &infos, std::vector< std::string > i_attr) |
| Another function to read attributes for a file. | |
| const std::string & | GetName () const |
| Get the reader's name. | |
Protected Member Functions | |
| void | SetName (const std::string &s) |
| Set the reader's name. | |
Private Attributes | |
| vtkImageReader2 * | mReader |
| std::string | mExtensions |
Concrete image reader based on a vtkImageReader2.
Definition at line 20 of file creaImageIOVtkImageReader.h.
| creaImageIO::VtkImageReader::VtkImageReader | ( | vtkImageReader2 * | reader, | |
| const std::string & | name = "", |
|||
| const std::string & | extensions = "" | |||
| ) |
Definition at line 8 of file creaImageIOVtkImageReader.cpp.
References creaImageIO::AbstractImageReader::GetName(), GimmickDebugMessage, mReader, and creaImageIO::AbstractImageReader::SetName().
: mReader(r), mExtensions(extensions) { if (name.size() == 0) { const char *test =mReader->GetDescriptiveName(); if(test != "") { SetName ( "toto");// mReader->GetDescriptiveName()); } } else { SetName ( name ); } GimmickDebugMessage(5,"Constructing vtkImageReader : "<<GetName() <<std::endl); }

| creaImageIO::VtkImageReader::~VtkImageReader | ( | ) | [virtual] |
Definition at line 32 of file creaImageIOVtkImageReader.cpp.
References mReader.
{
mReader->Delete();
}
| bool creaImageIO::VtkImageReader::CanRead | ( | const std::string & | filename | ) | [virtual] |
Test if file is read by this reader.
Reimplemented from creaImageIO::AbstractImageReader.
Definition at line 40 of file creaImageIOVtkImageReader.cpp.
References mReader.
{
return (mReader->CanReadFile(filename.c_str())!=0);
/* if(filename != "")
{
return (mReader->CanReadFile(filename.c_str())!=0);
}
else
{
return false;
}*/
}
| void creaImageIO::VtkImageReader::getAttributes | ( | const std::string | filename, | |
| std::map< std::string, std::string > & | infos, | |||
| std::vector< std::string > | i_attr | |||
| ) | [virtual] |
Another function to read attributes for a file.
Reimplemented from creaImageIO::AbstractImageReader.
Definition at line 54 of file creaImageIOVtkImageReader.cpp.
{
}
| const std::string& creaImageIO::AbstractImageReader::GetName | ( | ) | const [inline, inherited] |
Get the reader's name.
Definition at line 16 of file creaImageIOAbstractImageReader.h.
Referenced by VtkImageReader().
{

| void creaImageIO::VtkImageReader::PushBackExtensions | ( | std::vector< std::string > & | v | ) | [virtual] |
Add file extensions read by the reader.
Reimplemented from creaImageIO::AbstractImageReader.
Definition at line 103 of file creaImageIOVtkImageReader.cpp.
References mExtensions, mReader, and creaImageIO::SplitExtensionsString().
{
std::string ext = mExtensions;
if (ext.size()==0) ext = mReader->GetFileExtensions ();
SplitExtensionsString(ext," ",v);
}

| virtual void creaImageIO::VtkImageReader::ReadAttributes | ( | const std::string & | filename, | |
| tree::AttributeMapType & | attr | |||
| ) | [virtual] |
Read the attributes for a file.
Reimplemented from creaImageIO::AbstractImageReader.
| vtkImageData * creaImageIO::VtkImageReader::ReadImage | ( | const std::string & | filename | ) | [virtual] |
return for a file a 2D VTkImage
Reimplemented from creaImageIO::AbstractImageReader.
Definition at line 59 of file creaImageIOVtkImageReader.cpp.
References mReader.
| void creaImageIO::AbstractImageReader::SetName | ( | const std::string & | s | ) | [inline, protected, inherited] |
Set the reader's name.
Definition at line 36 of file creaImageIOAbstractImageReader.h.
Referenced by creaImageIO::DicomImageReader::DicomImageReader(), creaImageIO::UltrasonixImageReader::UltrasonixImageReader(), and VtkImageReader().

std::string creaImageIO::VtkImageReader::mExtensions [private] |
Definition at line 45 of file creaImageIOVtkImageReader.h.
Referenced by PushBackExtensions().
vtkImageReader2* creaImageIO::VtkImageReader::mReader [private] |
Definition at line 44 of file creaImageIOVtkImageReader.h.
Referenced by CanRead(), PushBackExtensions(), ReadImage(), VtkImageReader(), and ~VtkImageReader().
1.7.1