Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::SlicedData Class Referenceabstract

Super class of data objects consisting of slices. More...

#include <mitkSlicedData.h>

Inheritance diagram for mitk::SlicedData:
Collaboration diagram for mitk::SlicedData:

Public Types

typedef itk::ImageRegion< RegionDimension > RegionType
 
typedef itk::Index< RegionDimension > IndexType
 
typedef IndexType::IndexValueType IndexValueType
 
typedef itk::Offset< RegionDimension > OffsetType
 
typedef OffsetType::OffsetValueType OffsetValueType
 
typedef itk::Size< RegionDimension > SizeType
 
typedef SizeType::SizeValueType SizeValueType
 
- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 

Public Member Functions

 mitkClassMacro (SlicedData, BaseData)
 
 itkStaticConstMacro (RegionDimension, unsigned int, 5)
 
void UpdateOutputInformation () override
 Update the information for this DataObject so it can be used as an output of a ProcessObject. More...
 
void PrepareForNewData () override
 Prepare the data object to receive new data. More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Set the RequestedRegion to the LargestPossibleRegion. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Determine whether the RequestedRegion is outside of the BufferedRegion. More...
 
bool VerifyRequestedRegion () override
 Verify that the RequestedRegion is within the LargestPossibleRegion. More...
 
void SetRequestedRegion (const itk::DataObject *data) override
 Set the requested region from another data object. More...
 
virtual void SetRequestedRegion (SlicedData::RegionType *region)
 Set the requested region from a RegionType pointer. More...
 
void SetLargestPossibleRegion (SlicedData::RegionType *region)
 Set the largest possible region. More...
 
const RegionType & GetLargestPossibleRegion () const
 Get the largest possible region. More...
 
virtual const RegionType & GetRequestedRegion () const
 Get the region object that defines the size and starting index for the requested region (i.e., the part of the data to be operated on). More...
 
virtual bool IsSliceSet (int s=0, int t=0, int n=0) const =0
 Check whether slice s at time t in channel n is set. More...
 
virtual bool IsVolumeSet (int t=0, int n=0) const =0
 Check whether volume at time t in channel n is set. More...
 
virtual bool IsChannelSet (int n=0) const =0
 Check whether channel n is set. More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information from the specified data set. More...
 
unsigned int GetNumberOfChannels () const
 Get the number of channels. More...
 
SlicedGeometry3D * GetSlicedGeometry (unsigned int t=0) const
 Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it). More...
 
const SlicedGeometry3D * GetUpdatedSlicedGeometry (unsigned int t=0)
 Convenience access method that returns an up-to-date SlicedGeometry3D. More...
 
void SetGeometry (BaseGeometry *aGeometry3D) override
 Set the BaseGeometry of the data, which will be referenced (not copied!). More...
 
void SetOrigin (const Point3D &origin) override
 Convenience method for setting the origin of the SlicedGeometry3D instances of all time steps. More...
 
virtual void SetSpacing (const ScalarType aSpacing[])
 Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps. More...
 
virtual void SetSpacing (mitk::Vector3D aSpacing)
 Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps. More...
 
- Public Member Functions inherited from mitk::BaseData
 mitkClassMacroItkParent (BaseData, itk::DataObject)
 
BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
 Get a const property by its key. More...
 
std::vector< std::string > GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override
 Get all property keys stored in the property list. More...
 
std::vector< std::string > GetPropertyContextNames () const override
 Get the names of all property contexts. More...
 
BaseProperty * GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
 Get a non-const property by its key. More...
 
void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Set a property in the property list. More...
 
void RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Remove a property from the property list. More...
 
const mitk::TimeGeometry * GetTimeGeometry () const
 Return the TimeGeometry of the data as const pointer. More...
 
mitk::TimeGeometry * GetTimeGeometry ()
 Return the TimeGeometry of the data as non-const pointer. More...
 
const mitk::TimeGeometry * GetUpdatedTimeGeometry ()
 Return the TimeGeometry of the data after ensuring it is up-to-date. More...
 
virtual void Expand (unsigned int timeSteps)
 Expand the TimeGeometry to a number of time steps. More...
 
const mitk::BaseGeometry * GetUpdatedGeometry (int t=0)
 Return the BaseGeometry of the data at time step t after ensuring it is up-to-date. More...
 
mitk::BaseGeometry * GetGeometry (int t=0) const
 Return the BaseGeometry of the data at time step t as a non-const pointer. More...
 
void UpdateOutputInformation () override
 Update the information for this BaseData so that it can be used as an output of a BaseProcess. More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information from the specified data set. More...
 
virtual bool IsInitialized () const
 Check whether the data has been initialized. More...
 
virtual void Clear ()
 Reset the data object by calling ClearData() and InitializeEmpty(). More...
 
virtual bool IsEmptyTimeStep (unsigned int t) const
 Check whether the object contains data at the specified time step. More...
 
virtual bool IsEmpty () const
 Check whether the object contains data at any time step. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation on this data object. More...
 
virtual void SetTimeGeometry (TimeGeometry *geometry)
 Set the TimeGeometry of the data, which will be referenced (not copied!). More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D)
 Set a clone of the provided geometry as the BaseGeometry of the data. More...
 
virtual void SetClonedTimeGeometry (const TimeGeometry *geometry)
 Set a clone of the provided TimeGeometry as the TimeGeometry of the data. More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time)
 Set a clone of the provided geometry as the BaseGeometry of a given time step. More...
 
mitk::PropertyList::Pointer GetPropertyList () const
 Get the data's property list. More...
 
void SetPropertyList (PropertyList *propertyList)
 Set the data's property list, replacing the existing one. More...
 
mitk::BaseProperty::Pointer GetProperty (const char *propertyKey) const
 Get a property by its key from the PropertyList. More...
 
void SetProperty (const char *propertyKey, BaseProperty *property)
 Set a property in the PropertyList. More...
 
itk::SmartPointer< mitk::BaseDataSource > GetSource () const
 Get the process object that generated this data object. More...
 
unsigned int GetTimeSteps () const
 Get the number of time steps from the TimeGeometry. More...
 
itk::ModifiedTimeType GetMTime () const override
 Get the modification time of this data object or its geometry, whichever was modified most recently. More...
 
void Graft (const DataObject *) override
 Graft data and information from another data object. More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 
- Public Member Functions inherited from mitk::Identifiable
 Identifiable ()
 Default constructor. Generates a new random UID. More...
 
 Identifiable (const UIDType &uid)
 Construct with a pre-existing UID. More...
 
 Identifiable (const Identifiable &)=delete
 Copy construction is deleted to prevent UID duplication. More...
 
 Identifiable (Identifiable &&) noexcept
 Move constructor. Transfers ownership of the UID. More...
 
virtual ~Identifiable ()
 Virtual destructor. More...
 
Identifiable & operator= (const Identifiable &)=delete
 Copy assignment is deleted to prevent UID duplication. More...
 
Identifiable & operator= (Identifiable &&other) noexcept
 Move assignment operator. Transfers ownership of the UID. More...
 
virtual UIDType GetUID () const
 Get the unique identifier of this object. More...
 
UIDType GetRuntimeUID () const noexcept
 Get a runtime-unique ID for this object instance. More...
 
- Public Member Functions inherited from mitk::IPropertyOwner
 ~IPropertyOwner () override
 
virtual bool PropertyIsOwned (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const
 Checks if a certain property exists. More...
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 Virtual destructor. More...
 

Protected Member Functions

 SlicedData ()
 
 SlicedData (const SlicedData &other)
 
 ~SlicedData () override
 
- Protected Member Functions inherited from mitk::BaseData
 BaseData ()
 
 BaseData (const BaseData &other)
 
 ~BaseData () override
 
virtual void InitializeTimeGeometry (unsigned int timeSteps=1)
 Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More...
 
virtual void ClearData ()
 reset to non-initialized state, release memory More...
 
virtual void InitializeEmpty ()
 Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Member Functions inherited from mitk::Identifiable
virtual void SetUID (const UIDType &uid)
 

Protected Attributes

RegionType m_LargestPossibleRegion
 
RegionType m_RequestedRegion
 
bool m_RequestedRegionInitialized
 
RegionType m_BufferedRegion
 
bool m_UseLargestPossibleRegion
 
- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Detailed Description

Super class of data objects consisting of slices.

SlicedData is the common base class for data objects that consist of slices, such as images (mitk::Image) or stacks of contours. GetGeometry() returns a BaseGeometry containing PlaneGeometry objects, and the data geometry is of type SlicedGeometry3D or a sub-class thereof.

SlicedData extends BaseData with region-based pipeline support using itk::ImageRegion<5>, where the five dimensions represent x, y, slices (z), time steps, and channels.

See also
mitk::Image, mitk::BaseData
mitk::SlicedGeometry3D, mitk::PlaneGeometry

Definition at line 44 of file mitkSlicedData.h.

Member Typedef Documentation

◆ IndexType

typedef itk::Index<RegionDimension> mitk::SlicedData::IndexType

Index typedef support. An index is used to access pixel values.

Definition at line 55 of file mitkSlicedData.h.

◆ IndexValueType

typedef IndexType::IndexValueType mitk::SlicedData::IndexValueType

Definition at line 56 of file mitkSlicedData.h.

◆ OffsetType

typedef itk::Offset<RegionDimension> mitk::SlicedData::OffsetType

Offset typedef support. An offset represent relative position between indices.

Definition at line 60 of file mitkSlicedData.h.

◆ OffsetValueType

typedef OffsetType::OffsetValueType mitk::SlicedData::OffsetValueType

Definition at line 61 of file mitkSlicedData.h.

◆ RegionType

typedef itk::ImageRegion<RegionDimension> mitk::SlicedData::RegionType

Region typedef support. A region is used to specify a subset of a SlicedData.

Definition at line 52 of file mitkSlicedData.h.

◆ SizeType

typedef itk::Size<RegionDimension> mitk::SlicedData::SizeType

Size typedef support. A size is used to define region bounds.

Definition at line 64 of file mitkSlicedData.h.

◆ SizeValueType

typedef SizeType::SizeValueType mitk::SlicedData::SizeValueType

Definition at line 65 of file mitkSlicedData.h.

Constructor & Destructor Documentation

◆ SlicedData() [1/2]

mitk::SlicedData::SlicedData ( )
protected

◆ SlicedData() [2/2]

mitk::SlicedData::SlicedData ( const SlicedData &  other)
protected

◆ ~SlicedData()

mitk::SlicedData::~SlicedData ( )
overrideprotected

Member Function Documentation

◆ CopyInformation()

void mitk::SlicedData::CopyInformation ( const itk::DataObject *  data)
override

Copy information from the specified data set.

Copies the TimeGeometry, PropertyList, and LargestPossibleRegion from the given data object. Calls the superclass version.

Parameters
[in]dataThe data object to copy from. Must be castable to SlicedData.
Exceptions
itk::ExceptionObjectif data cannot be cast to SlicedData.

◆ GetLargestPossibleRegion()

const RegionType& mitk::SlicedData::GetLargestPossibleRegion ( ) const
inline

Get the largest possible region.

Returns
Const reference to the largest possible region.

Definition at line 149 of file mitkSlicedData.h.

◆ GetNumberOfChannels()

unsigned int mitk::SlicedData::GetNumberOfChannels ( ) const
inline

Get the number of channels.

The number of channels is derived from the fifth dimension of the LargestPossibleRegion.

Returns
The number of channels.

Definition at line 205 of file mitkSlicedData.h.

◆ GetRequestedRegion()

virtual const RegionType& mitk::SlicedData::GetRequestedRegion ( ) const
inlinevirtual

Get the region object that defines the size and starting index for the requested region (i.e., the part of the data to be operated on).

Returns
Const reference to the requested region.

Definition at line 157 of file mitkSlicedData.h.

◆ GetSlicedGeometry()

SlicedGeometry3D* mitk::SlicedData::GetSlicedGeometry ( unsigned int  t = 0) const

Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it).

Warning
No update will be called. Normally used in GenerateOutputInformation of subclasses of BaseProcess.
Parameters
[in]tThe time step for which to retrieve the geometry (default: 0).
Returns
Pointer to the SlicedGeometry3D, or nullptr if the TimeGeometry is not set.
See also
GetUpdatedSlicedGeometry

◆ GetUpdatedSlicedGeometry()

const SlicedGeometry3D* mitk::SlicedData::GetUpdatedSlicedGeometry ( unsigned int  t = 0)

Convenience access method that returns an up-to-date SlicedGeometry3D.

Before returning, this method ensures the geometry is up-to-date by calling SetRequestedRegionToLargestPossibleRegion() and UpdateOutputInformation().

Parameters
[in]tThe time step for which to retrieve the geometry (default: 0).
Returns
Const pointer to the up-to-date SlicedGeometry3D.
See also
GetSlicedGeometry

◆ IsChannelSet()

virtual bool mitk::SlicedData::IsChannelSet ( int  n = 0) const
pure virtual

Check whether channel n is set.

Parameters
[in]nChannel number (default: 0).
Returns
True if the channel data is available.

Implemented in mitk::MultiLabelSegmentation, and mitk::Image.

◆ IsSliceSet()

virtual bool mitk::SlicedData::IsSliceSet ( int  s = 0,
int  t = 0,
int  n = 0 
) const
pure virtual

Check whether slice s at time t in channel n is set.

Parameters
[in]sSlice index (default: 0).
[in]tTime step (default: 0).
[in]nChannel number (default: 0).
Returns
True if the slice data is available.

Implemented in mitk::MultiLabelSegmentation, and mitk::Image.

◆ IsVolumeSet()

virtual bool mitk::SlicedData::IsVolumeSet ( int  t = 0,
int  n = 0 
) const
pure virtual

Check whether volume at time t in channel n is set.

Parameters
[in]tTime step (default: 0).
[in]nChannel number (default: 0).
Returns
True if the volume data is available.

Implemented in mitk::MultiLabelSegmentation, and mitk::Image.

◆ itkStaticConstMacro()

mitk::SlicedData::itkStaticConstMacro ( RegionDimension  ,
unsigned int  ,
5   
)

◆ mitkClassMacro()

mitk::SlicedData::mitkClassMacro ( SlicedData  ,
BaseData   
)

◆ PrepareForNewData()

void mitk::SlicedData::PrepareForNewData ( )
override

Prepare the data object to receive new data.

Releases existing data if the pipeline time has changed, ensuring a clean state for subsequent writes.

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::SlicedData::RequestedRegionIsOutsideOfTheBufferedRegion ( )
overridevirtual

Determine whether the RequestedRegion is outside of the BufferedRegion.

Returns true if at least one requested slice, volume, or channel is not currently buffered. Used by the pipeline mechanism to determine whether re-execution is needed.

Returns
True if the requested region is not fully contained in the buffered region.

Implements mitk::BaseData.

◆ SetGeometry()

void mitk::SlicedData::SetGeometry ( BaseGeometry *  aGeometry3D)
overridevirtual

Set the BaseGeometry of the data, which will be referenced (not copied!).

The geometry must be a SlicedGeometry3D or a PlaneGeometry that can be wrapped in a SlicedGeometry3D. If a PlaneGeometry is provided, it will be used to initialize an evenly spaced SlicedGeometry3D.

Warning
This method will normally be called internally by sub-classes of SlicedData during initialization.
Parameters
[in]aGeometry3DThe geometry to set. May be nullptr to clear the geometry.

Reimplemented from mitk::BaseData.

◆ SetLargestPossibleRegion()

void mitk::SlicedData::SetLargestPossibleRegion ( SlicedData::RegionType *  region)

Set the largest possible region.

The largest possible region is the entire region occupied by the data object. The largest possible region should always be bigger than or equal to the requested region of any operation.

Parameters
[in]regionPointer to the region to set. Must not be nullptr.
Exceptions
itk::ExceptionObjectif region is nullptr.

◆ SetOrigin()

void mitk::SlicedData::SetOrigin ( const Point3D &  origin)
overridevirtual

Convenience method for setting the origin of the SlicedGeometry3D instances of all time steps.

In case the SlicedGeometry3D is evenly spaced, the origin of the first slice is set to origin and the sliced geometry is re-initialized.

Parameters
[in]originThe new origin in world coordinates.
See also
mitk::BaseData::SetOrigin

Reimplemented from mitk::BaseData.

◆ SetRequestedRegion() [1/2]

void mitk::SlicedData::SetRequestedRegion ( const itk::DataObject *  data)
overridevirtual

Set the requested region from another data object.

Parameters
[in]dataThe data object whose requested region will be matched. Must be castable to SlicedData.
Exceptions
itk::ExceptionObjectif data cannot be cast to SlicedData.

Implements mitk::BaseData.

◆ SetRequestedRegion() [2/2]

virtual void mitk::SlicedData::SetRequestedRegion ( SlicedData::RegionType *  region)
virtual

Set the requested region from a RegionType pointer.

Parameters
[in]regionPointer to the region to use. Must not be nullptr.
Exceptions
itk::ExceptionObjectif region is nullptr.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::SlicedData::SetRequestedRegionToLargestPossibleRegion ( )
overridevirtual

Set the RequestedRegion to the LargestPossibleRegion.

Forces a filter to produce all of the output in one execution (i.e., no streaming) on the next call to Update().

Implements mitk::BaseData.

◆ SetSpacing() [1/2]

virtual void mitk::SlicedData::SetSpacing ( const ScalarType  aSpacing[])
virtual

Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps.

Parameters
[in]aSpacingArray of three spacing values [x, y, z].
See also
SetSpacing(mitk::Vector3D)

◆ SetSpacing() [2/2]

virtual void mitk::SlicedData::SetSpacing ( mitk::Vector3D  aSpacing)
virtual

Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps.

Parameters
[in]aSpacingVector of three spacing values [x, y, z].
See also
SetSpacing(const ScalarType[])

◆ UpdateOutputInformation()

void mitk::SlicedData::UpdateOutputInformation ( )
override

Update the information for this DataObject so it can be used as an output of a ProcessObject.

Propagates information through the pipeline and initializes metadata. Calls the source's UpdateOutputInformation() and, if there is no source, sets the use-largest-possible-region flag. Also initializes the requested region if it has not yet been set.

◆ VerifyRequestedRegion()

bool mitk::SlicedData::VerifyRequestedRegion ( )
overridevirtual

Verify that the RequestedRegion is within the LargestPossibleRegion.

If the RequestedRegion is not within the LargestPossibleRegion, the filter cannot satisfy the request.

Returns
True if the request can be satisfied, false otherwise.

Implements mitk::BaseData.

Member Data Documentation

◆ m_BufferedRegion

RegionType mitk::SlicedData::m_BufferedRegion
protected

Definition at line 287 of file mitkSlicedData.h.

◆ m_LargestPossibleRegion

RegionType mitk::SlicedData::m_LargestPossibleRegion
protected

Definition at line 282 of file mitkSlicedData.h.

◆ m_RequestedRegion

RegionType mitk::SlicedData::m_RequestedRegion
mutableprotected

Definition at line 284 of file mitkSlicedData.h.

◆ m_RequestedRegionInitialized

bool mitk::SlicedData::m_RequestedRegionInitialized
mutableprotected

Definition at line 285 of file mitkSlicedData.h.

◆ m_UseLargestPossibleRegion

bool mitk::SlicedData::m_UseLargestPossibleRegion
protected

Definition at line 288 of file mitkSlicedData.h.


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