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

mitk::DicomDiffusionImageReader< TPixelType, TDimension > Class Template Reference

#include <mitkDicomDiffusionImageReader.h>

List of all members.

Public Types

typedef itk::VectorImage
< TPixelType, TDimension > 
OutputImageType
typedef itk::Image< TPixelType,
TDimension > 
InputImageType
typedef itk::ImageSource
< OutputImageType
ImageSourceType
typedef DicomDiffusionImageReader Self
typedef ImageSourceType Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer
typedef OutputImageType::SizeType SizeType
typedef OutputImageType::RegionType ImageRegionType
typedef std::vector
< DiffusionImageHeaderInformation::Pointer
HeaderContainer

Public Member Functions

virtual const char * GetClassName () const
void SetHeaders (const HeaderContainer &headers)
const HeaderContainerGetHeaders () const
virtual void GenerateOutputInformation (void)
virtual void EnlargeOutputRequestedRegion (itk::DataObject *output)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

void PrintSelf (std::ostream &os, itk::Indent indent) const
virtual void GenerateData ()

Protected Attributes

HeaderContainer m_Headers
int m_NumberOfDimensionsInImage

Detailed Description

template<class TPixelType, const int TDimension>
class mitk::DicomDiffusionImageReader< TPixelType, TDimension >

Definition at line 42 of file mitkDicomDiffusionImageReader.h.


Member Typedef Documentation

template<class TPixelType , const int TDimension>
typedef itk::SmartPointer<const Self> mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ConstPointer

Definition at line 50 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef std::vector<DiffusionImageHeaderInformation::Pointer> mitk::DicomDiffusionImageReader< TPixelType, TDimension >::HeaderContainer

The dictionary type of the output image.

Definition at line 66 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef OutputImageType::RegionType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ImageRegionType

The region of the output image.

Definition at line 58 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef itk::ImageSource< OutputImageType > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ImageSourceType

Definition at line 48 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef itk::Image<TPixelType, TDimension > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::InputImageType

Definition at line 47 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef itk::VectorImage< TPixelType, TDimension > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::OutputImageType

Definition at line 46 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef itk::SmartPointer<Self> mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Pointer

Definition at line 50 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef DicomDiffusionImageReader mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Self

Definition at line 50 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef OutputImageType::SizeType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::SizeType

The size of the output image.

Definition at line 51 of file mitkDicomDiffusionImageReader.h.

template<class TPixelType , const int TDimension>
typedef ImageSourceType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Superclass

Definition at line 50 of file mitkDicomDiffusionImageReader.h.


Member Function Documentation

template<class TPixelType , const int TDimension>
void mitk::DicomDiffusionImageReader< TPixelType, TDimension >::EnlargeOutputRequestedRegion ( itk::DataObject *  output ) [virtual]

Give the reader a chance to indicate that it will produce more output than it was requested to produce. ImageSeriesReader cannot currently read a portion of an image (since the ImageIO objects cannot read a portion of an image), so the ImageSeriesReader must enlarge the RequestedRegion to the size of the image on disk.

Definition at line 89 of file mitkDicomDiffusionImageReader.cpp.

  {
template<class TPixelType , const int TDimension>
void mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GenerateData (  ) [protected, virtual]

Does the real work.

Definition at line 98 of file mitkDicomDiffusionImageReader.cpp.

  {
    typename OutputImageType::Pointer out = dynamic_cast<OutputImageType*>(output);
    out->SetRequestedRegion( out->GetLargestPossibleRegion() );
}


template <class TPixelType, const int TDimension>
void DicomDiffusionImageReader<TPixelType, TDimension>
::GenerateData()
{
  typedef itk::ImageSeriesReader<InputImageType> ReaderType;

  typename OutputImageType::Pointer output = this->GetOutput();

  typedef typename OutputImageType::RegionType   RegionType;
  RegionType requestedRegion = output->GetRequestedRegion();

  // Each file must have the same size.
  SizeType validSize = requestedRegion.GetSize();

  int numberOfVolumes = static_cast<int>(m_Headers.size());

  // Allocate the output buffer
  output->SetBufferedRegion( requestedRegion );
  output->Allocate();

  itk::ProgressReporter progress(this, 0, 
                            m_Headers.size(),
                            m_Headers.size());

  itk::ImageRegionIterator<OutputImageType> ot (output, requestedRegion );

  // Clear the eventual previous content of the MetaDictionary array
  //if( m_MetaDataDictionaryArray.size() )
  //  {
  //  for(unsigned int i=0; i<m_MetaDataDictionaryArray.size(); i++)
  //    {
  //    // each element is a raw pointer, delete them.
  //    delete m_MetaDataDictionaryArray[i];
  //    }
  //  }
  //m_MetaDataDictionaryArray.clear();

  typename OutputImageType::PixelType vec;

  for (int i = 0; i < numberOfVolumes; i ++)
    {
    
    MITK_INFO << "Loading volume " << i+1 << "/" << numberOfVolumes;
    typename ReaderType::Pointer reader = ReaderType::New();
    reader->SetFileNames(m_Headers[i]->m_DicomFilenames);
    reader->UpdateLargestPossibleRegion();

    if (reader->GetOutput()->GetRequestedRegion().GetSize() != validSize)
      {
      itkExceptionMacro(<< "Size mismatch!");
      }

    itk::ImageRegionConstIterator<InputImageType> it (reader->GetOutput(),
                                               reader->GetOutput()->GetLargestPossibleRegion());
template<class TPixelType , const int TDimension>
void mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GenerateOutputInformation ( void   ) [virtual]

Prepare the allocation of the output image during the first back propagation of the pipeline.

Definition at line 52 of file mitkDicomDiffusionImageReader.cpp.

{
  Superclass::PrintSelf(os, indent);
}


template <class TPixelType, const int TDimension>
void DicomDiffusionImageReader<TPixelType, TDimension>
::GenerateOutputInformation(void)
{
  typename OutputImageType::Pointer output = this->GetOutput();
  typedef itk::ImageSeriesReader<InputImageType> ReaderType;

  // Read the first (or last) volume and use its size.
  if (m_Headers.size() > 0)
  {
    typename ReaderType::Pointer reader = ReaderType::New();

    try
    {
      // Read the image
      reader->SetFileNames (m_Headers[0]->m_DicomFilenames);
      reader->UpdateOutputInformation();

      output->SetSpacing( reader->GetOutput()->GetSpacing() );   // Set the image spacing
      output->SetOrigin( reader->GetOutput()->GetOrigin() );     // Set the image origin
      output->SetDirection( reader->GetOutput()->GetDirection() );  // Set the image direction
template<class TPixelType , const int TDimension>
virtual const char* mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GetClassName (  ) const [virtual]
template<class TPixelType , const int TDimension>
const HeaderContainer& mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GetHeaders (  ) const [inline]
template<class TPixelType , const int TDimension>
static Pointer mitk::DicomDiffusionImageReader< TPixelType, TDimension >::New (  ) [static]
template<class TPixelType , const int TDimension>
void mitk::DicomDiffusionImageReader< TPixelType, TDimension >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const [protected]

Get access to the Array of MetaDataDictionaries

Definition at line 44 of file mitkDicomDiffusionImageReader.cpp.

          {
  //  //  for(unsigned int i=0; i<m_MetaDataDictionaryArray.size(); i++)
  //  //    {
  //  //    // each element is a raw pointer, delete them.
template<class TPixelType , const int TDimension>
void mitk::DicomDiffusionImageReader< TPixelType, TDimension >::SetHeaders ( const HeaderContainer headers ) [inline]

Set the vector of strings that contains the file names. Files are processed in sequential order.

Definition at line 70 of file mitkDicomDiffusionImageReader.h.

References mitk::DicomDiffusionImageReader< TPixelType, TDimension >::m_Headers.

    {
    if ( m_Headers != headers)
      {
      m_Headers = headers;
      this->Modified();
      }
    }

Member Data Documentation

template<class TPixelType , const int TDimension>
HeaderContainer mitk::DicomDiffusionImageReader< TPixelType, TDimension >::m_Headers [protected]
template<class TPixelType , const int TDimension>
int mitk::DicomDiffusionImageReader< TPixelType, TDimension >::m_NumberOfDimensionsInImage [protected]

The number of independent variables in the images that comprise the series.

Definition at line 111 of file mitkDicomDiffusionImageReader.h.


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