Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ItkImageFileReader Class Reference

Reader to read file formats supported by itk. More...

#include <mitkItkImageFileReader.h>

Inheritance diagram for mitk::ItkImageFileReader:
Collaboration diagram for mitk::ItkImageFileReader:

Public Member Functions

 mitkClassMacro (ItkImageFileReader, FileReader)
 
Pointer Clone () const
 
virtual void SetFileName (const char *_arg)
 Specify the file to load. More...
 
virtual const char * GetFileName () const
 
virtual void SetFilePrefix (const char *_arg)
 Specify file prefix for the file(s) to load. More...
 
virtual const char * GetFilePrefix () const
 Get the specified file prefix for the file(s) to load. More...
 
virtual void SetFilePattern (const char *_arg)
 Specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number. More...
 
virtual const char * GetFilePattern () const
 Get the specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number. More...
 
- Public Member Functions inherited from mitk::ImageSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
virtual itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 
- Public Member Functions inherited from mitk::FileReader
virtual std::vector< std::string > GetClassHierarchy () const
 
 itkTypeMacroNoParent (FileReader) virtual const char *GetFileName() const =0
 Get the specified the file to load. More...
 
virtual bool CanReadFromMemory ()
 Specifies, whether the file reader also can read a file from a memory buffer. More...
 
virtual void SetReadFromMemory (bool read)
 Set/Get functions to advise the file reader to use a memory array for reading a file. More...
 
virtual bool GetReadFromMemory ()
 
virtual void SetMemoryBuffer (const char *dataArray, unsigned int size)
 To be used along with a call of SetReadFromMemory(true). This sets the memory buffer and the size from which the reader will read. More...
 

Static Public Member Functions

static Pointer New ()
 
static bool CanReadFile (const std::string filename, const std::string filePrefix, const std::string filePattern)
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::FileReader
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

virtual void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
 ItkImageFileReader ()
 
 ~ItkImageFileReader ()
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
virtual ~ImageSource ()
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
virtual void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
virtual ~BaseDataSource ()
 
- Protected Member Functions inherited from mitk::FileReader
 FileReader ()
 
virtual ~FileReader ()
 

Protected Attributes

std::string m_FileName
 
std::string m_FilePrefix
 
std::string m_FilePattern
 
- Protected Attributes inherited from mitk::FileReader
bool m_CanReadFromMemory
 
bool m_ReadFromMemory
 
const char * m_MemoryBuffer
 
unsigned int m_MemorySize
 

Additional Inherited Members

- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- Public Types inherited from mitk::FileReader
typedef FileReader Self
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Static Protected Member Functions inherited from mitk::ImageSource
static ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Reader to read file formats supported by itk.

Deprecated:
(as of 2014_10) Use mitk::IOUtils or mitk::FileReaderRegistry instead.

Definition at line 30 of file mitkItkImageFileReader.h.

Constructor & Destructor Documentation

mitk::ItkImageFileReader::ItkImageFileReader ( )
protected

Definition at line 212 of file mitkItkImageFileReader.cpp.

mitk::ItkImageFileReader::~ItkImageFileReader ( )
protected

Definition at line 216 of file mitkItkImageFileReader.cpp.

Member Function Documentation

bool mitk::ItkImageFileReader::CanReadFile ( const std::string  filename,
const std::string  filePrefix,
const std::string  filePattern 
)
static

Definition at line 166 of file mitkItkImageFileReader.cpp.

References MITK_INFO.

Pointer mitk::ItkImageFileReader::Clone ( ) const
void mitk::ItkImageFileReader::GenerateData ( )
overrideprotectedvirtual

A version of GenerateData() specific for image processing filters.

This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling ThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter an be threaded, it should NOT provide a GenerateData() method but should provide a ThreadedGenerateData() instead.

See also
ThreadedGenerateData()

Reimplemented from mitk::ImageSource.

Definition at line 39 of file mitkItkImageFileReader.cpp.

References mitk::BaseGeometry::GetCornerPoint(), mitk::BaseGeometry::GetIndexToWorldTransform(), mitk::ImageSource::GetOutput(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), m_FileName, mitk::MakePixelType(), mitk::Image::ManageMemory, MITK_INFO, mitkThrow, mitk::ProportionalTimeGeometry::New(), mitk::BaseGeometry::SetOrigin(), and mitk::BaseGeometry::SetSpacing().

virtual const char* mitk::ItkImageFileReader::GetFileName ( ) const
virtual
virtual const char* mitk::ItkImageFileReader::GetFilePattern ( ) const
virtual

Get the specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

virtual const char* mitk::ItkImageFileReader::GetFilePrefix ( ) const
virtual

Get the specified file prefix for the file(s) to load.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

mitk::ItkImageFileReader::mitkClassMacro ( ItkImageFileReader  ,
FileReader   
)
static Pointer mitk::ItkImageFileReader::New ( )
static

Method for creation through the object factory.

virtual void mitk::ItkImageFileReader::SetFileName ( const char *  aFileName)
virtual

Specify the file to load.

Either the FileName or FilePrefix plus FilePattern are used to read.

Implements mitk::FileReader.

virtual void mitk::ItkImageFileReader::SetFilePattern ( const char *  aFilePattern)
virtual

Specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

virtual void mitk::ItkImageFileReader::SetFilePrefix ( const char *  aFilePrefix)
virtual

Specify file prefix for the file(s) to load.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

Member Data Documentation

std::string mitk::ItkImageFileReader::m_FileName
protected

Definition at line 56 of file mitkItkImageFileReader.h.

Referenced by GenerateData().

std::string mitk::ItkImageFileReader::m_FilePattern
protected

Definition at line 60 of file mitkItkImageFileReader.h.

std::string mitk::ItkImageFileReader::m_FilePrefix
protected

Definition at line 58 of file mitkItkImageFileReader.h.


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