SimpleITK  
itk::simple::ImageReaderBase Class Referenceabstract

An abstract base class for image readers. More...

#include <sitkImageReaderBase.h>

+ Inheritance diagram for itk::simple::ImageReaderBase:
+ Collaboration diagram for itk::simple::ImageReaderBase:

Detailed Description

An abstract base class for image readers.

Definition at line 42 of file sitkImageReaderBase.h.

Public Types

using Self = ImageReaderBase
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

virtual Image Execute ()=0
 
virtual std::vector< std::string > GetRegisteredImageIOs () const
 Get a vector of the names of registered itk ImageIOs.
 
 ImageReaderBase ()
 
std::string ToString () const override
 
 ~ImageReaderBase () override
 
SelfSetOutputPixelType (PixelIDValueEnum pixelID)
 Set/Get The output PixelType of the image.
 
PixelIDValueEnum GetOutputPixelType () const
 Set/Get The output PixelType of the image.
 
virtual SelfSetLoadPrivateTags (bool loadPrivateTags)
 Set/Get loading private DICOM tags into Image's MetaData.
 
virtual bool GetLoadPrivateTags () const
 Set/Get loading private DICOM tags into Image's MetaData.
 
virtual void LoadPrivateTagsOn ()
 Set/Get loading private DICOM tags into Image's MetaData.
 
virtual void LoadPrivateTagsOff ()
 Set/Get loading private DICOM tags into Image's MetaData.
 
virtual SelfSetImageIO (const std::string &imageio)
 Set/Get name of ImageIO to use.
 
virtual std::string GetImageIO () const
 Set/Get name of ImageIO to use.
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, const std::function< void()> &func)
 Directly add a callback to observe an event.
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event.
 
virtual std::string GetName () const =0
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution.
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event.
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands.
 
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
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Static Public Member Functions

static std::string GetImageIOFromFileName (const PathType &fileName)
 Get the automatic ImageIO from the ImageIOFactory.
 
- 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 double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces.
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces.
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces.
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces.
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects.
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects.
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects.
 

Protected Member Functions

unsigned int GetDimensionFromImageIO (const itk::ImageIOBase *iobase, unsigned int i)
 
unsigned int GetDimensionFromImageIO (const PathType &filename, unsigned int i)
 
itk::SmartPointer< ImageIOBaseGetImageIOBase (const PathType &fileName)
 
void GetPixelIDFromImageIO (const itk::ImageIOBase *iobase, PixelIDValueType &outPixelType, unsigned int &outDimensions)
 
void GetPixelIDFromImageIO (const PathType &fileName, PixelIDValueType &outPixelType, unsigned int &outDimensions)
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) noexcept
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 

Private Member Functions

PixelIDValueType ExecuteInternalReadComplex (int componentType)
 
PixelIDValueType ExecuteInternalReadScalar (int componentType)
 
PixelIDValueType ExecuteInternalReadVector (int componentType)
 

Private Attributes

std::string m_ImageIOName
 
bool m_LoadPrivateTags
 
PixelIDValueEnum m_OutputPixelType
 

Additional Inherited Members

- 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<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img)
 
template<class TImageType>
static Image CastITKToImage (TImageType *img)
 
static const itk::EventObjectGetITKEventObject (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)
 

Member Typedef Documentation

◆ Self

Constructor & Destructor Documentation

◆ ~ImageReaderBase()

itk::simple::ImageReaderBase::~ImageReaderBase ( )
override

◆ ImageReaderBase()

itk::simple::ImageReaderBase::ImageReaderBase ( )

Member Function Documentation

◆ Execute()

virtual Image itk::simple::ImageReaderBase::Execute ( )
pure virtual

Pure virtual method to execute the image reading.

This method is reimplemented in derived classes to perform the actual reading of the image.

Implemented in itk::simple::ImageFileReader, itk::simple::ImageSeriesReader, and itk::simple::ImportImageFilter.

◆ ExecuteInternalReadComplex()

PixelIDValueType itk::simple::ImageReaderBase::ExecuteInternalReadComplex ( int componentType)
private

◆ ExecuteInternalReadScalar()

PixelIDValueType itk::simple::ImageReaderBase::ExecuteInternalReadScalar ( int componentType)
private

◆ ExecuteInternalReadVector()

PixelIDValueType itk::simple::ImageReaderBase::ExecuteInternalReadVector ( int componentType)
private

◆ GetDimensionFromImageIO() [1/2]

unsigned int itk::simple::ImageReaderBase::GetDimensionFromImageIO ( const itk::ImageIOBase * iobase,
unsigned int i )
protected

◆ GetDimensionFromImageIO() [2/2]

unsigned int itk::simple::ImageReaderBase::GetDimensionFromImageIO ( const PathType & filename,
unsigned int i )
protected

◆ GetImageIO()

virtual std::string itk::simple::ImageReaderBase::GetImageIO ( ) const
virtual

Set/Get name of ImageIO to use.

An option to override the automatically detected ImageIO used to read the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated. If the ImageIO can not read the file an exception will be generated.

The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.

◆ GetImageIOBase()

itk::SmartPointer< ImageIOBase > itk::simple::ImageReaderBase::GetImageIOBase ( const PathType & fileName)
protected

◆ GetImageIOFromFileName()

static std::string itk::simple::ImageReaderBase::GetImageIOFromFileName ( const PathType & fileName)
static

Get the automatic ImageIO from the ImageIOFactory.

Returns the name of ImageIO automatically detected to read the file. The file is required to exist, and the file may be opened and/or the file extension examined. If an error is encountered such as the file does not exist, then an empty string ("") will be returned.

◆ GetLoadPrivateTags()

virtual bool itk::simple::ImageReaderBase::GetLoadPrivateTags ( ) const
virtual

Set/Get loading private DICOM tags into Image's MetaData.

Unknown private tags may be encoded with Base64 encoding.

◆ GetOutputPixelType()

PixelIDValueEnum itk::simple::ImageReaderBase::GetOutputPixelType ( ) const

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.

◆ GetPixelIDFromImageIO() [1/2]

void itk::simple::ImageReaderBase::GetPixelIDFromImageIO ( const itk::ImageIOBase * iobase,
PixelIDValueType & outPixelType,
unsigned int & outDimensions )
protected

◆ GetPixelIDFromImageIO() [2/2]

void itk::simple::ImageReaderBase::GetPixelIDFromImageIO ( const PathType & fileName,
PixelIDValueType & outPixelType,
unsigned int & outDimensions )
protected

◆ GetRegisteredImageIOs()

virtual std::vector< std::string > itk::simple::ImageReaderBase::GetRegisteredImageIOs ( ) const
virtual

Get a vector of the names of registered itk ImageIOs.

Examples
ImageIOSelection/ImageIOSelection.cs, and ImageIOSelection/ImageIOSelection.cxx.

◆ LoadPrivateTagsOff()

virtual void itk::simple::ImageReaderBase::LoadPrivateTagsOff ( )
virtual

Set/Get loading private DICOM tags into Image's MetaData.

Unknown private tags may be encoded with Base64 encoding.

◆ LoadPrivateTagsOn()

virtual void itk::simple::ImageReaderBase::LoadPrivateTagsOn ( )
virtual

Set/Get loading private DICOM tags into Image's MetaData.

Unknown private tags may be encoded with Base64 encoding.

◆ SetImageIO()

virtual Self & itk::simple::ImageReaderBase::SetImageIO ( const std::string & imageio)
virtual

Set/Get name of ImageIO to use.

An option to override the automatically detected ImageIO used to read the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated. If the ImageIO can not read the file an exception will be generated.

The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.

Examples
ImageIOSelection/ImageIOSelection.cs, ImageIOSelection/ImageIOSelection.cxx, SimpleIO/SimpleIO.cs, and SimpleIO/SimpleIO.cxx.

◆ SetLoadPrivateTags()

virtual Self & itk::simple::ImageReaderBase::SetLoadPrivateTags ( bool loadPrivateTags)
virtual

Set/Get loading private DICOM tags into Image's MetaData.

Unknown private tags may be encoded with Base64 encoding.

◆ SetOutputPixelType()

Self & itk::simple::ImageReaderBase::SetOutputPixelType ( PixelIDValueEnum pixelID)

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.

Examples
ImageRegistrationMethod1/ImageRegistrationMethod1.cs, and ImageRegistrationMethod2/ImageRegistrationMethod2.cs.

◆ ToString()

std::string itk::simple::ImageReaderBase::ToString ( ) const
overridevirtual

Member Data Documentation

◆ m_ImageIOName

std::string itk::simple::ImageReaderBase::m_ImageIOName
private

Definition at line 158 of file sitkImageReaderBase.h.

◆ m_LoadPrivateTags

bool itk::simple::ImageReaderBase::m_LoadPrivateTags
private

Definition at line 156 of file sitkImageReaderBase.h.

◆ m_OutputPixelType

PixelIDValueEnum itk::simple::ImageReaderBase::m_OutputPixelType
private

Definition at line 155 of file sitkImageReaderBase.h.


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