Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::ImageFileReader< TOutputImage, ConvertPixelTraits > Class Template Reference
[Input and Output Filters]

Data source that reads image data from a single file. More...

#include <itkImageFileReader.h>

Inheritance diagram for itk::ImageFileReader< TOutputImage, ConvertPixelTraits >:

Inheritance graph
[legend]
Collaboration diagram for itk::ImageFileReader< TOutputImage, ConvertPixelTraits >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ImageFileReader Self
typedef ImageSource< TOutputImage > Superclass
typedef SmartPointer< SelfPointer
typedef TOutputImage::SizeType SizeType
typedef TOutputImage::RegionType ImageRegionType
typedef TOutputImage::PixelType OutputImagePixelType

Public Member Functions

virtual const char * GetClassName () const
virtual void GenerateOutputInformation (void)
virtual void EnlargeOutputRequestedRegion (DataObject *output)
virtual void SetFileName (const char *_arg)
virtual const char * GetFileName () const
void SetImageIO (ImageIOBase *imageIO)
virtual ImageIOBaseGetImageIO ()

Static Public Member Functions

Pointer New ()

Protected Member Functions

 ImageFileReader ()
 ~ImageFileReader ()
void PrintSelf (std::ostream &os, Indent indent) const
void DoConvertBuffer (void *buffer, unsigned long numberOfPixels)
virtual void GenerateData ()

Protected Attributes

ImageIOBase::Pointer m_ImageIO
bool m_UserSpecifiedImageIO
std::string m_FileName

Detailed Description

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
class itk::ImageFileReader< TOutputImage, ConvertPixelTraits >

Data source that reads image data from a single file.

This source object is a general filter to read data from a variety of file formats. It works with a ImageIOBase subclass to actually do the reading of the data. Object factory machinery can be used to automatically create the ImageIOBase, or the ImageIOBase can be manually created and set. Note that this class reads data from a single file; if you wish to read data from a series of files use ImageSeriesReader.

TOutputImage is the type expected by the external users of the filter. If data stored in the file is stored in a different format then specified by TOutputImage, than this filter converts data between the file type and the external expected type. The ConvertTraits template argument is used to do the conversion.

A Pluggable factory pattern is used this allows different kinds of readers to be registered (even at run time) without having to modify the code in this class. Normally just setting the FileName with the appropriate suffix is enough to get the reader to instantiate the correct ImageIO and read the file properly. However, some files (like raw binary format) have no accepted suffix, so you will have to manually create the ImageIO instance of the write type.

See also:
ImageSeriesReader

ImageIOBase

Definition at line 89 of file itkImageFileReader.h.


Member Typedef Documentation

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef TOutputImage::RegionType itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::ImageRegionType
 

The region of the output image. Definition at line 107 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef TOutputImage::PixelType itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::OutputImagePixelType
 

The pixel type of the output image.

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 110 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef SmartPointer<Self> itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::Pointer
 

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 95 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef ImageFileReader itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::Self
 

Standard class typedefs.

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 93 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef TOutputImage::SizeType itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::SizeType
 

The size of the output image. Definition at line 104 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
typedef ImageSource<TOutputImage> itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::Superclass
 

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 94 of file itkImageFileReader.h.


Constructor & Destructor Documentation

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::ImageFileReader  )  [protected]
 

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::~ImageFileReader  )  [protected]
 


Member Function Documentation

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::DoConvertBuffer void *  buffer,
unsigned long  numberOfPixels
[protected]
 

Convert a block of pixels from one type to another.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::EnlargeOutputRequestedRegion DataObject output  )  [virtual]
 

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

Reimplemented from itk::ProcessObject.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateData  )  [protected, virtual]
 

Does the real work.

Reimplemented from itk::ImageSource< TOutputImage >.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateOutputInformation void   )  [virtual]
 

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

Reimplemented from itk::ProcessObject.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual const char* itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetClassName  )  const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::ImageSource< TOutputImage >.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual const char* itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetFileName  )  const [virtual]
 

Specify the file to read. This is forwarded to the IO instance.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual ImageIOBase* itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetImageIO  )  [virtual]
 

Set/Get the ImageIO helper class. Often this is created via the object factory mechanism that determines whether a particular ImageIO can read a certain file. This method provides a way to get the ImageIO instance that is created. Or you can directly specify the ImageIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
Pointer itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::New  )  [static]
 

Method for creation through the object factory.

Reimplemented from itk::Object.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::PrintSelf std::ostream &  os,
Indent  indent
const [protected, virtual]
 

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::ProcessObject.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
virtual void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::SetFileName const char *  _arg  )  [virtual]
 

Specify the file to read. This is forwarded to the IO instance.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
void itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::SetImageIO ImageIOBase imageIO  ) 
 

Set/Get the ImageIO helper class. Often this is created via the object factory mechanism that determines whether a particular ImageIO can read a certain file. This method provides a way to get the ImageIO instance that is created. Or you can directly specify the ImageIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).


Member Data Documentation

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
std::string itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_FileName [protected]
 

The file to be read. Definition at line 154 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
ImageIOBase::Pointer itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_ImageIO [protected]
 

Definition at line 150 of file itkImageFileReader.h.

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits< typename TOutputImage::PixelType>>
bool itk::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_UserSpecifiedImageIO [protected]
 

Definition at line 151 of file itkImageFileReader.h.


The documentation for this class was generated from the following file:
Generated at Sun Apr 1 03:14:47 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000