SimpleITK
1.1.0
|
Read an image file and return a SimpleITK Image. More...
#include <sitkImageFileReader.h>
Public Types | |
typedef ImageFileReader | Self |
Public Types inherited from itk::simple::ImageReaderBase | |
typedef ImageReaderBase | Self |
Public Types inherited from itk::simple::ProcessObject | |
typedef ProcessObject | Self |
Public Member Functions | |
Image | Execute () |
Set/Get The output PixelType of the image. More... | |
std::string | GetFileName () const |
virtual std::string | GetName () const |
ImageFileReader () | |
void | ReadImageInformation (void) |
Read only the meta-data and image information in the file. More... | |
Self & | SetFileName (const std::string &fn) |
virtual std::string | ToString () const |
virtual | ~ImageFileReader () |
Public Member Functions inherited from itk::simple::ImageReaderBase | |
ImageReaderBase () | |
virtual | ~ImageReaderBase () |
Self & | SetOutputPixelType (PixelIDValueEnum pixelID) |
Set/Get The output PixelType of the image. More... | |
PixelIDValueEnum | GetOutputPixelType (void) const |
Set/Get The output PixelType of the image. More... | |
virtual std::vector< std::string > | GetRegisteredImageIOs () const |
Get a vector of the names of registered itk ImageIOs. More... | |
virtual Self & | SetLoadPrivateTags (bool loadPrivateTags) |
Set/Get loading private DICOM tags into Image's MetaData. More... | |
virtual bool | GetLoadPrivateTags () const |
Set/Get The output PixelType of the image. More... | |
virtual void | LoadPrivateTagsOn () |
Set/Get The output PixelType of the image. More... | |
virtual void | LoadPrivateTagsOff () |
Set/Get The output PixelType of the image. More... | |
Public Member Functions inherited from itk::simple::ProcessObject | |
virtual void | Abort () |
virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
Add a Command Object to observer the event. More... | |
virtual float | GetProgress () const |
An Active Measurement of the progress of execution. More... | |
virtual bool | HasCommand (itk::simple::EventEnum event) const |
Query of this object has any registered commands for event. More... | |
ProcessObject () | |
virtual void | RemoveAllCommands () |
Remove all registered commands. More... | |
virtual | ~ProcessObject () |
virtual void | DebugOn () |
virtual void | DebugOff () |
virtual bool | GetDebug () const |
virtual void | SetDebug (bool debugFlag) |
virtual void | SetNumberOfThreads (unsigned int n) |
virtual unsigned int | GetNumberOfThreads () const |
typedef Image(Self::* | MemberFunctionType) (itk::ImageIOBase *) |
Image information methods updated via ReadImageInformation. More... | |
struct | detail::MemberFunctionAddressor< MemberFunctionType > |
Image information methods updated via ReadImageInformation. More... | |
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > | m_MemberFactory |
Image information methods updated via ReadImageInformation. More... | |
nsstd::function< std::vector< std::string >)> | m_pfGetMetaDataKeys |
Image information methods updated via ReadImageInformation. More... | |
nsstd::function< bool(const std::string &)> | m_pfHasMetaDataKey |
Image information methods updated via ReadImageInformation. More... | |
nsstd::function< std::string(const std::string &)> | m_pfGetMetaData |
Image information methods updated via ReadImageInformation. More... | |
std::string | m_FileName |
Image information methods updated via ReadImageInformation. More... | |
nsstd::auto_ptr< MetaDataDictionary > | m_MetaDataDictionary |
Image information methods updated via ReadImageInformation. More... | |
PixelIDValueEnum | m_PixelType |
Image information methods updated via ReadImageInformation. More... | |
unsigned int | m_Dimension |
Image information methods updated via ReadImageInformation. More... | |
unsigned int | m_NumberOfComponents |
Image information methods updated via ReadImageInformation. More... | |
std::vector< double > | m_Direction |
Image information methods updated via ReadImageInformation. More... | |
std::vector< double > | m_Origin |
Image information methods updated via ReadImageInformation. More... | |
std::vector< double > | m_Spacing |
Image information methods updated via ReadImageInformation. More... | |
std::vector< uint64_t > | m_Size |
Image information methods updated via ReadImageInformation. More... | |
PixelIDValueEnum | GetPixelID (void) const |
Image information methods updated via ReadImageInformation. More... | |
PixelIDValueType | GetPixelIDValue (void) const |
Image information methods updated via ReadImageInformation. More... | |
unsigned int | GetDimension (void) const |
Image information methods updated via ReadImageInformation. More... | |
unsigned int | GetNumberOfComponents (void) const |
Image information methods updated via ReadImageInformation. More... | |
const std::vector< double > & | GetOrigin (void) const |
Image information methods updated via ReadImageInformation. More... | |
const std::vector< double > & | GetSpacing (void) const |
Image information methods updated via ReadImageInformation. More... | |
const std::vector< double > & | GetDirection () const |
Image information methods updated via ReadImageInformation. More... | |
const std::vector< uint64_t > & | GetSize (void) const |
Image information methods updated via ReadImageInformation. More... | |
std::vector< std::string > | GetMetaDataKeys (void) const |
Get the meta-data dictionary keys. More... | |
bool | HasMetaDataKey (const std::string &key) const |
Query a meta-data dictionary for the existence of a key. More... | |
std::string | GetMetaData (const std::string &key) const |
Get the value of a meta-data dictionary entry as a string. More... | |
template<class TImageType > | |
Image | ExecuteInternal (itk::ImageIOBase *) |
Image information methods updated via ReadImageInformation. More... | |
void | UpdateImageInformationFromImageIO (const itk::ImageIOBase *iobase) |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::simple::ProcessObject | |
static bool | GetGlobalDefaultDebug () |
static void | GlobalDefaultDebugOff () |
static void | GlobalDefaultDebugOn () |
static void | SetGlobalDefaultDebug (bool debugFlag) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static void | SetGlobalWarningDisplay (bool flag) |
static bool | GetGlobalWarningDisplay () |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
static double | GetGlobalDefaultCoordinateTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultCoordinateTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static double | GetGlobalDefaultDirectionTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultDirectionTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
Protected Member Functions inherited from itk::simple::ImageReaderBase | |
itk::SmartPointer< ImageIOBase > | GetImageIOBase (const std::string &fileName) |
Set/Get The output PixelType of the image. More... | |
void | GetPixelIDFromImageIO (const std::string &fileName, PixelIDValueType &outPixelType, unsigned int &outDimensions) |
Set/Get The output PixelType of the image. More... | |
void | GetPixelIDFromImageIO (const itk::ImageIOBase *iobase, PixelIDValueType &outPixelType, unsigned int &outDimensions) |
Set/Get The output PixelType of the image. More... | |
unsigned int | GetDimensionFromImageIO (const std::string &fileName, unsigned int i) |
Set/Get The output PixelType of the image. More... | |
unsigned int | GetDimensionFromImageIO (const itk::ImageIOBase *iobase, unsigned int i) |
Set/Get The output PixelType of the image. More... | |
Protected Member Functions inherited from itk::simple::ProcessObject | |
virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
virtual itk::ProcessObject * | GetActiveProcess () |
virtual void | OnActiveProcessDelete () |
virtual void | onCommandDelete (const itk::simple::Command *cmd) SITK_NOEXCEPT |
virtual void | PreUpdate (itk::ProcessObject *p) |
virtual void | RemoveITKObserver (EventCommand &e) |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable () | |
Static Protected Member Functions inherited from itk::simple::ProcessObject | |
template<class TImageType > | |
static TImageType::ConstPointer | CastImageToITK (const Image &img) |
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
template<class TImageType > | |
static Image | CastITKToImage (TImageType *img) |
static const itk::EventObject & | GetITKEventObject (EventEnum e) |
template<typename T > | |
static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
Read an image file and return a SimpleITK Image.
The reader can handle scalar images, and vector images. Pixel types such as RGB, RGBA are loaded as multi-component images with vector pixel types. Additionally, tensor images are loaded with the pixel type being a 1-d vector.
An interface is also provided to access the information from the underlying itk::ImageIO. This information can be loaded with the ReadImageInformation method.
Definition at line 47 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 143 of file sitkImageFileReader.h.
Definition at line 51 of file sitkImageFileReader.h.
|
virtual |
itk::simple::ImageFileReader::ImageFileReader | ( | ) |
|
virtual |
Set/Get The output PixelType of the image.
By default the value is sitkUnknown, which enable the output pixel type to be same as the file. If the pixel type is specified then the itk::ConvertPixelBuffer will be used to convert the pixels.
Implements itk::simple::ImageReaderBase.
|
protected |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
unsigned int itk::simple::ImageFileReader::GetDimension | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
const std::vector<double>& itk::simple::ImageFileReader::GetDirection | ( | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
std::string itk::simple::ImageFileReader::GetFileName | ( | ) | const |
std::string itk::simple::ImageFileReader::GetMetaData | ( | const std::string & | key | ) | const |
Get the value of a meta-data dictionary entry as a string.
If the key is not in the dictionary then an exception is thrown.
String types in the dictionary are returned as their native string. Other types are printed to string before returning.
std::vector<std::string> itk::simple::ImageFileReader::GetMetaDataKeys | ( | void | ) | const |
Get the meta-data dictionary keys.
This is only valid after successful ReadImageInformation or Execute of this filter.
Returns a vector of keys to the key/value entries in the file's meta-data dictionary. Iterate through with these keys to get the values.
|
inlinevirtual |
return user readable name of the filter
Implements itk::simple::ProcessObject.
Definition at line 61 of file sitkImageFileReader.h.
unsigned int itk::simple::ImageFileReader::GetNumberOfComponents | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
const std::vector<double>& itk::simple::ImageFileReader::GetOrigin | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
PixelIDValueEnum itk::simple::ImageFileReader::GetPixelID | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
PixelIDValueType itk::simple::ImageFileReader::GetPixelIDValue | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
const std::vector<uint64_t>& itk::simple::ImageFileReader::GetSize | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
const std::vector<double>& itk::simple::ImageFileReader::GetSpacing | ( | void | ) | const |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
bool itk::simple::ImageFileReader::HasMetaDataKey | ( | const std::string & | key | ) | const |
Query a meta-data dictionary for the existence of a key.
void itk::simple::ImageFileReader::ReadImageInformation | ( | void | ) |
Read only the meta-data and image information in the file.
This method can be used to determine what the size and pixel type of an image file is without reading the whole image. Even if SimpleITK does not support an image of a certain dimension or type, the meta-information can still be read.
Self& itk::simple::ImageFileReader::SetFileName | ( | const std::string & | fn | ) |
|
virtual |
Print ourselves to string
Reimplemented from itk::simple::ImageReaderBase.
|
protected |
Internal method which update's this classes stored meta-data and image information.
|
friend |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 146 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 159 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 161 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 154 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 147 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 156 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 160 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 162 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 152 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 150 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 151 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 158 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 165 of file sitkImageFileReader.h.
|
private |
Image information methods updated via ReadImageInformation.
These accessor methods are valid after a call to ReadImageInformation or Execute. They contain the image information from the file via the itk::ImageIO. Information such as NumberOfComponents is based of the file format, so the number of components for internal types such as RGB or complex may not be described the same as with SimpleITK's Image interface.
The PixelID has been converted from the ITK type to SimpleITK's interpretation, and will not change when loaded as a SimpleITK Image.
Definition at line 163 of file sitkImageFileReader.h.