SimpleITK  
itk::simple::ImportImageFilter Class Reference

Compose a 2D or 3D image and return a smart pointer to a SimpleITK image. More...

#include <sitkImportImageFilter.h>

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

Detailed Description

Compose a 2D or 3D image and return a smart pointer to a SimpleITK image.

This filter is intended to interface SimpleITK to other image processing libraries and applications that may have their own representation of an image class. It creates a SimpleITK image which shares the bulk data buffer as what is set. SimpleITK will not responsible to delete the buffer afterwards, and it buffer must remain valid while in use.

See also
itk::simple::ImportAsInt8, itk::simple::ImportAsUInt8, itk::simple::ImportAsInt16, itk::simple::ImportAsUInt16, itk::simple::ImportAsInt32, itk::simple::ImportAsUInt32, itk::simple::ImportAsInt64, itk::simple::ImportAsUInt64, itk::simple::ImportAsFloat,itk::simple::ImportAsDouble for the procedural interfaces.
Examples
BufferImportExport.cxx.

Definition at line 47 of file sitkImportImageFilter.h.

Public Types

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

Public Member Functions

Image Execute () override
 
const std::vector< double > & GetDirection () const
 
std::string GetName () const override
 
const std::vector< double > & GetOrigin () const
 
const std::vector< unsigned int > & GetSize () const
 
const std::vector< double > & GetSpacing () const
 
 ImportImageFilter ()
 
void SetBufferAsDouble (double *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsFloat (float *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsInt16 (int16_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsInt32 (int32_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsInt64 (int64_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsInt8 (int8_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsUInt16 (uint16_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsUInt32 (uint32_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsUInt64 (uint64_t *buffer, unsigned int numberOfComponents=1)
 
void SetBufferAsUInt8 (uint8_t *buffer, unsigned int numberOfComponents=1)
 
void SetDirection (const std::vector< double > &direction)
 
void SetOrigin (const std::vector< double > &origin)
 
void SetSize (const std::vector< unsigned int > &size)
 
void SetSpacing (const std::vector< double > &spacing)
 
std::string ToString () const override
 
 ~ImportImageFilter () override
 
- Public Member Functions inherited from itk::simple::ImageReaderBase
virtual std::vector< std::string > GetRegisteredImageIOs () const
 Get a vector of the names of registered itk ImageIOs.
 
 ImageReaderBase ()
 
 ~ImageReaderBase () override
 
void SetOutputPixelType (PixelIDValueEnum pixelID)
 Set/Get The output PixelType of the image.
 
PixelIDValueEnum GetOutputPixelType () const
 Set/Get The output PixelType of the image.
 
virtual void SetLoadPrivateTags (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 void SetImageIO (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 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
 

Protected Member Functions

template<class TImageType>
Image ExecuteInternal ()
 
- Protected Member Functions inherited from itk::simple::ImageReaderBase
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 Types

typedef Image(Self::* MemberFunctionType) ()
 

Static Private Member Functions

static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory ()
 

Private Attributes

void * m_Buffer { nullptr }
 
std::vector< double > m_Direction
 
unsigned int m_NumberOfComponentsPerPixel { 0 }
 
std::vector< double > m_Origin { std::vector<double>(3, 0.0) }
 
PixelIDValueType m_PixelIDValue { sitkUnknown }
 
std::vector< unsigned int > m_Size
 
std::vector< double > m_Spacing { std::vector<double>(3, 1.0) }
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ImageReaderBase
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.
 
- 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

◆ MemberFunctionType

typedef Image(Self::* itk::simple::ImportImageFilter::MemberFunctionType) ()
private

Definition at line 119 of file sitkImportImageFilter.h.

◆ Self

Constructor & Destructor Documentation

◆ ~ImportImageFilter()

itk::simple::ImportImageFilter::~ImportImageFilter ( )
override

◆ ImportImageFilter()

itk::simple::ImportImageFilter::ImportImageFilter ( )

Member Function Documentation

◆ Execute()

Image itk::simple::ImportImageFilter::Execute ( )
overridevirtual

Pure virtual method to execute the image reading.

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

Implements itk::simple::ImageReaderBase.

Examples
BufferImportExport.cxx.

◆ ExecuteInternal()

template<class TImageType>
Image itk::simple::ImportImageFilter::ExecuteInternal ( )
protected

◆ GetDirection()

const std::vector< double > & itk::simple::ImportImageFilter::GetDirection ( ) const

◆ GetMemberFunctionFactory()

static const detail::MemberFunctionFactory< MemberFunctionType > & itk::simple::ImportImageFilter::GetMemberFunctionFactory ( )
staticprivate

◆ GetName()

std::string itk::simple::ImportImageFilter::GetName ( ) const
inlineoverridevirtual

return user readable name of the filter

Implements itk::simple::ProcessObject.

Definition at line 62 of file sitkImportImageFilter.h.

◆ GetOrigin()

const std::vector< double > & itk::simple::ImportImageFilter::GetOrigin ( ) const

◆ GetSize()

const std::vector< unsigned int > & itk::simple::ImportImageFilter::GetSize ( ) const

◆ GetSpacing()

const std::vector< double > & itk::simple::ImportImageFilter::GetSpacing ( ) const

◆ SetBufferAsDouble()

void itk::simple::ImportImageFilter::SetBufferAsDouble ( double * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsFloat()

void itk::simple::ImportImageFilter::SetBufferAsFloat ( float * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsInt16()

void itk::simple::ImportImageFilter::SetBufferAsInt16 ( int16_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsInt32()

void itk::simple::ImportImageFilter::SetBufferAsInt32 ( int32_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsInt64()

void itk::simple::ImportImageFilter::SetBufferAsInt64 ( int64_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsInt8()

void itk::simple::ImportImageFilter::SetBufferAsInt8 ( int8_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsUInt16()

void itk::simple::ImportImageFilter::SetBufferAsUInt16 ( uint16_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsUInt32()

void itk::simple::ImportImageFilter::SetBufferAsUInt32 ( uint32_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsUInt64()

void itk::simple::ImportImageFilter::SetBufferAsUInt64 ( uint64_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetBufferAsUInt8()

void itk::simple::ImportImageFilter::SetBufferAsUInt8 ( uint8_t * buffer,
unsigned int numberOfComponents = 1 )

◆ SetDirection()

void itk::simple::ImportImageFilter::SetDirection ( const std::vector< double > & direction)

◆ SetOrigin()

void itk::simple::ImportImageFilter::SetOrigin ( const std::vector< double > & origin)

◆ SetSize()

void itk::simple::ImportImageFilter::SetSize ( const std::vector< unsigned int > & size)

◆ SetSpacing()

void itk::simple::ImportImageFilter::SetSpacing ( const std::vector< double > & spacing)

◆ ToString()

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

Print ourselves to string

Reimplemented from itk::simple::ImageReaderBase.

Friends And Related Symbol Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 119 of file sitkImportImageFilter.h.

Member Data Documentation

◆ m_Buffer

void* itk::simple::ImportImageFilter::m_Buffer { nullptr }
private

Definition at line 134 of file sitkImportImageFilter.h.

◆ m_Direction

std::vector<double> itk::simple::ImportImageFilter::m_Direction
private

Definition at line 132 of file sitkImportImageFilter.h.

◆ m_NumberOfComponentsPerPixel

unsigned int itk::simple::ImportImageFilter::m_NumberOfComponentsPerPixel { 0 }
private

Definition at line 126 of file sitkImportImageFilter.h.

◆ m_Origin

std::vector<double> itk::simple::ImportImageFilter::m_Origin { std::vector<double>(3, 0.0) }
private

Definition at line 129 of file sitkImportImageFilter.h.

◆ m_PixelIDValue

PixelIDValueType itk::simple::ImportImageFilter::m_PixelIDValue { sitkUnknown }
private

Definition at line 127 of file sitkImportImageFilter.h.

◆ m_Size

std::vector<unsigned int> itk::simple::ImportImageFilter::m_Size
private

Definition at line 131 of file sitkImportImageFilter.h.

◆ m_Spacing

std::vector<double> itk::simple::ImportImageFilter::m_Spacing { std::vector<double>(3, 1.0) }
private

Definition at line 130 of file sitkImportImageFilter.h.


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