ITK
6.0.0
Insight Toolkit
|
#include <itkImageIOBase.h>
Abstract superclass defines image IO interface.
ImageIOBase is a class that reads and/or writes image data of a particular format (such as PNG or raw binary). The ImageIOBase encapsulates both the reading and writing of data. The ImageIOBase is used by the ImageFileReader class (to read data) and the ImageFileWriter (to write data) into a single file. The ImageSeriesReader and ImageSeriesWriter classes are used to read and write data (in conjunction with ImageIOBase) when the data is represented by a series of files. Normally the user does not directly manipulate this class other than to instantiate it, set the FileName, and assign it to a ImageFileReader/ImageFileWriter or ImageSeriesReader/ImageSeriesWriter.
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.
Definition at line 77 of file itkImageIOBase.h.
Classes | |
struct | MapPixelType |
class | UnknownType |
Public Member Functions | |
virtual bool | CanReadFile (const char *)=0 |
virtual bool | CanStreamRead () |
virtual bool | CanStreamWrite () |
virtual bool | CanWriteFile (const char *)=0 |
virtual ImageIORegion | GenerateStreamableReadRegionFromRequestedRegion (const ImageIORegion &requested) const |
virtual unsigned int | GetActualNumberOfSplitsForWriting (unsigned int numberOfRequestedSplits, const ImageIORegion &pasteRegion, const ImageIORegion &largestPossibleRegion) |
std::string | GetByteOrderAsString (IOByteOrderEnum) const |
virtual unsigned int | GetComponentSize () const |
virtual IOComponentEnum | GetComponentType () const |
virtual const std::type_info & | GetComponentTypeInfo () const |
virtual int | GetCompressionLevel () const |
virtual const std::string & | GetCompressor () const |
virtual std::vector< double > | GetDefaultDirection (unsigned int k) const |
virtual SizeValueType | GetDimensions (unsigned int i) const |
virtual std::vector< double > | GetDirection (unsigned int i) const |
std::string | GetFileTypeAsString (IOFileEnum) const |
SizeType | GetImageSizeInBytes () const |
SizeType | GetImageSizeInComponents () const |
SizeType | GetImageSizeInPixels () const |
virtual bool | GetIsReadAsScalarPlusPalette () const |
const char * | GetNameOfClass () const override |
virtual unsigned int | GetNumberOfDimensions () const |
virtual double | GetOrigin (unsigned int i) const |
virtual SizeType | GetPixelStride () const |
virtual double | GetSpacing (unsigned int i) const |
virtual ImageIORegion | GetSplitRegionForWriting (unsigned int ithPiece, unsigned int numberOfActualSplits, const ImageIORegion &pasteRegion, const ImageIORegion &largestPossibleRegion) |
const ArrayOfExtensionsType & | GetSupportedReadExtensions () const |
const ArrayOfExtensionsType & | GetSupportedWriteExtensions () const |
virtual void | Read (void *buffer)=0 |
virtual void | ReadImageInformation ()=0 |
void | SetByteOrderToLittleEndian () |
virtual void | SetComponentType (const IOComponentEnum _arg) |
virtual void | SetCompressionLevel (int _arg) |
virtual void | SetCompressor (std::string _c) |
virtual void | SetDirection (unsigned int i, const std::vector< double > &direction) |
virtual void | SetDirection (unsigned int i, const vnl_vector< double > &direction) |
void | SetFileTypeToBinary () |
void | SetNumberOfDimensions (unsigned int) |
virtual void | SetOrigin (unsigned int i, double origin) |
virtual void | SetSpacing (unsigned int i, double spacing) |
template<typename TPixel > | |
void | SetTypeInfo (const TPixel *) |
virtual bool | SupportsDimension (unsigned long dim) |
virtual void | Write (const void *buffer)=0 |
virtual void | WriteImageInformation ()=0 |
virtual void | SetFileName (const char *_arg) |
virtual const char * | GetFileName () const |
virtual void | SetDimensions (unsigned int i, SizeValueType dim) |
virtual void | SetIORegion (ImageIORegion _arg) |
virtual const ImageIORegion & | GetIORegion () const |
virtual void | SetPixelType (const itk::CommonEnums::IOPixel _arg) |
virtual itk::CommonEnums::IOPixel | GetPixelType () const |
virtual void | SetNumberOfComponents (unsigned int _arg) |
virtual const unsigned int & | GetNumberOfComponents () const |
virtual void | SetUseCompression (bool _arg) |
virtual bool | GetUseCompression () const |
virtual void | UseCompressionOn () |
virtual void | SetUseStreamedReading (bool _arg) |
virtual bool | GetUseStreamedReading () const |
virtual void | UseStreamedReadingOn () |
virtual void | SetUseStreamedWriting (bool _arg) |
virtual bool | GetUseStreamedWriting () const |
virtual void | UseStreamedWritingOn () |
virtual void | SetExpandRGBPalette (bool _arg) |
virtual bool | GetExpandRGBPalette () const |
virtual void | ExpandRGBPaletteOn () |
virtual void | SetWritePalette (bool _arg) |
virtual bool | GetWritePalette () const |
virtual void | WritePaletteOn () |
virtual void | SetFileType (const IOFileEnum _arg) |
virtual IOFileEnum | GetFileType () const |
void | SetFileTypeToASCII () |
virtual void | SetByteOrder (const IOByteOrderEnum _arg) |
virtual IOByteOrderEnum | GetByteOrder () const |
void | SetByteOrderToBigEndian () |
template<typename TPixel > | |
void | SetPixelTypeInfo (const TPixel *) |
template<typename TPixel > | |
void | SetPixelTypeInfo (const RGBPixel< TPixel > *) |
template<typename TPixel > | |
void | SetPixelTypeInfo (const RGBAPixel< TPixel > *) |
template<unsigned int VLength> | |
void | SetPixelTypeInfo (const Offset< VLength > *) |
template<typename TPixel , unsigned int VLength> | |
void | SetPixelTypeInfo (const Vector< TPixel, VLength > *) |
template<typename TCoordRep , unsigned int VPointDimension> | |
void | SetPixelTypeInfo (const Point< TCoordRep, VPointDimension > *) |
template<typename TPixel , unsigned int VLength> | |
void | SetPixelTypeInfo (const CovariantVector< TPixel, VLength > *) |
template<typename TPixel , unsigned int VLength> | |
void | SetPixelTypeInfo (const SymmetricSecondRankTensor< TPixel, VLength > *) |
template<typename TPixel > | |
void | SetPixelTypeInfo (const DiffusionTensor3D< TPixel > *) |
template<typename TPixel > | |
void | SetPixelTypeInfo (const std::complex< TPixel > *) |
template<typename TPixel , unsigned int VLength> | |
void | SetPixelTypeInfo (const FixedArray< TPixel, VLength > *) |
template<typename TPixel > | |
void | SetPixelTypeInfo (const VariableLengthVector< TPixel > *) |
template<typename TValue > | |
void | SetPixelTypeInfo (const Array< TValue > *) |
template<typename TPixel , unsigned int VLength> | |
void | SetPixelTypeInfo (const Matrix< TPixel, VLength, VLength > *) |
template<typename TValue > | |
void | SetPixelTypeInfo (const VariableSizeMatrix< TValue > *) |
Public Member Functions inherited from itk::LightProcessObject | |
virtual void | AbortGenerateDataOn () |
virtual const bool & | GetAbortGenerateData () const |
virtual void | SetAbortGenerateData (bool _arg) |
virtual void | UpdateOutputData () |
void | UpdateProgress (float amount) |
virtual void | SetProgress (float _arg) |
virtual const float & | GetProgress () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static std::string | GetComponentTypeAsString (IOComponentEnum) |
static IOComponentEnum | GetComponentTypeFromString (const std::string &typeString) |
static std::string | GetPixelTypeAsString (IOPixelEnum) |
static IOPixelEnum | GetPixelTypeFromString (const std::string &pixelString) |
Static Public Member Functions inherited from itk::LightProcessObject | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
void | AddSupportedReadExtension (const char *extension) |
void | AddSupportedWriteExtension (const char *extension) |
void | ComputeStrides () |
virtual unsigned int | GetActualNumberOfSplitsForWritingCanStreamWrite (unsigned int numberOfRequestedSplits, const ImageIORegion &pasteRegion) const |
SizeType | GetComponentStride () const |
virtual const ImageRegionSplitterBase * | GetImageRegionSplitter () const |
virtual unsigned int | GetPixelSize () const |
SizeType | GetRowStride () const |
SizeType | GetSliceStride () const |
virtual ImageIORegion | GetSplitRegionForWritingCanStreamWrite (unsigned int ithPiece, unsigned int numberOfActualSplits, const ImageIORegion &pasteRegion) const |
ImageIOBase () | |
virtual void | InternalSetCompressor (const std::string &_compressor) |
virtual void | OpenFileForReading (std::ifstream &inputStream, const std::string &filename, bool ascii=false) |
virtual void | OpenFileForWriting (std::ofstream &outputStream, const std::string &filename, bool truncate=true, bool ascii=false) |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | ReadBufferAsASCII (std::istream &is, void *buffer, IOComponentEnum ctype, SizeType numComp) |
bool | ReadBufferAsBinary (std::istream &is, void *buffer, SizeType num) |
virtual void | Reset (const bool freeDynamic=true) |
void | Resize (const unsigned int numDimensions, const unsigned int *dimensions) |
void | SetSupportedReadExtensions (const ArrayOfExtensionsType &) |
void | SetSupportedWriteExtensions (const ArrayOfExtensionsType &) |
virtual void | WriteBufferAsASCII (std::ostream &os, const void *buffer, IOComponentEnum ctype, SizeType numComp) |
~ImageIOBase () override | |
virtual bool | HasSupportedReadExtension (const char *fileName, bool ignoreCase=true) |
virtual bool | HasSupportedWriteExtension (const char *fileName, bool ignoreCase=true) |
virtual void | SetMaximumCompressionLevel (int) |
virtual int | GetMaximumCompressionLevel () const |
Protected Member Functions inherited from itk::LightProcessObject | |
virtual void | GenerateData () |
LightProcessObject () | |
~LightProcessObject () override | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
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 | |
bool | HasSupportedExtension (const char *, const ArrayOfExtensionsType &, bool ignoreCase=true) |
Private Attributes | |
ArrayOfExtensionsType | m_SupportedReadExtensions {} |
ArrayOfExtensionsType | m_SupportedWriteExtensions {} |
using itk::ImageIOBase::ArrayOfExtensionsType = std::vector<std::string> |
Type for the list of strings to be used for extensions.
Definition at line 545 of file itkImageIOBase.h.
Type for representing size of bytes, and or positions along a memory buffer
Definition at line 399 of file itkImageIOBase.h.
using itk::ImageIOBase::ConstPointer = SmartPointer<const Self> |
Definition at line 86 of file itkImageIOBase.h.
Types for managing image size and image index components.
Definition at line 97 of file itkImageIOBase.h.
Definition at line 153 of file itkImageIOBase.h.
Definition at line 126 of file itkImageIOBase.h.
Definition at line 145 of file itkImageIOBase.h.
using itk::ImageIOBase::Pointer = SmartPointer<Self> |
Definition at line 85 of file itkImageIOBase.h.
using itk::ImageIOBase::Self = ImageIOBase |
Standard class type aliases.
Definition at line 83 of file itkImageIOBase.h.
using itk::ImageIOBase::SizeType = itk::intmax_t |
Type for representing size of bytes, and or positions along a file
Definition at line 395 of file itkImageIOBase.h.
Definition at line 98 of file itkImageIOBase.h.
Definition at line 84 of file itkImageIOBase.h.
|
protected |
|
overrideprotected |
|
protected |
Insert an extension to the list of supported extensions for reading.
|
protected |
Insert an extension to the list of supported extensions for writing.
|
pure virtual |
Determine the file type. Returns true if this ImageIO can read the file specified.
Implemented in itk::NiftiImageIO, itk::HDF5ImageIO, itk::Bruker2dseqImageIO, itk::IPLCommonImageIO, itk::GE4ImageIO, itk::GE5ImageIO, itk::SiemensVisionImageIO, itk::GEAdwImageIO, itk::GDCMImageIO, itk::JPEG2000ImageIO, itk::DCMTKImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::MINCImageIO, itk::FileListVideoIO, itk::JPEGImageIO, itk::VTKImageIO, itk::MRCImageIO, itk::StimulateImageIO, itk::VXLVideoIO, itk::PNGImageIO, itk::MetaImageIO, itk::BMPImageIO, itk::TIFFImageIO, itk::BioRadImageIO, itk::NrrdImageIO, itk::VoxBoCUBImageIO, itk::LSMImageIO, itk::GiplImageIO, and itk::OpenCVVideoIO.
|
inlinevirtual |
Determine if the ImageIO can stream reading from the current settings. Default is false. If this is queried after the header of the file has been read then it will indicate if that file can be streamed
Reimplemented in itk::MetaImageIO, itk::VTKImageIO, and itk::StreamingImageIOBase.
Definition at line 442 of file itkImageIOBase.h.
|
inlinevirtual |
Determine if the ImageIO can stream write from the current settings.
There are two types of non exclusive streaming: pasting subregions, and iterative
Reimplemented in itk::JPEG2000ImageIO, itk::MetaImageIO, itk::VTKImageIO, and itk::StreamingImageIOBase.
Definition at line 470 of file itkImageIOBase.h.
|
pure virtual |
Determine the file type. Returns true if this ImageIO can read the file specified.
Implemented in itk::HDF5ImageIO, itk::NiftiImageIO, itk::IPLCommonImageIO, itk::FileListVideoIO, itk::GDCMImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::JPEG2000ImageIO, itk::VXLVideoIO, itk::DCMTKImageIO, itk::MINCImageIO, itk::Bruker2dseqImageIO, itk::JPEGImageIO, itk::MRCImageIO, itk::VTKImageIO, itk::PNGImageIO, itk::StimulateImageIO, itk::MetaImageIO, itk::TIFFImageIO, itk::BMPImageIO, itk::BioRadImageIO, itk::VoxBoCUBImageIO, itk::NrrdImageIO, itk::LSMImageIO, itk::GiplImageIO, and itk::OpenCVVideoIO.
|
protected |
Calculates the different strides (distance from one thing to the next). Upon return, strides[0] = bytes to get to the next component of a pixel, strides[1] = bytes to get to the next pixel in x direction, strides[2] = bytes to get to the next row in y direction, strides[3] = bytes to get to the next slice in z direction, etc.
|
virtual |
Set/Get a boolean to perform RGB palette expansion. If true, palette image is read as RGB, if false, palette image is read as Scalar+Palette. A RGB image is always read as RGB.
|
virtual |
Method for supporting streaming. Given a requested region, determine what could be the region that we can read from the file. This is called the streamable region, which will be equal or smaller than the LargestPossibleRegion (unless it was dimensionally clipped) and greater or equal to the RequestedRegion
the resulting IORegion may be a greater dimensions the requested IORegion, if the derived class is unable to read the requested region. For example if the file has a size of [ 10, 10, 10] but the requested region is [10, 10] the return may be 3 dimensions.
Reimplemented in itk::NiftiImageIO, itk::JPEG2000ImageIO, itk::MetaImageIO, and itk::StreamingImageIOBase.
|
virtual |
Before this method is called all the configuration will be done, that is Streaming/PasteRegion/Compression/Filename etc If pasting is being used the number of requested splits is for that region not the largest. The derived ImageIO class should verify that the file is capable of being written with this configuration. If pasted is enabled and is not support or does not work with the file, then an exception should be thrown.
The default implementation depends on CanStreamWrite. If false then 1 is returned (unless pasting is indicated), so that the whole file will be updated in one region. If true then its assumed that any arbitrary region can be written to any file. So the users request will be respected. If a derived class has more restrictive conditions then they should be checked
Reimplemented in itk::MetaImageIO, and itk::StreamingImageIOBase.
|
protectedvirtual |
an implementation of ImageRegionSplitter:GetNumberOfSplits
|
virtual |
These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.
std::string itk::ImageIOBase::GetByteOrderAsString | ( | IOByteOrderEnum | ) | const |
Convenience method returns the IOByteOrderEnum as a string. This can be used for writing output files.
|
virtual |
Compute the size (in bytes) of the components of a pixel. For example, and RGB pixel of unsigned char would have a component size of 1 byte. This method can be invoked only after the component type is set.
Reimplemented in itk::IPLCommonImageIO.
|
protected |
Convenient method for accessing number of bytes to get to the next pixel component. Returns m_Strides[0].
|
virtual |
|
static |
Convenience method returns the IOComponentEnum as a string. This can be used for writing output files.
|
static |
Convenience method returns the IOComponentEnum corresponding to a string.
|
virtual |
get the type_info for the current pixel component type. This function is DEPRECATED and only provided for backwards compatibility. There is no use for this method that can't be satisfied by calling GetComponentType.
|
virtual |
|
virtual |
|
virtual |
Return the directions to be assigned by default to recipient images whose dimension is smaller than the image dimension in file.
|
inlinevirtual |
Definition at line 178 of file itkImageIOBase.h.
|
inlinevirtual |
Reimplemented in itk::FileListVideoIO, and itk::OpenCVVideoIO.
Definition at line 214 of file itkImageIOBase.h.
|
virtual |
Set/Get a boolean to perform RGB palette expansion. If true, palette image is read as RGB, if false, palette image is read as Scalar+Palette. A RGB image is always read as RGB.
|
virtual |
Set/Get the name of the file to be read.
|
virtual |
These methods control whether the file is written binary or ASCII. Many file formats (i.e., subclasses) ignore this flag.
std::string itk::ImageIOBase::GetFileTypeAsString | ( | IOFileEnum | ) | const |
Convenience method returns the IOFileEnum as a string. This can be used for writing output files.
|
protectedvirtual |
SizeType itk::ImageIOBase::GetImageSizeInBytes | ( | ) | const |
Return the number of bytes in the image.
SizeType itk::ImageIOBase::GetImageSizeInComponents | ( | ) | const |
Return the number of pixels times the number of components in the image.
SizeType itk::ImageIOBase::GetImageSizeInPixels | ( | ) | const |
Return the number of pixels in the image.
|
virtual |
Specify the region of the image data to either read or write. The IORegion specifies the part of the image to read or write. Regions are defined with an index and a size vector. These vectors define the start (lower-left corner) and length of the region within the image. Make sure that the IORegion lies within the image.
|
virtual |
Determine whether a palletized image file has been read as a scalar image plus a color palette. ExpandRGBPalette must be set to true, and the file must be a palette image file supported for palette reading.
|
protectedvirtual |
Set/Get enforced maximum compression level value to limit range
|
overridevirtual |
Reimplemented from itk::LightProcessObject.
Reimplemented in itk::GDCMImageIO, itk::NiftiImageIO, itk::HDF5ImageIO, itk::Bruker2dseqImageIO, itk::VideoIOBase, itk::MINCImageIO, itk::DCMTKImageIO, itk::IPLCommonImageIO, itk::StimulateImageIO, itk::GE4ImageIO, itk::MRCImageIO, itk::OpenCVVideoIO, itk::TIFFImageIO, itk::VTKImageIO, itk::BioRadImageIO, itk::GE5ImageIO, itk::SiemensVisionImageIO, itk::GEAdwImageIO, itk::VoxBoCUBImageIO, itk::VXLVideoIO, itk::StreamingImageIOBase, itk::RawImageIO< TPixel, VImageDimension >, itk::LSMImageIO, itk::NrrdImageIO, itk::MetaImageIO, itk::BMPImageIO, itk::PNGImageIO, itk::GiplImageIO, itk::FileListVideoIO, and itk::JPEGImageIO.
|
virtual |
Set/Get the number of components per pixel in the image. This may be set by the reading process. For SCALAR pixel types, NumberOfComponents will be 1. For other pixel types, NumberOfComponents will be greater than or equal to one.
|
virtual |
|
inlinevirtual |
Reimplemented in itk::OpenCVVideoIO, and itk::FileListVideoIO.
Definition at line 189 of file itkImageIOBase.h.
|
protectedvirtual |
Compute the size (in bytes) of the pixel. For example, and RGB pixel of unsigned char would have size 3 bytes.
|
virtual |
Convenient method for accessing the number of bytes to get to the next pixel. Returns m_Strides[1];
Please note that this methods depends the private methods ComputeStrides being called, otherwise this is the incorrect value.
|
virtual |
Set/Get the type of the pixel. The PixelTypes provides context to the IO mechanisms for data conversions. PixelTypes can be SCALAR, RGB, RGBA, VECTOR, COVARIANTVECTOR, POINT, INDEX. If the PIXELTYPE is SCALAR, then the NumberOfComponents should be 1. Any other of PIXELTYPE will have more than one component.
|
static |
Convenience method returns the IOPixelEnum as a string. This can be used for writing output files.
|
static |
Convenience method returns the IOPixelEnum corresponding to a string.
|
protected |
Convenient method for accessing the number of bytes to get to the next row. Returns m_Strides[2].
|
protected |
Convenient method for accessing the number of bytes to get to the next slice. Returns m_Strides[3].
|
inlinevirtual |
Reimplemented in itk::OpenCVVideoIO, and itk::FileListVideoIO.
Definition at line 200 of file itkImageIOBase.h.
|
virtual |
returns the ith IORegion
numberOfActualSplits should be the value returned from GetActualNumberOfSplitsForWriting with the same parameters
Derived classes should overload this method to return a compatible region
Reimplemented in itk::MetaImageIO.
|
protectedvirtual |
an implementation of ImageRegionSplitter:GetSplit
const ArrayOfExtensionsType& itk::ImageIOBase::GetSupportedReadExtensions | ( | ) | const |
This method returns an array with the list of filename extensions supported for reading by this ImageIO class. This is intended to facilitate GUI and application level integration.
const ArrayOfExtensionsType& itk::ImageIOBase::GetSupportedWriteExtensions | ( | ) | const |
This method returns an array with the list of filename extensions supported for writing by this ImageIO class. This is intended to facilitate GUI and application level integration.
|
virtual |
Set/Get a boolean to use the compression or not.
|
virtual |
Set/Get a boolean to use streaming while reading or not.
|
virtual |
Set/Get a boolean to use streaming while writing or not.
|
virtual |
Set/Get a boolean to include a color palette while writing the image file. Applies only for scalar Pixels
|
private |
|
protectedvirtual |
Check fileName as an extensions contained in the supported extension list. If ignoreCase is true, the case of the characters is ignored.
|
protectedvirtual |
Check fileName as an extensions contained in the supported extension list. If ignoreCase is true, the case of the characters is ignored.
|
protectedvirtual |
Called when the compressor changes value. The compressor string is converted to uppercase for case insensitive comparisons.
Reimplemented in itk::GDCMImageIO, itk::TIFFImageIO, and itk::NrrdImageIO.
|
protectedvirtual |
Opens a file for reading and random access.
[out] | inputStream | is an istream presumed to be opened for reading |
[in] | filename | is the name of the file |
[in] | ascii | optional (default is false); if true than the file will be opened in ASCII mode, which generally only applies to Windows |
The stream is closed if it's already opened. If an error is encountered than an exception will be thrown.
|
protectedvirtual |
Opens a file for writing and random access.
[out] | outputStream | is an ostream presumed to be opened for writing |
[in] | filename | is the name of the file |
[in] | truncate | optional (default is true); if true than the file's existing content is truncated, if false than the file is opened for reading and writing with existing content intact |
[in] | ascii | optional (default is false); if true than the file will be opened in ASCII mode, which generally only applies to Windows |
The stream is closed if it's already opened. If an error is encountered than an exception will be thrown.
|
overrideprotectedvirtual |
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::LightProcessObject.
Reimplemented in itk::GDCMImageIO, itk::NiftiImageIO, itk::TIFFImageIO, itk::MetaImageIO, itk::FileListVideoIO, itk::OpenCVVideoIO, itk::JPEG2000ImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::VideoIOBase, itk::VXLVideoIO, itk::DCMTKImageIO, itk::HDF5ImageIO, itk::IPLCommonImageIO, itk::Bruker2dseqImageIO, itk::StimulateImageIO, itk::MINCImageIO, itk::VTKImageIO, itk::JPEGImageIO, itk::MRCImageIO, itk::PNGImageIO, itk::BioRadImageIO, itk::BMPImageIO, itk::LSMImageIO, itk::VoxBoCUBImageIO, itk::NrrdImageIO, itk::StreamingImageIOBase, and itk::GiplImageIO.
|
pure virtual |
Reads the data from disk into the memory buffer provided.
Implemented in itk::GDCMImageIO, itk::NiftiImageIO, itk::JPEG2000ImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::DCMTKImageIO, itk::HDF5ImageIO, itk::MINCImageIO, itk::Bruker2dseqImageIO, itk::FileListVideoIO, itk::IPLCommonImageIO, itk::VXLVideoIO, itk::JPEGImageIO, itk::VTKImageIO, itk::MRCImageIO, itk::StimulateImageIO, itk::PNGImageIO, itk::MetaImageIO, itk::BMPImageIO, itk::TIFFImageIO, itk::BioRadImageIO, itk::NrrdImageIO, itk::VoxBoCUBImageIO, itk::LSMImageIO, itk::GiplImageIO, and itk::OpenCVVideoIO.
|
protectedvirtual |
Convenient method to read a buffer as ASCII text.
Reimplemented in itk::VTKImageIO.
|
protected |
Convenient method to read a buffer as binary. Return true on success.
|
pure virtual |
Read the spacing and dimensions of the image. Assumes SetFileName has been called with a valid file name.
Implemented in itk::NiftiImageIO, itk::GDCMImageIO, itk::JPEG2000ImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::DCMTKImageIO, itk::HDF5ImageIO, itk::MINCImageIO, itk::Bruker2dseqImageIO, itk::FileListVideoIO, itk::IPLCommonImageIO, itk::VXLVideoIO, itk::JPEGImageIO, itk::VTKImageIO, itk::MRCImageIO, itk::StimulateImageIO, itk::PNGImageIO, itk::MetaImageIO, itk::BMPImageIO, itk::TIFFImageIO, itk::BioRadImageIO, itk::NrrdImageIO, itk::VoxBoCUBImageIO, itk::LSMImageIO, itk::GiplImageIO, and itk::OpenCVVideoIO.
|
protectedvirtual |
Return the object to an initialized state, ready to be used
|
protected |
Resize the ImageIOBase object to new dimensions.
|
virtual |
These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.
|
inline |
These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.
Definition at line 374 of file itkImageIOBase.h.
References itk::CommonEnums::BigEndian.
|
inline |
Definition at line 381 of file itkImageIOBase.h.
References itk::CommonEnums::LittleEndian.
|
virtual |
Set/Get the component type of the image. This is always a native type.
|
virtual |
Set/Get a compression level hint.
If compression is enabled by UseCompression, then the value may be used for as the compression level dependent upon the compressor.
|
virtual |
Set/Get the compression algorithm to use.
If compression is enabled by UseCompression, then the value is used to select the compression algorithm. An empty string represent the default compressor. If string identifier is not recognized a warning is produced and the default is used.
|
virtual |
Set/Get the image dimensions in the x, y, z, etc. directions. GetDimensions() is typically used after reading the data; the SetDimensions() is used prior to writing the data.
|
virtual |
Set/Get the image direction on an axis-by-axis basis. The SetDirection() method is required when writing the image.
|
virtual |
|
virtual |
Set/Get a boolean to perform RGB palette expansion. If true, palette image is read as RGB, if false, palette image is read as Scalar+Palette. A RGB image is always read as RGB.
|
virtual |
Set/Get the name of the file to be read.
Reimplemented in itk::FileListVideoIO.
|
virtual |
These methods control whether the file is written binary or ASCII. Many file formats (i.e., subclasses) ignore this flag.
|
inline |
These methods control whether the file is written binary or ASCII. Many file formats (i.e., subclasses) ignore this flag.
Definition at line 348 of file itkImageIOBase.h.
References itk::CommonEnums::ASCII.
|
inline |
Definition at line 355 of file itkImageIOBase.h.
References itk::CommonEnums::Binary.
|
virtual |
Specify the region of the image data to either read or write. The IORegion specifies the part of the image to read or write. Regions are defined with an index and a size vector. These vectors define the start (lower-left corner) and length of the region within the image. Make sure that the IORegion lies within the image.
|
protectedvirtual |
Set/Get enforced maximum compression level value to limit range
|
virtual |
Set/Get the number of components per pixel in the image. This may be set by the reading process. For SCALAR pixel types, NumberOfComponents will be 1. For other pixel types, NumberOfComponents will be greater than or equal to one.
void itk::ImageIOBase::SetNumberOfDimensions | ( | unsigned int | ) |
Set/Get the number of independent variables (dimensions) in the image being read or written. Note this is not necessarily what is written, rather the IORegion controls that.
|
virtual |
Set/Get the image origin on a axis-by-axis basis. The SetOrigin() method is required when writing the image.
|
virtual |
Set/Get the type of the pixel. The PixelTypes provides context to the IO mechanisms for data conversions. PixelTypes can be SCALAR, RGB, RGBA, VECTOR, COVARIANTVECTOR, POINT, INDEX. If the PIXELTYPE is SCALAR, then the NumberOfComponents should be 1. Any other of PIXELTYPE will have more than one component.
|
inline |
Definition at line 669 of file itkImageIOBase.h.
References itk::CommonEnums::ARRAY.
|
inline |
Definition at line 621 of file itkImageIOBase.h.
References itk::CommonEnums::COVARIANTVECTOR.
|
inline |
Definition at line 637 of file itkImageIOBase.h.
References itk::CommonEnums::DIFFUSIONTENSOR3D.
|
inline |
Definition at line 653 of file itkImageIOBase.h.
References itk::CommonEnums::FIXEDARRAY.
|
inline |
Definition at line 677 of file itkImageIOBase.h.
References itk::CommonEnums::MATRIX.
|
inline |
Definition at line 597 of file itkImageIOBase.h.
References itk::CommonEnums::LONG, and itk::CommonEnums::OFFSET.
|
inline |
Definition at line 613 of file itkImageIOBase.h.
References itk::CommonEnums::POINT.
|
inline |
Definition at line 589 of file itkImageIOBase.h.
References itk::CommonEnums::RGBA.
|
inline |
Definition at line 581 of file itkImageIOBase.h.
References itk::CommonEnums::RGB.
|
inline |
Definition at line 645 of file itkImageIOBase.h.
References itk::CommonEnums::COMPLEX.
|
inline |
Definition at line 629 of file itkImageIOBase.h.
References itk::CommonEnums::SYMMETRICSECONDRANKTENSOR.
|
inline |
Definition at line 573 of file itkImageIOBase.h.
References itk::CommonEnums::SCALAR.
|
inline |
Definition at line 661 of file itkImageIOBase.h.
References itk::CommonEnums::VARIABLELENGTHVECTOR.
|
inline |
Definition at line 685 of file itkImageIOBase.h.
References itk::CommonEnums::VARIABLESIZEMATRIX.
|
inline |
Definition at line 605 of file itkImageIOBase.h.
References itk::CommonEnums::VECTOR.
|
virtual |
Set/Get the image spacing on an axis-by-axis basis. The SetSpacing() method is required when writing the image.
|
protected |
|
protected |
void itk::ImageIOBase::SetTypeInfo | ( | const TPixel * | ) |
|
virtual |
Set/Get a boolean to use the compression or not.
|
virtual |
Set/Get a boolean to use streaming while reading or not.
|
virtual |
Set/Get a boolean to use streaming while writing or not.
|
virtual |
Set/Get a boolean to include a color palette while writing the image file. Applies only for scalar Pixels
|
inlinevirtual |
The different types of ImageIO's can support data of varying dimensionality. For example, some file formats are strictly 2D while others can support 2D, 3D, or even n-D. This method returns true/false as to whether the ImageIO can support the dimension indicated.
Reimplemented in itk::NrrdImageIO, itk::MetaImageIO, itk::RawImageIO< TPixel, VImageDimension >, and itk::MINCImageIO.
Definition at line 494 of file itkImageIOBase.h.
|
virtual |
Set/Get a boolean to use the compression or not.
|
virtual |
Set/Get a boolean to use streaming while reading or not.
|
virtual |
Set/Get a boolean to use streaming while writing or not.
|
pure virtual |
Writes the data to disk from the memory buffer provided. Make sure that the IORegions has been set properly. The buffer is cast to a pointer to the beginning of the image data.
Implemented in itk::NiftiImageIO, itk::FileListVideoIO, itk::RawImageIO< TPixel, VImageDimension >, itk::GDCMImageIO, itk::JPEG2000ImageIO, itk::VXLVideoIO, itk::HDF5ImageIO, itk::DCMTKImageIO, itk::IPLCommonImageIO, itk::MINCImageIO, itk::JPEGImageIO, itk::VTKImageIO, itk::PNGImageIO, itk::StimulateImageIO, itk::MRCImageIO, itk::MetaImageIO, itk::TIFFImageIO, itk::BioRadImageIO, itk::BMPImageIO, itk::LSMImageIO, itk::VoxBoCUBImageIO, itk::NrrdImageIO, itk::GiplImageIO, itk::OpenCVVideoIO, and itk::Bruker2dseqImageIO.
|
protectedvirtual |
Convenient method to write a buffer as ASCII text.
Reimplemented in itk::VTKImageIO.
|
pure virtual |
Writes the spacing and dimensions of the image. Assumes SetFileName has been called with a valid file name.
Implemented in itk::NiftiImageIO, itk::FileListVideoIO, itk::GDCMImageIO, itk::RawImageIO< TPixel, VImageDimension >, itk::JPEG2000ImageIO, itk::VXLVideoIO, itk::HDF5ImageIO, itk::DCMTKImageIO, itk::IPLCommonImageIO, itk::MINCImageIO, itk::Bruker2dseqImageIO, itk::JPEGImageIO, itk::VTKImageIO, itk::PNGImageIO, itk::StimulateImageIO, itk::MetaImageIO, itk::TIFFImageIO, itk::BioRadImageIO, itk::BMPImageIO, itk::VoxBoCUBImageIO, itk::LSMImageIO, itk::NrrdImageIO, itk::GiplImageIO, itk::MRCImageIO, and itk::OpenCVVideoIO.
|
virtual |
Set/Get a boolean to include a color palette while writing the image file. Applies only for scalar Pixels
|
protected |
Big or Little Endian, and the type of the file. (May be ignored.)
Definition at line 721 of file itkImageIOBase.h.
|
protected |
Used internally to keep track of the type of the component. It is set when ComputeStrides() is invoked.
Definition at line 718 of file itkImageIOBase.h.
|
protected |
Definition at line 742 of file itkImageIOBase.h.
|
protected |
Definition at line 744 of file itkImageIOBase.h.
|
protected |
The array which stores the number of pixels in the x, y, z directions.
Definition at line 779 of file itkImageIOBase.h.
|
protected |
The arrays which store the direction cosines of the image.
Definition at line 789 of file itkImageIOBase.h.
|
protected |
Should we expand RGB palette or stay scalar
Definition at line 765 of file itkImageIOBase.h.
|
protected |
Filename to read
Definition at line 729 of file itkImageIOBase.h.
|
protected |
Definition at line 723 of file itkImageIOBase.h.
|
protected |
Does the ImageIOBase object have enough info to be of use?
Definition at line 726 of file itkImageIOBase.h.
|
protected |
The region to read or write. The region contains information about the data within the region to read or write.
Definition at line 776 of file itkImageIOBase.h.
|
protected |
true if a RGB palette has been read and the image kept scalar
Definition at line 769 of file itkImageIOBase.h.
|
protected |
Definition at line 743 of file itkImageIOBase.h.
|
protected |
Stores the number of components per pixel. This will be 1 for grayscale images, 3 for RGBPixel images, and 4 for RGBPixelA images.
Definition at line 733 of file itkImageIOBase.h.
|
protected |
The number of independent dimensions in the image.
Definition at line 736 of file itkImageIOBase.h.
|
protected |
The array which stores the origin of the image.
Definition at line 786 of file itkImageIOBase.h.
|
protected |
Used internally to keep track of the type of the pixel.
Definition at line 714 of file itkImageIOBase.h.
|
protected |
The array which stores the spacing of pixels in the x, y, z directions.
Definition at line 783 of file itkImageIOBase.h.
|
protected |
Stores the number of bytes it takes to get to the next 'thing' e.g. component, pixel, row, slice, etc.
Definition at line 793 of file itkImageIOBase.h.
|
private |
Definition at line 910 of file itkImageIOBase.h.
|
private |
Definition at line 911 of file itkImageIOBase.h.
|
protected |
Should we compress the data?
Definition at line 739 of file itkImageIOBase.h.
|
protected |
Should we use streaming for reading
Definition at line 759 of file itkImageIOBase.h.
|
protected |
Should we use streaming for writing
Definition at line 762 of file itkImageIOBase.h.
|
protected |
Should we try to include a RGB palette while writing the image
Definition at line 772 of file itkImageIOBase.h.