Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::Surface Class Reference

Data class for storing polygonal surfaces (vtkPolyData). More...

#include <mitkSurface.h>

Inheritance diagram for mitk::Surface:
Collaboration diagram for mitk::Surface:

Public Types

typedef itk::ImageRegion< 5 > RegionType
 Region type used for pipeline region negotiation (5-dimensional). More...
 
- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 

Public Member Functions

 mitkClassMacro (Surface, BaseData)
 
Pointer Clone () const
 
void CalculateBoundingBox ()
 Compute the bounding box from all vtkPolyData objects across time steps. More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information (geometry, region) from another data object. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation on this surface (e.g., OpSURFACECHANGED). More...
 
void Expand (unsigned int timeSteps=1) override
 Expand the data to the given number of time steps. More...
 
const RegionType & GetLargestPossibleRegion () const
 Get the largest possible region. More...
 
virtual const RegionType & GetRequestedRegion () const
 Get the requested region. More...
 
unsigned int GetSizeOfPolyDataSeries () const
 Get the number of vtkPolyData objects in the time series. More...
 
virtual vtkPolyData * GetVtkPolyData (unsigned int t=0) const
 Get the vtkPolyData at time step t. More...
 
void Graft (const DataObject *data) override
 Graft data and information from another data object. More...
 
bool IsEmptyTimeStep (unsigned int t) const override
 Check whether time step t is empty (has no vtkPolyData). More...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 Print the surface information to the output stream. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Determine whether the requested region is outside the buffered region. More...
 
void SetRequestedRegion (const itk::DataObject *data) override
 Set the requested region to match another data object's requested region. More...
 
virtual void SetRequestedRegion (Surface::RegionType *region)
 Set the requested region from a RegionType pointer. More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Set the requested region to the largest possible region. More...
 
virtual void SetVtkPolyData (vtkPolyData *polydata, unsigned int t=0)
 Set the vtkPolyData for time step t. More...
 
virtual void Swap (Surface &other)
 Swap the contents of this surface with another surface. More...
 
void Update () override
 Trigger an update of all vtkPolyData objects in the pipeline. More...
 
void UpdateOutputInformation () override
 Update the output information (bounding box, geometry). More...
 
bool VerifyRequestedRegion () override
 Verify that the requested region is within the largest possible region. 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...
 
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 IsEmpty () const
 Check whether the object contains data at any time step. More...
 
virtual void SetGeometry (BaseGeometry *aGeometry3D)
 Set the BaseGeometry of the data, which will be referenced (not copied!). 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...
 
virtual void SetOrigin (const Point3D &origin)
 Convenience method for setting the origin of the BaseGeometry instances of all time steps. 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...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 mitkCloneMacro (Self)
 
 Surface ()
 
 ~Surface () override
 
 Surface (const Surface &other)
 
Surface & operator= (Surface other)
 
void ClearData () override
 reset to non-initialized state, release memory More...
 
void InitializeEmpty () override
 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...
 
- 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...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Member Functions inherited from mitk::Identifiable
virtual void SetUID (const UIDType &uid)
 

Additional Inherited Members

- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Detailed Description

Data class for storing polygonal surfaces (vtkPolyData).

Surface wraps a time series of vtkPolyData objects, providing one vtkPolyData per time step. It integrates into the MITK pipeline by implementing the region-based pipeline methods from BaseData and supports undo/redo via ExecuteOperation.

See also
mitk::BaseData, vtkPolyData
mitk::SurfaceOperation

Definition at line 36 of file mitkSurface.h.

Member Typedef Documentation

◆ RegionType

typedef itk::ImageRegion<5> mitk::Surface::RegionType

Region type used for pipeline region negotiation (5-dimensional).

Definition at line 40 of file mitkSurface.h.

Constructor & Destructor Documentation

◆ Surface() [1/2]

mitk::Surface::Surface ( )
protected

◆ ~Surface()

mitk::Surface::~Surface ( )
overrideprotected

◆ Surface() [2/2]

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

Member Function Documentation

◆ CalculateBoundingBox()

void mitk::Surface::CalculateBoundingBox ( )

Compute the bounding box from all vtkPolyData objects across time steps.

Updates the geometry bounds for each time step based on the vtkPolyData content.

◆ ClearData()

void mitk::Surface::ClearData ( )
overrideprotectedvirtual

reset to non-initialized state, release memory

Reimplemented from mitk::BaseData.

◆ Clone()

Pointer mitk::Surface::Clone ( ) const

◆ CopyInformation()

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

Copy information (geometry, region) from another data object.

Parameters
[in]dataThe data object to copy from. Must be castable to Surface.
Exceptions
mitk::Exceptionif data cannot be cast to Surface.

◆ ExecuteOperation()

void mitk::Surface::ExecuteOperation ( Operation *  operation)
overridevirtual

Execute an operation on this surface (e.g., OpSURFACECHANGED).

Parameters
[in]operationThe operation to execute. If the operation type is OpSURFACECHANGED, the contained vtkPolyData replaces the existing data at the specified time step.
See also
mitk::SurfaceOperation

Reimplemented from mitk::BaseData.

◆ Expand()

void mitk::Surface::Expand ( unsigned int  timeSteps = 1)
overridevirtual

Expand the data to the given number of time steps.

Resizes the internal vtkPolyData vector and the TimeGeometry. Does nothing if the current size already equals or exceeds timeSteps.

Parameters
[in]timeStepsThe desired number of time steps (default: 1).

Reimplemented from mitk::BaseData.

◆ GetLargestPossibleRegion()

const RegionType& mitk::Surface::GetLargestPossibleRegion ( ) const

Get the largest possible region.

Returns
Const reference to the largest possible region. The time dimension is set to the number of time steps.

◆ GetRequestedRegion()

virtual const RegionType& mitk::Surface::GetRequestedRegion ( ) const
virtual

Get the requested region.

Returns
Const reference to the currently requested region.

◆ GetSizeOfPolyDataSeries()

unsigned int mitk::Surface::GetSizeOfPolyDataSeries ( ) const

Get the number of vtkPolyData objects in the time series.

Returns
The number of time steps stored.

◆ GetVtkPolyData()

virtual vtkPolyData* mitk::Surface::GetVtkPolyData ( unsigned int  t = 0) const
virtual

Get the vtkPolyData at time step t.

If the data is not available but a source exists, the pipeline is updated to produce the requested time step.

Parameters
[in]tTime step (default: 0).
Returns
Pointer to the vtkPolyData, or nullptr if not available.

◆ Graft()

void mitk::Surface::Graft ( const DataObject *  data)
override

Graft data and information from another data object.

Deep-copies all vtkPolyData objects from the source surface.

Parameters
[in]dataThe data object to graft from. Must be castable to Surface.
Exceptions
mitk::Exceptionif data cannot be cast to Surface.

◆ InitializeEmpty()

void mitk::Surface::InitializeEmpty ( )
overrideprotectedvirtual

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.

Reimplemented from mitk::BaseData.

◆ IsEmptyTimeStep()

bool mitk::Surface::IsEmptyTimeStep ( unsigned int  t) const
overridevirtual

Check whether time step t is empty (has no vtkPolyData).

Parameters
[in]tThe time step to check.
Returns
True if the vtkPolyData at time step t is nullptr.

Reimplemented from mitk::BaseData.

◆ mitkClassMacro()

mitk::Surface::mitkClassMacro ( Surface  ,
BaseData   
)

◆ mitkCloneMacro()

mitk::Surface::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::Surface::New ( )
static

◆ operator=()

Surface& mitk::Surface::operator= ( Surface  other)
protected

◆ PrintSelf()

void mitk::Surface::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
override

Print the surface information to the output stream.

Parameters
[in,out]osThe output stream.
[in]indentThe indentation level.

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::Surface::RequestedRegionIsOutsideOfTheBufferedRegion ( )
overridevirtual

Determine whether the requested region is outside the buffered region.

Returns
True if any requested time step has no vtkPolyData.

Implements mitk::BaseData.

◆ SetRequestedRegion() [1/2]

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

Set the requested region to match another data object's requested region.

Parameters
[in]dataThe data object whose region to match. Must be castable to Surface.
Exceptions
mitk::Exceptionif data cannot be cast to Surface.

Implements mitk::BaseData.

◆ SetRequestedRegion() [2/2]

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

Set the requested region from a RegionType pointer.

Parameters
[in]regionPointer to the region. Must not be nullptr.
Exceptions
mitk::Exceptionif region is nullptr.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::Surface::SetRequestedRegionToLargestPossibleRegion ( )
overridevirtual

Set the requested region to the largest possible region.

Implements mitk::BaseData.

◆ SetVtkPolyData()

virtual void mitk::Surface::SetVtkPolyData ( vtkPolyData *  polydata,
unsigned int  t = 0 
)
virtual

Set the vtkPolyData for time step t.

The surface takes a reference to the provided polydata. If the same polydata object is already set at the given time step, no action is taken.

Parameters
[in]polydataThe vtkPolyData to set.
[in]tTime step (default: 0). The surface is expanded if necessary.

◆ Swap()

virtual void mitk::Surface::Swap ( Surface &  other)
virtual

Swap the contents of this surface with another surface.

Parameters
[in,out]otherThe surface to swap with.

◆ Update()

void mitk::Surface::Update ( )
override

Trigger an update of all vtkPolyData objects in the pipeline.

◆ UpdateOutputInformation()

void mitk::Surface::UpdateOutputInformation ( )
override

Update the output information (bounding box, geometry).

◆ VerifyRequestedRegion()

bool mitk::Surface::VerifyRequestedRegion ( )
overridevirtual

Verify that the requested region is within the largest possible region.

Returns
True if the requested region is valid.

Implements mitk::BaseData.

Reimplemented in mitk::BoundingObjectGroup.


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