Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

mitk::GEDicomDiffusionImageHeaderReader Class Reference

#include <mitkGEDicomDiffusionImageHeaderReader.h>

Inheritance diagram for mitk::GEDicomDiffusionImageHeaderReader:
Inheritance graph
[legend]
Collaboration diagram for mitk::GEDicomDiffusionImageHeaderReader:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
GEDicomDiffusionImageHeaderReader 
Self
typedef
DicomDiffusionImageHeaderReader 
Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual void Update ()

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 GEDicomDiffusionImageHeaderReader ()
virtual ~GEDicomDiffusionImageHeaderReader ()

Detailed Description

Definition at line 27 of file mitkGEDicomDiffusionImageHeaderReader.h.


Member Typedef Documentation

Reimplemented from mitk::DicomDiffusionImageHeaderReader.

Definition at line 31 of file mitkGEDicomDiffusionImageHeaderReader.h.

Reimplemented from mitk::DicomDiffusionImageHeaderReader.

Definition at line 31 of file mitkGEDicomDiffusionImageHeaderReader.h.

Reimplemented from mitk::DicomDiffusionImageHeaderReader.

Definition at line 31 of file mitkGEDicomDiffusionImageHeaderReader.h.

Reimplemented from mitk::DicomDiffusionImageHeaderReader.

Definition at line 31 of file mitkGEDicomDiffusionImageHeaderReader.h.


Constructor & Destructor Documentation

mitk::GEDicomDiffusionImageHeaderReader::GEDicomDiffusionImageHeaderReader (  ) [protected]

Definition at line 54 of file mitkGEDicomDiffusionImageHeaderReader.cpp.

{
}
mitk::GEDicomDiffusionImageHeaderReader::~GEDicomDiffusionImageHeaderReader (  ) [protected, virtual]

Definition at line 58 of file mitkGEDicomDiffusionImageHeaderReader.cpp.

{
}

Member Function Documentation

virtual const char* mitk::GEDicomDiffusionImageHeaderReader::GetClassName (  ) const [virtual]
static Pointer mitk::GEDicomDiffusionImageHeaderReader::New (  ) [static]
void mitk::GEDicomDiffusionImageHeaderReader::Update (  ) [virtual]

Reimplemented from mitk::DicomDiffusionImageHeaderReader.

Definition at line 63 of file mitkGEDicomDiffusionImageHeaderReader.cpp.

References GEDictBValue(), GEDictXGradient(), GEDictYGradient(), and GEDictZGradient().

{

  // check if there are filenames
  if(m_DicomFilenames.size())
  {
    // adapted from namic-sandbox
    // DicomToNrrdConverter.cxx

    VolumeReaderType::DictionaryArrayRawPointer inputDict 
      = m_VolumeReader->GetMetaDataDictionaryArray();

#ifndef DGDCM2
    if(gdcm::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GEDictBValue.GetKey()) == 0)
      gdcm::Global::GetDicts()->GetDefaultPubDict()->AddEntry(GEDictBValue);
    if(gdcm::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GEDictXGradient.GetKey()) == 0)
      gdcm::Global::GetDicts()->GetDefaultPubDict()->AddEntry(GEDictXGradient);
    if(gdcm::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GEDictYGradient.GetKey()) == 0)
      gdcm::Global::GetDicts()->GetDefaultPubDict()->AddEntry(GEDictYGradient);
    if(gdcm::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GEDictZGradient.GetKey()) == 0)
      gdcm::Global::GetDicts()->GetDefaultPubDict()->AddEntry(GEDictZGradient);
#endif

    ReadPublicTags();

    //int mMosaic;   // number of raws in each mosaic block;
    //int nMosaic;   // number of columns in each mosaic block

    float x0, y0, z0;
    float x1, y1, z1;
    std::string tag;
    tag.clear();
    itk::ExposeMetaData<std::string> ( *(*inputDict)[0], "0020|0032", tag );
    sscanf( tag.c_str(), "%f\\%f\\%f", &x0, &y0, &z0 );
    std::cout << "Slice 0: " << tag << std::endl;
    tag.clear();

    // assume volume interleaving, i.e. the second dicom file stores
    // the second slice in the same volume as the first dicom file
    itk::ExposeMetaData<std::string> ( *(*inputDict)[1], "0020|0032", tag );
    sscanf( tag.c_str(), "%f\\%f\\%f", &x1, &y1, &z1 );
    std::cout << "Slice 1: " << tag << std::endl;
    x1 -= x0; y1 -= y0; z1 -= z0;
    x0 = x1*this->m_Output->xSlice + y1*this->m_Output->ySlice + z1*this->m_Output->zSlice;
    if (x0 < 0)
    {
      m_SliceOrderIS = false;
    }

    ReadPublicTags2();

    int nSliceInVolume;
    int nVolume;

    nSliceInVolume = m_sliceLocations.size();
    nVolume = m_nSlice/nSliceInVolume;

    // assume volume interleaving
    std::cout << "Number of Slices: " << m_nSlice << std::endl;
    std::cout << "Number of Volume: " << nVolume << std::endl;
    std::cout << "Number of Slices in each volume: " << nSliceInVolume << std::endl;

    for (int k = 0; k < m_nSlice; k += nSliceInVolume)
    {
      tag.clear();
      bool exist = itk::ExposeMetaData<std::string> ( *(*inputDict)[k], "0043|1039",  tag);
      float b = atof( tag.c_str() );
      this->m_Output->bValue = b;

      vnl_vector_fixed<double, 3> vect3d;
      if (!exist || b == 0)
      {
        vect3d.fill( 0 );
        this->m_Output->DiffusionVector = vect3d;      
        continue;
      }

      vect3d.fill( 0 );
      tag.clear();
      itk::ExposeMetaData<std::string> ( *(*inputDict)[k], "0019|10bb",  tag);
      vect3d[0] = atof( tag.c_str() );

      tag.clear();
      itk::ExposeMetaData<std::string> ( *(*inputDict)[k], "0019|10bc",  tag);
      vect3d[1] = atof( tag.c_str() );

      tag.clear();
      itk::ExposeMetaData<std::string> ( *(*inputDict)[k], "0019|10bd",  tag);
      vect3d[2] = atof( tag.c_str() );

      vect3d.normalize();
      this->m_Output->DiffusionVector = vect3d;      
    }

    TransformGradients();

  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines