#include <mitkDicomDiffusionImageReader.h>
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< Self > | Pointer |
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 HeaderContainer & | GetHeaders () 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 |
Definition at line 42 of file mitkDicomDiffusionImageReader.h.
typedef itk::SmartPointer<const Self> mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ConstPointer |
Definition at line 50 of file mitkDicomDiffusionImageReader.h.
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.
typedef OutputImageType::RegionType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ImageRegionType |
The region of the output image.
Definition at line 58 of file mitkDicomDiffusionImageReader.h.
typedef itk::ImageSource< OutputImageType > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::ImageSourceType |
Definition at line 48 of file mitkDicomDiffusionImageReader.h.
typedef itk::Image<TPixelType, TDimension > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::InputImageType |
Definition at line 47 of file mitkDicomDiffusionImageReader.h.
typedef itk::VectorImage< TPixelType, TDimension > mitk::DicomDiffusionImageReader< TPixelType, TDimension >::OutputImageType |
Definition at line 46 of file mitkDicomDiffusionImageReader.h.
typedef itk::SmartPointer<Self> mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Pointer |
Definition at line 50 of file mitkDicomDiffusionImageReader.h.
typedef DicomDiffusionImageReader mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Self |
Definition at line 50 of file mitkDicomDiffusionImageReader.h.
typedef OutputImageType::SizeType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::SizeType |
The size of the output image.
Definition at line 51 of file mitkDicomDiffusionImageReader.h.
typedef ImageSourceType mitk::DicomDiffusionImageReader< TPixelType, TDimension >::Superclass |
Definition at line 50 of file mitkDicomDiffusionImageReader.h.
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.
{
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());
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
virtual const char* mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GetClassName | ( | ) | const [virtual] |
const HeaderContainer& mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GetHeaders | ( | ) | const [inline] |
Definition at line 78 of file mitkDicomDiffusionImageReader.h.
References mitk::DicomDiffusionImageReader< TPixelType, TDimension >::m_Headers.
{ return m_Headers; }
static Pointer mitk::DicomDiffusionImageReader< TPixelType, TDimension >::New | ( | ) | [static] |
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.
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.
HeaderContainer mitk::DicomDiffusionImageReader< TPixelType, TDimension >::m_Headers [protected] |
A list of filenames to be processed.
Definition at line 107 of file mitkDicomDiffusionImageReader.h.
Referenced by mitk::DicomDiffusionImageReader< TPixelType, TDimension >::GetHeaders(), and mitk::DicomDiffusionImageReader< TPixelType, TDimension >::SetHeaders().
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.