ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits > Class Template Reference

#include <itkMetaSceneConverter.h>

Detailed Description

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
class itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >

Converts between MetaObject and SpatialObject group.

SpatialObject hierarchies are written to disk using the MetaIO library. This class is responsible for converting between MetaIO group and SpatialObject group

See also
MetaConverterBase

Definition at line 48 of file itkMetaSceneConverter.h.

+ Inheritance diagram for itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >:
+ Collaboration diagram for itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using ConverterMapType = std::map< std::string, MetaConverterPointer >
 
using MetaConverterBaseType = MetaConverterBase< VDimension >
 
using MetaConverterPointer = typename MetaConverterBaseType::Pointer
 
using Pointer = SmartPointer< Self >
 
using Self = MetaSceneConverter
 
using SpatialObjectConstPointer = typename SpatialObjectType::ConstPointer
 
using SpatialObjectPointer = typename SpatialObjectType::Pointer
 
using SpatialObjectType = itk::SpatialObject< VDimension >
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

MetaScene * CreateMetaScene (const SpatialObjectType *soScene, unsigned int depth=SpatialObjectType::MaximumDepth, const std::string &name="")
 
SpatialObjectPointer CreateSpatialObjectScene (MetaScene *mScene)
 
virtual MetaEventGetEvent ()
 
const char * GetNameOfClass () const override
 
SpatialObjectPointer ReadMeta (const std::string &name)
 
void RegisterMetaConverter (const std::string &metaTypeName, const std::string &spatialObjectTypeName, MetaConverterBaseType *converter)
 
virtual void SetEvent (MetaEvent *_arg)
 
bool WriteMeta (const SpatialObjectType *soScene, const std::string &fileName, unsigned int depth=SpatialObjectType::MaximumDepth, const std::string &soName="")
 
virtual void SetMetaIOVersion (unsigned int _arg)
 
virtual unsigned int GetMetaIOVersion () const
 
virtual void SetBinaryPoints (bool _arg)
 
virtual bool GetBinaryPoints () const
 
virtual void BinaryPointsOn ()
 
virtual void SetTransformPrecision (unsigned int _arg)
 
virtual unsigned int GetTransformPrecision ()
 
virtual void SetWriteImagesInSeparateFile (bool _arg)
 
virtual bool GetWriteImagesInSeparateFile () const
 
virtual void WriteImagesInSeparateFileOn ()
 
- 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
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () 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 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

 MetaSceneConverter ()
 
 ~MetaSceneConverter () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
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 Types

using MetaObjectListType = std::list< MetaObject * >
 
using TransformType = typename SpatialObjectType::TransformType
 

Private Member Functions

template<typename TConverter >
SpatialObjectPointer MetaObjectToSpatialObject (const MetaObject *mo)
 
void SetTransform (MetaObject *obj, const TransformType *transform)
 
void SetTransform (SpatialObjectType *so, const MetaObject *meta)
 
template<typename TConverter >
MetaObject * SpatialObjectToMetaObject (SpatialObjectConstPointer &so)
 

Private Attributes

bool m_BinaryPoints {}
 
ConverterMapType m_ConverterMap {}
 
MetaEventm_Event {}
 
unsigned int m_MetaIOVersion { 0 }
 
unsigned int m_TransformPrecision {}
 
bool m_WriteImagesInSeparateFile {}
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::ConstPointer = SmartPointer<const Self>

Definition at line 56 of file itkMetaSceneConverter.h.

◆ ConverterMapType

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::ConverterMapType = std::map<std::string, MetaConverterPointer>

Definition at line 71 of file itkMetaSceneConverter.h.

◆ MetaConverterBaseType

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::MetaConverterBaseType = MetaConverterBase<VDimension>

Typedef for auxiliary conversion classes

Definition at line 69 of file itkMetaSceneConverter.h.

◆ MetaConverterPointer

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::MetaConverterPointer = typename MetaConverterBaseType::Pointer

Definition at line 70 of file itkMetaSceneConverter.h.

◆ MetaObjectListType

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::MetaObjectListType = std::list<MetaObject *>
private

Definition at line 144 of file itkMetaSceneConverter.h.

◆ Pointer

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::Pointer = SmartPointer<Self>

Definition at line 55 of file itkMetaSceneConverter.h.

◆ Self

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::Self = MetaSceneConverter

standard class type alias

Definition at line 53 of file itkMetaSceneConverter.h.

◆ SpatialObjectConstPointer

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SpatialObjectConstPointer = typename SpatialObjectType::ConstPointer

Definition at line 66 of file itkMetaSceneConverter.h.

◆ SpatialObjectPointer

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SpatialObjectPointer = typename SpatialObjectType::Pointer

Definition at line 65 of file itkMetaSceneConverter.h.

◆ SpatialObjectType

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SpatialObjectType = itk::SpatialObject<VDimension>

SpatialObject Scene types

Definition at line 64 of file itkMetaSceneConverter.h.

◆ Superclass

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::Superclass = Object

Definition at line 54 of file itkMetaSceneConverter.h.

◆ TransformType

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
using itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::TransformType = typename SpatialObjectType::TransformType
private

Definition at line 142 of file itkMetaSceneConverter.h.

Constructor & Destructor Documentation

◆ MetaSceneConverter()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::MetaSceneConverter ( )
protected

◆ ~MetaSceneConverter()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::~MetaSceneConverter ( )
overrideprotecteddefault

Member Function Documentation

◆ BinaryPointsOn()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::BinaryPointsOn ( )
virtual

Set if the points should be saved in binary/ASCII

◆ CreateMetaScene()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
MetaScene* itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::CreateMetaScene ( const SpatialObjectType soScene,
unsigned int  depth = SpatialObjectType::MaximumDepth,
const std::string &  name = "" 
)

Convert a metaScene into a composite SpatialObject

Manages the composite SpatialObject to keep a hierarchy.

◆ CreateSpatialObjectScene()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
SpatialObjectPointer itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::CreateSpatialObjectScene ( MetaScene *  mScene)

◆ GetBinaryPoints()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual bool itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetBinaryPoints ( ) const
virtual

Set if the points should be saved in binary/ASCII

◆ GetEvent()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual MetaEvent* itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetEvent ( )
virtual

◆ GetMetaIOVersion()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual unsigned int itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetMetaIOVersion ( ) const
virtual

Choose the API and FileFormat version for MetaIO. Version 0 (default) is not able to fully / accurately represent a SpatialObject scene (image transform and parent-object transforms are intermingled. Version 1 fixes the bugs in Version 0, but introduces new tag-value pairs that won't be processed by older readers/apps.

◆ GetNameOfClass()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
const char* itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetNameOfClass ( ) const
overridevirtual
See also
LightObject::GetNameOfClass()

Reimplemented from itk::Object.

◆ GetTransformPrecision()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual unsigned int itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetTransformPrecision ( )
virtual

set/get the precision for writing out numbers as plain text

◆ GetWriteImagesInSeparateFile()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual bool itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::GetWriteImagesInSeparateFile ( ) const
virtual

Set if the images should be written in different files

◆ MetaObjectToSpatialObject()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
template<typename TConverter >
SpatialObjectPointer itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::MetaObjectToSpatialObject ( const MetaObject *  mo)
inlineprivate

Definition at line 158 of file itkMetaSceneConverter.h.

References New().

◆ New()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
static Pointer itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::New ( )
static

◆ ReadMeta()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
SpatialObjectPointer itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::ReadMeta ( const std::string &  name)

Read a MetaFile and create a Scene SpatialObject.

◆ RegisterMetaConverter()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::RegisterMetaConverter ( const std::string &  metaTypeName,
const std::string &  spatialObjectTypeName,
MetaConverterBaseType converter 
)

add new SpatialObject/MetaObject converters at runtime

Every Converter is mapped to both a metaObject type name and a spatialObject type name – these need to match what gets read from & written to the MetaIO file

◆ SetBinaryPoints()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetBinaryPoints ( bool  _arg)
virtual

Set if the points should be saved in binary/ASCII

◆ SetEvent()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetEvent ( MetaEvent _arg)
virtual

◆ SetMetaIOVersion()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetMetaIOVersion ( unsigned int  _arg)
virtual

Choose the API and FileFormat version for MetaIO. Version 0 (default) is not able to fully / accurately represent a SpatialObject scene (image transform and parent-object transforms are intermingled. Version 1 fixes the bugs in Version 0, but introduces new tag-value pairs that won't be processed by older readers/apps.

◆ SetTransform() [1/2]

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetTransform ( MetaObject *  obj,
const TransformType transform 
)
private

◆ SetTransform() [2/2]

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetTransform ( SpatialObjectType so,
const MetaObject *  meta 
)
private

◆ SetTransformPrecision()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetTransformPrecision ( unsigned int  _arg)
virtual

set/get the precision for writing out numbers as plain text

◆ SetWriteImagesInSeparateFile()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SetWriteImagesInSeparateFile ( bool  _arg)
virtual

Set if the images should be written in different files

◆ SpatialObjectToMetaObject()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
template<typename TConverter >
MetaObject* itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::SpatialObjectToMetaObject ( SpatialObjectConstPointer so)
inlineprivate

Definition at line 148 of file itkMetaSceneConverter.h.

References New().

◆ WriteImagesInSeparateFileOn()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
virtual void itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::WriteImagesInSeparateFileOn ( )
virtual

Set if the images should be written in different files

◆ WriteMeta()

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
bool itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::WriteMeta ( const SpatialObjectType soScene,
const std::string &  fileName,
unsigned int  depth = SpatialObjectType::MaximumDepth,
const std::string &  soName = "" 
)

Write out a SpatialObject.

Member Data Documentation

◆ m_BinaryPoints

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
bool itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_BinaryPoints {}
private

Definition at line 171 of file itkMetaSceneConverter.h.

◆ m_ConverterMap

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
ConverterMapType itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_ConverterMap {}
private

Definition at line 174 of file itkMetaSceneConverter.h.

◆ m_Event

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
MetaEvent* itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_Event {}
private

Definition at line 170 of file itkMetaSceneConverter.h.

◆ m_MetaIOVersion

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
unsigned int itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_MetaIOVersion { 0 }
private

Definition at line 175 of file itkMetaSceneConverter.h.

◆ m_TransformPrecision

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
unsigned int itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_TransformPrecision {}
private

Definition at line 173 of file itkMetaSceneConverter.h.

◆ m_WriteImagesInSeparateFile

template<unsigned int VDimension = 3, typename PixelType = unsigned char, typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
bool itk::MetaSceneConverter< VDimension, PixelType, TMeshTraits >::m_WriteImagesInSeparateFile {}
private

Definition at line 172 of file itkMetaSceneConverter.h.


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