ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | List of all members
itk::ImportImageContainer< TElementIdentifier, TElement > Class Template Reference

#include <itkImportImageContainer.h>

+ Inheritance diagram for itk::ImportImageContainer< TElementIdentifier, TElement >:
+ Collaboration diagram for itk::ImportImageContainer< TElementIdentifier, TElement >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Element = TElement
 
using ElementIdentifier = TElementIdentifier
 
using Pointer = SmartPointer< Self >
 
using Self = ImportImageContainer
 
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

ElementIdentifier Capacity () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
TElement * GetBufferPointer ()
 
TElement * GetImportPointer ()
 
virtual const char * GetNameOfClass () const
 
void Initialize ()
 
TElement & operator[] (const ElementIdentifier id)
 
const TElement & operator[] (const ElementIdentifier id) const
 
void Reserve (ElementIdentifier size, const bool UseDefaultConstructor=false)
 
void SetImportPointer (TElement *ptr, TElementIdentifier num, bool LetContainerManageMemory=false)
 
ElementIdentifier Size () const
 
void Squeeze ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) 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)
 
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 ()
 
TElement * m_ImportPointer
 
TElementIdentifier m_Size
 
TElementIdentifier m_Capacity
 
bool m_ContainerManageMemory
 
virtual void SetContainerManageMemory (bool _arg)
 
virtual bool GetContainerManageMemory () const
 
virtual void ContainerManageMemoryOn ()
 
virtual void ContainerManageMemoryOff ()
 
 ImportImageContainer ()
 
 ~ImportImageContainer () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual TElement * AllocateElements (ElementIdentifier size, bool UseDefaultConstructor=false) const
 
virtual void DeallocateManagedMemory ()
 
virtual void SetSize (TElementIdentifier _arg)
 
virtual void SetCapacity (TElementIdentifier _arg)
 
void SetImportPointer (TElement *ptr)
 

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- 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 ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

template<typename TElementIdentifier, typename TElement>
class itk::ImportImageContainer< TElementIdentifier, TElement >

Defines an itk::Image front-end to a standard C-array.

Defines an itk::Image front-end to a standard C-array. This container conforms to the ImageContainerInterface. This is a full-fleged Object, so there is modification time, debug, and reference count information.

Template Parameters
TElementIdentifierAn INTEGRAL type for use in indexing the imported buffer.
TElementThe element type stored in the container.

Definition at line 45 of file itkImportImageContainer.h.

Member Typedef Documentation

◆ ConstPointer

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::ConstPointer = SmartPointer<const Self>

Definition at line 54 of file itkImportImageContainer.h.

◆ Element

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::Element = TElement

Definition at line 58 of file itkImportImageContainer.h.

◆ ElementIdentifier

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::ElementIdentifier = TElementIdentifier

Save the template parameters.

Definition at line 57 of file itkImportImageContainer.h.

◆ Pointer

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::Pointer = SmartPointer<Self>

Definition at line 53 of file itkImportImageContainer.h.

◆ Self

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::Self = ImportImageContainer

Standard class type aliases.

Definition at line 51 of file itkImportImageContainer.h.

◆ Superclass

template<typename TElementIdentifier , typename TElement >
using itk::ImportImageContainer< TElementIdentifier, TElement >::Superclass = Object

Definition at line 52 of file itkImportImageContainer.h.

Constructor & Destructor Documentation

◆ ImportImageContainer()

template<typename TElementIdentifier , typename TElement >
itk::ImportImageContainer< TElementIdentifier, TElement >::ImportImageContainer ( )
protected

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ ~ImportImageContainer()

template<typename TElementIdentifier , typename TElement >
itk::ImportImageContainer< TElementIdentifier, TElement >::~ImportImageContainer ( )
overrideprotected

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Member Function Documentation

◆ AllocateElements()

template<typename TElementIdentifier , typename TElement >
virtual TElement* itk::ImportImageContainer< TElementIdentifier, TElement >::AllocateElements ( ElementIdentifier  size,
bool  UseDefaultConstructor = false 
) const
protectedvirtual

Allocates elements of the array. If UseDefaultConstructor is true, then the default constructor is used to initialize each element. POD date types initialize to zero.

◆ Capacity()

template<typename TElementIdentifier , typename TElement >
ElementIdentifier itk::ImportImageContainer< TElementIdentifier, TElement >::Capacity ( ) const
inline

Get the capacity of the container.

Definition at line 98 of file itkImportImageContainer.h.

◆ ContainerManageMemoryOff()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::ContainerManageMemoryOff ( )
virtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ ContainerManageMemoryOn()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::ContainerManageMemoryOn ( )
virtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ CreateAnother()

template<typename TElementIdentifier , typename TElement >
virtual::itk::LightObject::Pointer itk::ImportImageContainer< TElementIdentifier, TElement >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

◆ DeallocateManagedMemory()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::DeallocateManagedMemory ( )
protectedvirtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ GetBufferPointer()

template<typename TElementIdentifier , typename TElement >
TElement* itk::ImportImageContainer< TElementIdentifier, TElement >::GetBufferPointer ( )
inline

Return a pointer to the beginning of the buffer. This is used by the image iterator class.

Definition at line 91 of file itkImportImageContainer.h.

◆ GetContainerManageMemory()

template<typename TElementIdentifier , typename TElement >
virtual bool itk::ImportImageContainer< TElementIdentifier, TElement >::GetContainerManageMemory ( ) const
virtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ GetImportPointer()

template<typename TElementIdentifier , typename TElement >
TElement* itk::ImportImageContainer< TElementIdentifier, TElement >::GetImportPointer ( )
inline

Get the pointer from which the image data is imported.

Definition at line 68 of file itkImportImageContainer.h.

◆ GetNameOfClass()

template<typename TElementIdentifier , typename TElement >
virtual const char* itk::ImportImageContainer< TElementIdentifier, TElement >::GetNameOfClass ( ) const
virtual

Standard part of every itk Object.

Reimplemented from itk::Object.

◆ Initialize()

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::Initialize ( )

Tell the container to release any of its allocated memory.

◆ New()

template<typename TElementIdentifier , typename TElement >
static Pointer itk::ImportImageContainer< TElementIdentifier, TElement >::New ( )
static

Method for creation through the object factory.

◆ operator[]() [1/2]

template<typename TElementIdentifier , typename TElement >
TElement& itk::ImportImageContainer< TElementIdentifier, TElement >::operator[] ( const ElementIdentifier  id)
inline

Index operator. This version can be an lvalue.

Definition at line 83 of file itkImportImageContainer.h.

◆ operator[]() [2/2]

template<typename TElementIdentifier , typename TElement >
const TElement& itk::ImportImageContainer< TElementIdentifier, TElement >::operator[] ( const ElementIdentifier  id) const
inline

Index operator. This version can only be an rvalue

Definition at line 86 of file itkImportImageContainer.h.

◆ PrintSelf()

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

PrintSelf routine. Normally this is a protected internal method. It is made public here so that Image can call this method. Users should not call this method but should call Print() instead.

Reimplemented from itk::LightObject.

◆ Reserve()

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::Reserve ( ElementIdentifier  size,
const bool  UseDefaultConstructor = false 
)

Tell the container to allocate enough memory to allow at least as many elements as the size given to be stored. If new memory needs to be allocated, the contents of the old buffer are copied to the new area. The old buffer is deleted if the original pointer was passed in using "LetContainerManageMemory"=true. The new buffer's memory management will be handled by the container from that point on.

In general, Reserve should not change the usable elements of the container. However, in this particular case, Reserve as a Resize semantics that is kept for backward compatibility reasons.

If UseDefaultConstructor is true, then * the default constructor is used to initialize each element. POD date types initialize to zero.

See also
SetImportPointer()

◆ SetCapacity()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::SetCapacity ( TElementIdentifier  _arg)
protectedvirtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ SetContainerManageMemory()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::SetContainerManageMemory ( bool  _arg)
virtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ SetImportPointer() [1/2]

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::SetImportPointer ( TElement *  ptr)
inlineprotected

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Definition at line 197 of file itkImportImageContainer.h.

◆ SetImportPointer() [2/2]

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::SetImportPointer ( TElement *  ptr,
TElementIdentifier  num,
bool  LetContainerManageMemory = false 
)

Set the pointer from which the image data is imported. "num" is the number of pixels in the block of memory. If "LetContainerManageMemory" is false, then the application retains the responsibility of freeing the memory for this image data. If "LetContainerManageMemory" is true, then this class will free the memory when this object is destroyed.

◆ SetSize()

template<typename TElementIdentifier , typename TElement >
virtual void itk::ImportImageContainer< TElementIdentifier, TElement >::SetSize ( TElementIdentifier  _arg)
protectedvirtual

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

◆ Size()

template<typename TElementIdentifier , typename TElement >
ElementIdentifier itk::ImportImageContainer< TElementIdentifier, TElement >::Size ( ) const
inline

Get the number of elements currently stored in the container.

Definition at line 105 of file itkImportImageContainer.h.

◆ Squeeze()

template<typename TElementIdentifier , typename TElement >
void itk::ImportImageContainer< TElementIdentifier, TElement >::Squeeze ( )

Tell the container to try to minimize its memory usage for storage of the current number of elements. If new memory is allocated, the contents of old buffer are copied to the new area. The previous buffer is deleted if the original pointer was in using "LetContainerManageMemory"=true. The new buffer's memory management will be handled by the container from that point on.

Member Data Documentation

◆ m_Capacity

template<typename TElementIdentifier , typename TElement >
TElementIdentifier itk::ImportImageContainer< TElementIdentifier, TElement >::m_Capacity
private

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Definition at line 205 of file itkImportImageContainer.h.

◆ m_ContainerManageMemory

template<typename TElementIdentifier , typename TElement >
bool itk::ImportImageContainer< TElementIdentifier, TElement >::m_ContainerManageMemory
private

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Definition at line 206 of file itkImportImageContainer.h.

◆ m_ImportPointer

template<typename TElementIdentifier , typename TElement >
TElement* itk::ImportImageContainer< TElementIdentifier, TElement >::m_ImportPointer
private

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Definition at line 203 of file itkImportImageContainer.h.

◆ m_Size

template<typename TElementIdentifier , typename TElement >
TElementIdentifier itk::ImportImageContainer< TElementIdentifier, TElement >::m_Size
private

These methods allow to define whether upon destruction of this class the memory buffer should be released or not. Setting it to true (or ON) makes that this class will take care of memory release. Setting it to false (or OFF) will prevent the destructor from deleting the memory buffer. This is desirable only when the data is intended to be used by external applications. Note that the normal logic of this class set the value of the boolean flag. This may override your setting if you call this methods prematurely.

Warning
Improper use of these methods will result in memory leaks

Definition at line 204 of file itkImportImageContainer.h.


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