Public Member Functions | Private Member Functions | Private Attributes

creaImageIO::DicomImageScanner Class Reference
[Image I/O classes]

Concrete image reader for DICOM images. More...

#include <creaImageIODicomScanner.h>

List of all members.

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

Detailed Description

Concrete image reader for DICOM images.

Definition at line 24 of file creaImageIODicomScanner.h.


Constructor & Destructor Documentation

creaImageIO::DicomImageScanner::DicomImageScanner (  ) 

Definition at line 6 of file creaImageIODicomScanner.cpp.

Referenced by addDirectory().

{

Here is the caller graph for this function:

creaImageIO::DicomImageScanner::~DicomImageScanner (  )  [virtual]

Definition at line 15 of file creaImageIODicomScanner.cpp.

Referenced by addDirectory().

{

Here is the caller graph for this function:


Member Function Documentation

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

Here is the call graph for this function:

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.


Member Data Documentation

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().


The documentation for this class was generated from the following files: