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

itk::ImageFileWriter< TInputImage > Class Template Reference
[Input and Output Filters]

Writes image data to a single file. More...

#include <itkImageFileWriter.h>

Inheritance diagram for itk::ImageFileWriter< TInputImage >:

Inheritance graph
[legend]
Collaboration diagram for itk::ImageFileWriter< TInputImage >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ImageFileWriter Self
typedef ProcessObject Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
typedef TInputImage InputImageType
typedef InputImageType::Pointer InputImagePointer
typedef InputImageType::RegionType InputImageRegionType
typedef InputImageType::PixelType InputImagePixelType

Public Member Functions

virtual const char * GetNameOfClass () const
virtual void Write (void)
virtual void Update ()
void SetInput (const InputImageType *input)
const InputImageTypeGetInput (void)
const InputImageTypeGetInput (unsigned int idx)
virtual void SetFileName (const char *_arg)
virtual const char * GetFileName () const
void SetImageIO (ImageIOBase *io)
virtual ImageIOBaseGetImageIO ()
void SetIORegion (const ImageIORegion &region)
virtual const ImageIORegionGetIORegion ()
virtual void SetUseCompression (bool _arg)
virtual const bool & GetUseCompression ()
virtual void UseCompressionOn ()
virtual void UseCompressionOff ()
virtual void SetUseInputMetaDataDictionary (bool _arg)
virtual const bool & GetUseInputMetaDataDictionary ()
virtual void UseInputMetaDataDictionaryOn ()
virtual void UseInputMetaDataDictionaryOff ()

Static Public Member Functions

Pointer New ()

Protected Member Functions

 ImageFileWriter ()
 ~ImageFileWriter ()
void PrintSelf (std::ostream &os, Indent indent) const
void GenerateData (void)

Detailed Description

template<class TInputImage>
class itk::ImageFileWriter< TInputImage >

Writes image data to a single file.

ImageFileWriter writes its input data to a single output file. ImageFileWriter interfaces with an ImageIO class to write out the data. If you wish to write data into a series of files (e.g., a slice per file) use ImageSeriesWriter.

A pluggable factory pattern is used that allows different kinds of writers to be registered (even at run time) without having to modify the code in this class. You can either manually instantiate the ImageIO object and associate it with the ImageFileWriter, or let the class figure it out from the extension. Normally just setting the filename with a suitable suffix (".png", ".jpg", etc) and setting the input to the writer is enough to get the writer to work properly.

See also:
ImageSeriesReader

ImageIOBase

Definition at line 77 of file itkImageFileWriter.h.


Member Typedef Documentation

template<class TInputImage>
typedef SmartPointer<const Self> itk::ImageFileWriter< TInputImage >::ConstPointer
 

Reimplemented from itk::ProcessObject.

Definition at line 84 of file itkImageFileWriter.h.

template<class TInputImage>
typedef InputImageType::PixelType itk::ImageFileWriter< TInputImage >::InputImagePixelType
 

Definition at line 96 of file itkImageFileWriter.h.

template<class TInputImage>
typedef InputImageType::Pointer itk::ImageFileWriter< TInputImage >::InputImagePointer
 

Definition at line 94 of file itkImageFileWriter.h.

template<class TInputImage>
typedef InputImageType::RegionType itk::ImageFileWriter< TInputImage >::InputImageRegionType
 

Definition at line 95 of file itkImageFileWriter.h.

template<class TInputImage>
typedef TInputImage itk::ImageFileWriter< TInputImage >::InputImageType
 

Some convenient typedefs.

Definition at line 93 of file itkImageFileWriter.h.

template<class TInputImage>
typedef SmartPointer<Self> itk::ImageFileWriter< TInputImage >::Pointer
 

Reimplemented from itk::ProcessObject.

Definition at line 83 of file itkImageFileWriter.h.

template<class TInputImage>
typedef ImageFileWriter itk::ImageFileWriter< TInputImage >::Self
 

Standard class typedefs.

Reimplemented from itk::ProcessObject.

Definition at line 81 of file itkImageFileWriter.h.

Referenced by itk::ImageFileWriter< TInputImage >::Update().

template<class TInputImage>
typedef ProcessObject itk::ImageFileWriter< TInputImage >::Superclass
 

Reimplemented from itk::ProcessObject.

Definition at line 82 of file itkImageFileWriter.h.


Constructor & Destructor Documentation

template<class TInputImage>
itk::ImageFileWriter< TInputImage >::ImageFileWriter  )  [protected]
 

template<class TInputImage>
itk::ImageFileWriter< TInputImage >::~ImageFileWriter  )  [protected]
 


Member Function Documentation

template<class TInputImage>
void itk::ImageFileWriter< TInputImage >::GenerateData void   )  [protected, virtual]
 

Does the real work.

Reimplemented from itk::ProcessObject.

template<class TInputImage>
virtual const char* itk::ImageFileWriter< TInputImage >::GetFileName  )  const [virtual]
 

Specify the name of the output file to write.

template<class TInputImage>
virtual ImageIOBase* itk::ImageFileWriter< TInputImage >::GetImageIO  )  [virtual]
 

Set/Get the ImageIO helper class. Usually this is created via the object factory mechanism that determines whether a particular ImageIO can write a certain file. This method provides a way to get the ImageIO instance that is created, or one can be manually set where the IO factory mechanism may not work (for example, raw image files or image files with non-standard filename suffix's. If the user specifies the ImageIO, we assume she makes the correct choice and will allow a file to be created regardless of the file extension. If the factory has set the ImageIO, the extension must be supported by the specified ImageIO.

template<class TInputImage>
const InputImageType* itk::ImageFileWriter< TInputImage >::GetInput unsigned int  idx  ) 
 

Set/Get the image input of this writer.

Reimplemented from itk::ProcessObject.

template<class TInputImage>
const InputImageType* itk::ImageFileWriter< TInputImage >::GetInput void   ) 
 

Set/Get the image input of this writer.

template<class TInputImage>
virtual const ImageIORegion& itk::ImageFileWriter< TInputImage >::GetIORegion  )  [virtual]
 

Specify the region to write. If left NULL, then the whole image is written.

template<class TInputImage>
virtual const char* itk::ImageFileWriter< TInputImage >::GetNameOfClass  )  const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::ProcessObject.

template<class TInputImage>
virtual const bool& itk::ImageFileWriter< TInputImage >::GetUseCompression  )  [virtual]
 

Set the compression On or Off

template<class TInputImage>
virtual const bool& itk::ImageFileWriter< TInputImage >::GetUseInputMetaDataDictionary  )  [virtual]
 

By default the MetaDataDictionary is taken from the input image and passed to the ImageIO. In some cases, however, a user may prefer to introduce her/his own MetaDataDictionary. This is often the case of the ImageSeriesWriter. This flag defined whether the MetaDataDictionary to use will be the one from the input image or the one already set in the ImageIO object.

template<class TInputImage>
Pointer itk::ImageFileWriter< TInputImage >::New  )  [static]
 

Method for creation through the object factory.

Reimplemented from itk::Object.

template<class TInputImage>
void itk::ImageFileWriter< TInputImage >::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 TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::SetFileName const char *  _arg  )  [virtual]
 

Specify the name of the output file to write.

template<class TInputImage>
void itk::ImageFileWriter< TInputImage >::SetImageIO ImageIOBase io  )  [inline]
 

Set/Get the ImageIO helper class. Usually this is created via the object factory mechanism that determines whether a particular ImageIO can write a certain file. This method provides a way to get the ImageIO instance that is created, or one can be manually set where the IO factory mechanism may not work (for example, raw image files or image files with non-standard filename suffix's. If the user specifies the ImageIO, we assume she makes the correct choice and will allow a file to be created regardless of the file extension. If the factory has set the ImageIO, the extension must be supported by the specified ImageIO.

Definition at line 119 of file itkImageFileWriter.h.

template<class TInputImage>
void itk::ImageFileWriter< TInputImage >::SetInput const InputImageType input  ) 
 

Set/Get the image input of this writer.

template<class TInputImage>
void itk::ImageFileWriter< TInputImage >::SetIORegion const ImageIORegion region  ) 
 

Specify the region to write. If left NULL, then the whole image is written.

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::SetUseCompression bool  _arg  )  [virtual]
 

Set the compression On or Off

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::SetUseInputMetaDataDictionary bool  _arg  )  [virtual]
 

By default the MetaDataDictionary is taken from the input image and passed to the ImageIO. In some cases, however, a user may prefer to introduce her/his own MetaDataDictionary. This is often the case of the ImageSeriesWriter. This flag defined whether the MetaDataDictionary to use will be the one from the input image or the one already set in the ImageIO object.

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::Update void   )  [inline, virtual]
 

Aliased to the Write() method to be consistent with the rest of the pipeline.

Reimplemented from itk::ProcessObject.

Definition at line 148 of file itkImageFileWriter.h.

References itk::ImageIOBase::Pointer, and itk::ImageFileWriter< TInputImage >::Self.

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::UseCompressionOff  )  [virtual]
 

Set the compression On or Off

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::UseCompressionOn  )  [virtual]
 

Set the compression On or Off

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::UseInputMetaDataDictionaryOff  )  [virtual]
 

By default the MetaDataDictionary is taken from the input image and passed to the ImageIO. In some cases, however, a user may prefer to introduce her/his own MetaDataDictionary. This is often the case of the ImageSeriesWriter. This flag defined whether the MetaDataDictionary to use will be the one from the input image or the one already set in the ImageIO object.

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::UseInputMetaDataDictionaryOn  )  [virtual]
 

By default the MetaDataDictionary is taken from the input image and passed to the ImageIO. In some cases, however, a user may prefer to introduce her/his own MetaDataDictionary. This is often the case of the ImageSeriesWriter. This flag defined whether the MetaDataDictionary to use will be the one from the input image or the one already set in the ImageIO object.

template<class TInputImage>
virtual void itk::ImageFileWriter< TInputImage >::Write void   )  [virtual]
 

A special version of the Update() method for writers. It invokes start and end events and handles releasing data. It eventually calls GenerateData() which does the actual writing. Note: the write method will write data specified by the IORegion. If not set, then then the whole image is written. Note that the region will be cropped to fit the input image's LargestPossibleRegion.


The documentation for this class was generated from the following file:
Generated at Thu May 25 01:13:48 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000