SimpleITK  
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
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:

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
 Set/Get The output PixelType of the image. More...
 
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 ()
 
SelfSetBufferAsDouble (double *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsFloat (float *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsInt16 (int16_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsInt32 (int32_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsInt64 (int64_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsInt8 (int8_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsUInt16 (uint16_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsUInt32 (uint32_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsUInt64 (uint64_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetBufferAsUInt8 (uint8_t *buffer, unsigned int numberOfComponents=1)
 
SelfSetDirection (const std::vector< double > &direction)
 
SelfSetOrigin (const std::vector< double > &origin)
 
SelfSetSize (const std::vector< unsigned int > &size)
 
SelfSetSpacing (const std::vector< double > &spacing)
 
std::string ToString () const override
 
 ~ImportImageFilter () override
 
- Public Member Functions inherited from itk::simple::ImageReaderBase
 ImageReaderBase ()
 
 ~ImageReaderBase () override
 
SelfSetOutputPixelType (PixelIDValueEnum pixelID)
 Set/Get The output PixelType of the image. More...
 
PixelIDValueEnum GetOutputPixelType () 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 SelfSetLoadPrivateTags (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...
 
virtual SelfSetImageIO (const std::string &imageio)
 Set/Get name of ImageIO to use. More...
 
virtual std::string GetImageIO () const
 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, const std::function< void()> &func)
 Directly add a callback to observe an event. More...
 
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
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Protected Member Functions

template<class TImageType >
Image ExecuteInternal ()
 
template<class TImageType >
std::enable_if<!IsVector< TImageType >::Value >::type SetNumberOfComponentsOnImage (TImageType *)
 
template<class TImageType >
std::enable_if< IsVector< TImageType >::Value >::type SetNumberOfComponentsOnImage (TImageType *)
 
- Protected Member Functions inherited from itk::simple::ImageReaderBase
itk::SmartPointer< ImageIOBaseGetImageIOBase (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::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) ()
 

Private Attributes

void * m_Buffer
 
std::vector< double > m_Direction
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
unsigned int m_NumberOfComponentsPerPixel
 
std::vector< double > m_Origin
 
PixelIDValueType m_PixelIDValue
 
std::vector< unsigned int > m_Size
 
std::vector< double > m_Spacing
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ImageReaderBase
static std::string GetImageIOFromFileName (const std::string &fileName)
 Get the automatic ImageIO from the ImageIOFactory. More...
 
- 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. 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...
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects. More...
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects. More...
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects. More...
 
- 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)
 

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 46 of file sitkImportImageFilter.h.

Member Typedef Documentation

◆ MemberFunctionType

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

Definition at line 104 of file sitkImportImageFilter.h.

◆ Self

Definition at line 49 of file sitkImportImageFilter.h.

Constructor & Destructor Documentation

◆ ~ImportImageFilter()

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

◆ ImportImageFilter()

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

Member Function Documentation

◆ Execute()

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

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.

Examples
BufferImportExport.cxx.

◆ ExecuteInternal()

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

◆ GetDirection()

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

◆ GetName()

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

return user readable name of the filter

Implements itk::simple::ProcessObject.

Definition at line 59 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()

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

◆ SetBufferAsFloat()

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

◆ SetBufferAsInt16()

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

◆ SetBufferAsInt32()

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

◆ SetBufferAsInt64()

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

◆ SetBufferAsInt8()

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

◆ SetBufferAsUInt16()

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

◆ SetBufferAsUInt32()

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

◆ SetBufferAsUInt64()

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

◆ SetBufferAsUInt8()

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

◆ SetDirection()

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

◆ SetNumberOfComponentsOnImage() [1/2]

template<class TImageType >
std::enable_if<!IsVector<TImageType>::Value>::type itk::simple::ImportImageFilter::SetNumberOfComponentsOnImage ( TImageType *  )
inlineprotected

Definition at line 96 of file sitkImportImageFilter.h.

◆ SetNumberOfComponentsOnImage() [2/2]

template<class TImageType >
std::enable_if<IsVector<TImageType>::Value>::type itk::simple::ImportImageFilter::SetNumberOfComponentsOnImage ( TImageType *  )
protected

◆ SetOrigin()

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

◆ SetSize()

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

◆ SetSpacing()

Self& 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 Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 107 of file sitkImportImageFilter.h.

Member Data Documentation

◆ m_Buffer

void* itk::simple::ImportImageFilter::m_Buffer
private

Definition at line 118 of file sitkImportImageFilter.h.

◆ m_Direction

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

Definition at line 116 of file sitkImportImageFilter.h.

◆ m_MemberFactory

std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::ImportImageFilter::m_MemberFactory
private

Definition at line 108 of file sitkImportImageFilter.h.

◆ m_NumberOfComponentsPerPixel

unsigned int itk::simple::ImportImageFilter::m_NumberOfComponentsPerPixel
private

Definition at line 110 of file sitkImportImageFilter.h.

◆ m_Origin

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

Definition at line 113 of file sitkImportImageFilter.h.

◆ m_PixelIDValue

PixelIDValueType itk::simple::ImportImageFilter::m_PixelIDValue
private

Definition at line 111 of file sitkImportImageFilter.h.

◆ m_Size

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

Definition at line 115 of file sitkImportImageFilter.h.

◆ m_Spacing

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

Definition at line 114 of file sitkImportImageFilter.h.


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