Concrete image reader for DICOM images. More...
#include <creaImageIODicomScanner.h>
Public Member Functions | |
DicomImageScanner () | |
virtual | ~DicomImageScanner () |
bool | addDirectory (std::string &filename, std::map< std::string, std::string > &attr) |
Add file extensions read by the 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. | |
void | ReadAttributes2 (const std::string &filename, tree::AttributeMapType &attr) |
std::string | irclean (const std::string &str) |
Private Member Functions | |
const std::string | GetStringValueFromTag (const gdcm::DataElement &ds) |
Private Attributes | |
vtkGDCMImageReader * | mReader |
gdcm::Scanner | mscan |
bool | b_loaded |
Concrete image reader for DICOM images.
Definition at line 24 of file creaImageIODicomScanner.h.
creaImageIO::DicomImageScanner::DicomImageScanner | ( | ) |
Definition at line 6 of file creaImageIODicomScanner.cpp.
Referenced by addDirectory().
{
creaImageIO::DicomImageScanner::~DicomImageScanner | ( | ) | [virtual] |
Definition at line 15 of file creaImageIODicomScanner.cpp.
Referenced by addDirectory().
{
bool creaImageIO::DicomImageScanner::addDirectory | ( | std::string & | filename, | |
std::map< std::string, std::string > & | attr | |||
) |
Add file extensions read by the reader.
Definition at line 22 of file creaImageIODicomScanner.cpp.
References b_loaded, DicomImageScanner(), mReader, mscan, and ~DicomImageScanner().
{ //===================================================================== DicomImageScanner::DicomImageScanner() { mReader = vtkGDCMImageReader::New(); mscan.ClearTags(); b_loaded = false; }; //===================================================================== //===================================================================== DicomImageScanner::~DicomImageScanner() { mReader->Delete(); } //===================================================================== //===================================================================== bool DicomImageScanner::addDirectory(std::string& filename, std::map<std::string,std::string>& attr) { if(!b_loaded) { mscan.ClearTags(); std::map<std::string,std::string>::iterator i; int j= 0; for (i=attr.begin();i!=attr.end();++i, j++) { if ( i->first == "D0004_1500" || i->first == "FullFileName" || i->first == "FullFileDirectory" ) { } else
const std::string creaImageIO::DicomImageScanner::GetStringValueFromTag | ( | const gdcm::DataElement & | ds | ) | [private] |
Definition at line 178 of file creaImageIODicomScanner.cpp.
std::string creaImageIO::DicomImageScanner::irclean | ( | const std::string & | str | ) |
Definition at line 81 of file creaImageIODicomScanner.cpp.
References mReader.
{ mReader->SetFileName(filename.c_str()); mReader->Update(); im = vtkImageData::New(); im->ShallowCopy(mReader->GetOutput()); } catch (...) { if (im!=0) im->Delete(); im = 0; } return im; } //===================================================================== //========================================================================
virtual void creaImageIO::DicomImageScanner::ReadAttributes | ( | const std::string & | filename, | |
tree::AttributeMapType & | attr | |||
) | [virtual] |
Read the attributes for a file.
void creaImageIO::DicomImageScanner::ReadAttributes2 | ( | const std::string & | filename, | |
tree::AttributeMapType & | attr | |||
) |
vtkImageData * creaImageIO::DicomImageScanner::ReadImage | ( | const std::string & | filename | ) | [virtual] |
return for a file a 2D VTkImage
Definition at line 59 of file creaImageIODicomScanner.cpp.
bool creaImageIO::DicomImageScanner::b_loaded [private] |
Definition at line 46 of file creaImageIODicomScanner.h.
Referenced by addDirectory().
vtkGDCMImageReader* creaImageIO::DicomImageScanner::mReader [private] |
Definition at line 44 of file creaImageIODicomScanner.h.
Referenced by addDirectory(), and irclean().
gdcm::Scanner creaImageIO::DicomImageScanner::mscan [private] |
Definition at line 45 of file creaImageIODicomScanner.h.
Referenced by addDirectory().