ITK  4.2.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
itk::ImageFileWriter< TInputImage > Class Template Reference

#include <itkImageFileWriter.h>

+ Inheritance diagram for itk::ImageFileWriter< TInputImage >:
+ Collaboration diagram for itk::ImageFileWriter< TInputImage >:

List of all members.

Public Types

typedef SmartPointer< const SelfConstPointer
typedef InputImageType::PixelType InputImagePixelType
typedef InputImageType::Pointer InputImagePointer
typedef InputImageType::RegionType InputImageRegionType
typedef TInputImage InputImageType
typedef SmartPointer< SelfPointer
typedef ImageFileWriter Self
typedef ProcessObject Superclass
- Public Types inherited from itk::ProcessObject
typedef
DataObject::DataObjectIdentifierType 
DataObjectIdentifierType
typedef DataObject::Pointer DataObjectPointer
typedef std::vector
< DataObjectPointer
DataObjectPointerArray
typedef
DataObjectPointerArray::size_type 
DataObjectPointerArraySizeType
typedef std::vector
< DataObjectIdentifierType
NameArray
- Public Types inherited from itk::Object
- Public Types inherited from itk::LightObject

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual ImageIOBaseGetImageIO ()
const InputImageTypeGetInput (void)
const InputImageTypeGetInput (unsigned int idx)
const ImageIORegionGetIORegion (void) const
virtual const char * GetNameOfClass () const
void SetInput (const InputImageType *input)
void SetIORegion (const ImageIORegion &region)
virtual void Update ()
virtual void UpdateLargestPossibleRegion ()
virtual void Write (void)
virtual void SetFileName (const char *_arg)
virtual const char * GetFileName () const
void SetImageIO (ImageIOBase *io)
virtual void SetNumberOfStreamDivisions (unsigned int _arg)
virtual const unsigned int & GetNumberOfStreamDivisions ()
virtual void SetUseCompression (bool _arg)
virtual const bool & GetUseCompression ()
virtual void UseCompressionOn ()
virtual void UseCompressionOff ()
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
virtual void AbortGenerateDataOn ()
virtual void EnlargeOutputRequestedRegion (DataObject *)
virtual const bool & GetAbortGenerateData ()
NameArray GetInputNames () const
MultiThreader * GetMultiThreader () const
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
DataObjectPointerArraySizeType GetNumberOfInputs () const
DataObjectPointerArraySizeType GetNumberOfOutputs () const
virtual
DataObjectPointerArraySizeType 
GetNumberOfValidRequiredInputs () const
NameArray GetOutputNames () const
virtual const float & GetProgress ()
NameArray GetRequiredInputNames () const
bool HasInput (const DataObjectIdentifierType &key) const
bool HasOutput (const DataObjectIdentifierType &key) const
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx)
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
virtual void PrepareOutputs ()
virtual void PropagateRequestedRegion (DataObject *output)
virtual void ResetPipeline ()
virtual void SetAbortGenerateData (bool _arg)
virtual void SetProgress (float _arg)
virtual void UpdateOutputData (DataObject *output)
virtual void UpdateOutputInformation ()
void UpdateProgress (float amount)
DataObjectPointerArray GetInputs ()
DataObjectPointerArray GetOutputs ()
DataObjectPointerArray GetIndexedInputs ()
DataObjectPointerArray GetIndexedOutputs ()
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
virtual void SetReleaseDataFlag (bool flag)
virtual bool GetReleaseDataFlag () const
void ReleaseDataFlagOn ()
void ReleaseDataFlagOff ()
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
virtual const bool & GetReleaseDataBeforeUpdateFlag ()
virtual void ReleaseDataBeforeUpdateFlagOn ()
virtual void ReleaseDataBeforeUpdateFlagOff ()
virtual void SetNumberOfThreads (ThreadIdType _arg)
virtual const ThreadIdTypeGetNumberOfThreads ()
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
unsigned long AddObserver (const EventObject &event, Command *) const
virtual void DebugOff () const
virtual void DebugOn () const
CommandGetCommand (unsigned long tag)
bool GetDebug () const
MetaDataDictionaryGetMetaDataDictionary (void)
const MetaDataDictionaryGetMetaDataDictionary (void) const
virtual unsigned long GetMTime () const
virtual const TimeStampGetTimeStamp () const
bool HasObserver (const EventObject &event) const
void InvokeEvent (const EventObject &)
void InvokeEvent (const EventObject &) const
virtual void Modified () const
virtual void Register () const
void RemoveAllObservers ()
void RemoveObserver (unsigned long tag)
void SetDebug (bool debugFlag) const
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
virtual void SetReferenceCount (int)
virtual void UnRegister () const
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
virtual int GetReferenceCount () const
 itkCloneMacro (Self)
void Print (std::ostream &os, Indent indent=0) const

Static Public Member Functions

static Pointer New ()

Protected Member Functions

void GenerateData (void)
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
virtual void AddOutput (DataObject *output)
bool AddRequiredInputName (const DataObjectIdentifierType &)
virtual void CacheInputReleaseDataFlags ()
virtual void GenerateInputRequestedRegion ()
virtual void GenerateOutputInformation ()
virtual void GenerateOutputRequestedRegion (DataObject *output)
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredInputs ()
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredOutputs ()
bool IsIndexedName (const DataObjectIdentifierType &) const
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 itkLegacyMacro (virtual void RemoveInput(DataObject *input))
 itkLegacyMacro (virtual void RemoveOutput(DataObject *output))
 itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num))
 itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num))
DataObjectPointerArraySizeType MakeIndexFromName (const DataObjectIdentifierType &) const
DataObjectIdentifierType MakeNameFromIndex (DataObjectPointerArraySizeType) const
 ProcessObject ()
virtual void PropagateResetPipeline ()
virtual void ReleaseInputs ()
virtual void RemoveInput (const DataObjectIdentifierType &key)
virtual void RemoveInput (DataObjectPointerArraySizeType)
virtual void RemoveOutput (const DataObjectIdentifierType &key)
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
virtual void RestoreInputReleaseDataFlags ()
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
virtual void SetPrimaryInput (DataObject *input)
virtual void SetPrimaryOutput (DataObject *output)
void SetRequiredInputNames (const NameArray &)
virtual void VerifyInputInformation ()
virtual void VerifyPreconditions ()
 ~ProcessObject ()
DataObjectGetInput (const DataObjectIdentifierType &key)
const DataObjectGetInput (const DataObjectIdentifierType &key) const
DataObjectGetInput (DataObjectPointerArraySizeType)
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
DataObjectGetPrimaryInput ()
const DataObjectGetPrimaryInput () const
DataObjectGetOutput (const DataObjectIdentifierType &key)
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
DataObjectGetPrimaryOutput ()
const DataObjectGetPrimaryOutput () const
virtual void PushBackInput (const DataObject *input)
virtual void PopBackInput ()
virtual void PushFrontInput (const DataObject *input)
virtual void PopFrontInput ()
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void SetTimeStamp (const TimeStamp &time)
virtual ~Object ()
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 LightObject ()
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const
virtual ~LightObject ()

Private Member Functions

 ImageFileWriter (const Self &)
void operator= (const Self &)

Private Attributes

bool m_FactorySpecifiedImageIO
std::string m_FileName
ImageIOBase::Pointer m_ImageIO
unsigned int m_NumberOfStreamDivisions
ImageIORegion m_PasteIORegion
bool m_UseCompression
bool m_UseInputMetaDataDictionary
bool m_UserSpecifiedImageIO
bool m_UserSpecifiedIORegion
virtual void SetUseInputMetaDataDictionary (bool _arg)
virtual const bool & GetUseInputMetaDataDictionary ()
virtual void UseInputMetaDataDictionaryOn ()
virtual void UseInputMetaDataDictionaryOff ()
 ImageFileWriter ()
 ~ImageFileWriter ()
void PrintSelf (std::ostream &os, Indent indent) const

Additional Inherited Members

- Protected Attributes inherited from itk::ProcessObject
bool m_Updating
TimeStamp m_OutputInformationMTime

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
Wiki Examples:
Examples:
Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, ImageLinearIteratorWithIndex.cxx, ImageRegionIterator.cxx, ImageRegionIteratorWithIndex.cxx, and itkVectorImageTest.cxx.

Definition at line 85 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 92 of file itkImageFileWriter.h.

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

Definition at line 104 of file itkImageFileWriter.h.

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

Definition at line 102 of file itkImageFileWriter.h.

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

Definition at line 103 of file itkImageFileWriter.h.

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

Some convenient typedefs.

Definition at line 98 of file itkImageFileWriter.h.

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

Reimplemented from itk::ProcessObject.

Definition at line 91 of file itkImageFileWriter.h.

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

Standard class typedefs.

Reimplemented from itk::ProcessObject.

Definition at line 89 of file itkImageFileWriter.h.

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

Reimplemented from itk::ProcessObject.

Definition at line 90 of file itkImageFileWriter.h.


Constructor & Destructor Documentation

template<class TInputImage >
itk::ImageFileWriter< TInputImage >::ImageFileWriter ( )
protected

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 >
itk::ImageFileWriter< TInputImage >::~ImageFileWriter ( )
protected

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 >
itk::ImageFileWriter< TInputImage >::ImageFileWriter ( const Self )
private

Member Function Documentation

template<class TInputImage >
virtual::itk::LightObject::Pointer itk::ImageFileWriter< TInputImage >::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

template<class TInputImage >
void itk::ImageFileWriter< TInputImage >::GenerateData ( void  )
protectedvirtual

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
template<class TInputImage >
const InputImageType* itk::ImageFileWriter< TInputImage >::GetInput ( void  )
template<class TInputImage >
const InputImageType* itk::ImageFileWriter< TInputImage >::GetInput ( unsigned int  idx)
template<class TInputImage >
const ImageIORegion& itk::ImageFileWriter< TInputImage >::GetIORegion ( void  ) const
inline

Definition at line 155 of file itkImageFileWriter.h.

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 unsigned int& itk::ImageFileWriter< TInputImage >::GetNumberOfStreamDivisions ( )
virtual

Set/Get the number of pieces to divide the input. The upstream pipeline will try to be executed this many times.

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 >
static Pointer itk::ImageFileWriter< TInputImage >::New ( )
static

Method for creation through the object factory.

Reimplemented from itk::Object.

template<class TInputImage >
void itk::ImageFileWriter< TInputImage >::operator= ( const Self )
private

Time when GenerateOutputInformation was last called.

Reimplemented from itk::ProcessObject.

template<class TInputImage >
void itk::ImageFileWriter< TInputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

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.

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 129 of file itkImageFileWriter.h.

template<class TInputImage >
void itk::ImageFileWriter< TInputImage >::SetInput ( const InputImageType input)
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 >::SetNumberOfStreamDivisions ( unsigned int  _arg)
virtual

Set/Get the number of pieces to divide the input. The upstream pipeline will try to be executed this many times.

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  )
inlinevirtual

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

Reimplemented from itk::ProcessObject.

Definition at line 168 of file itkImageFileWriter.h.

template<class TInputImage >
virtual void itk::ImageFileWriter< TInputImage >::UpdateLargestPossibleRegion ( )
inlinevirtual

Writes the entire image to file.

Updates the pipeline, streaming it the NumberOfStreamDivisions times. Existing PasteIORegion is reset.

Reimplemented from itk::ProcessObject.

Definition at line 178 of file itkImageFileWriter.h.

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.


Member Data Documentation

template<class TInputImage >
bool itk::ImageFileWriter< TInputImage >::m_FactorySpecifiedImageIO
private

Definition at line 223 of file itkImageFileWriter.h.

template<class TInputImage >
std::string itk::ImageFileWriter< TInputImage >::m_FileName
private

Definition at line 213 of file itkImageFileWriter.h.

template<class TInputImage >
ImageIOBase::Pointer itk::ImageFileWriter< TInputImage >::m_ImageIO
private

Definition at line 215 of file itkImageFileWriter.h.

template<class TInputImage >
unsigned int itk::ImageFileWriter< TInputImage >::m_NumberOfStreamDivisions
private

Definition at line 220 of file itkImageFileWriter.h.

template<class TInputImage >
ImageIORegion itk::ImageFileWriter< TInputImage >::m_PasteIORegion
private

Definition at line 219 of file itkImageFileWriter.h.

template<class TInputImage >
bool itk::ImageFileWriter< TInputImage >::m_UseCompression
private

Definition at line 225 of file itkImageFileWriter.h.

template<class TInputImage >
bool itk::ImageFileWriter< TInputImage >::m_UseInputMetaDataDictionary
private

Definition at line 226 of file itkImageFileWriter.h.

template<class TInputImage >
bool itk::ImageFileWriter< TInputImage >::m_UserSpecifiedImageIO
private

Definition at line 216 of file itkImageFileWriter.h.

template<class TInputImage >
bool itk::ImageFileWriter< TInputImage >::m_UserSpecifiedIORegion
private

Definition at line 221 of file itkImageFileWriter.h.


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