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

A collection of ContourModel instances managed as a single BaseData object. More...

#include <mitkContourModelSet.h>

Inheritance diagram for mitk::ContourModelSet:
Collaboration diagram for mitk::ContourModelSet:

Public Types

typedef std::deque< mitk::ContourModel::Pointer > ContourModelListType
 Container type for storing ContourModel smart pointers. More...
 
typedef ContourModelListType::iterator ContourModelSetIterator
 Iterator type for traversing the contour model collection. More...
 
- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 

Public Member Functions

 mitkClassMacro (ContourModelSet, mitk::BaseData)
 
Pointer Clone () const
 
virtual ContourModelSetIterator Begin ()
 Return an iterator to the first contour model in the set. More...
 
virtual ContourModelSetIterator End ()
 Return an iterator past the last contour model in the set. More...
 
virtual int GetSize () const
 Return the number of contour models in the set. More...
 
virtual void AddContourModel (mitk::ContourModel &contourModel)
 Add a contour model to the set by reference. More...
 
virtual void AddContourModel (mitk::ContourModel::Pointer contourModel)
 Add a contour model to the set by smart pointer. More...
 
virtual mitk::ContourModel * GetContourModelAt (int index) const
 Return the contour model at the given index. More...
 
ContourModelListType * GetContourModelList ()
 Return a pointer to the internal contour model container. More...
 
bool IsEmpty () const override
 Check whether the set contains no contour models. More...
 
virtual bool RemoveContourModel (mitk::ContourModel *contourModel)
 Remove a specific contour model from the set. More...
 
virtual bool RemoveContourModelAt (int index)
 Remove the contour model at the given index. More...
 
void Clear () override
 Remove all contour models from the set. 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 *) override
 Set the requested region from this data object to match the requested region of the data object passed in as a parameter. More...
 
void UpdateOutputInformation () override
 Update the OutputInformation of a ContourModel object. 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 bool IsEmptyTimeStep (unsigned int t) const
 Check whether the object contains data at the specified time step. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation on this data object. 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)
 
 ContourModelSet ()
 
 ContourModelSet (const mitk::ContourModelSet &other)
 
 ~ContourModelSet () override
 
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...
 
virtual void ClearData ()
 reset to non-initialized state, release memory 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

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

Detailed Description

A collection of ContourModel instances managed as a single BaseData object.

ContourModelSet aggregates multiple mitk::ContourModel objects into a single data structure that integrates with the MITK data management framework. It provides methods to add, remove, and iterate over the contained contour models.

The bounding box is automatically updated when contour models are added or removed.

See also
ContourModel, ContourModelSetSource, ContourModelSetMapper2D, ContourModelSetMapper3D

Definition at line 35 of file mitkContourModelSet.h.

Member Typedef Documentation

◆ ContourModelListType

typedef std::deque<mitk::ContourModel::Pointer> mitk::ContourModelSet::ContourModelListType

Container type for storing ContourModel smart pointers.

Definition at line 45 of file mitkContourModelSet.h.

◆ ContourModelSetIterator

typedef ContourModelListType::iterator mitk::ContourModelSet::ContourModelSetIterator

Iterator type for traversing the contour model collection.

Definition at line 47 of file mitkContourModelSet.h.

Constructor & Destructor Documentation

◆ ContourModelSet() [1/2]

mitk::ContourModelSet::ContourModelSet ( )
protected

◆ ContourModelSet() [2/2]

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

◆ ~ContourModelSet()

mitk::ContourModelSet::~ContourModelSet ( )
overrideprotected

Member Function Documentation

◆ AddContourModel() [1/2]

virtual void mitk::ContourModelSet::AddContourModel ( mitk::ContourModel &  contourModel)
virtual

Add a contour model to the set by reference.

Parameters
[in]contourModelThe ContourModel to add.

◆ AddContourModel() [2/2]

virtual void mitk::ContourModelSet::AddContourModel ( mitk::ContourModel::Pointer  contourModel)
virtual

Add a contour model to the set by smart pointer.

Parameters
[in]contourModelSmart pointer to the ContourModel to add.

◆ Begin()

virtual ContourModelSetIterator mitk::ContourModelSet::Begin ( )
inlinevirtual

Return an iterator to the first contour model in the set.

Returns
Iterator pointing to the beginning of the container.

Definition at line 54 of file mitkContourModelSet.h.

◆ Clear()

void mitk::ContourModelSet::Clear ( )
overridevirtual

Remove all contour models from the set.

Postcondition
IsEmpty() returns true.

Reimplemented from mitk::BaseData.

◆ Clone()

Pointer mitk::ContourModelSet::Clone ( ) const

◆ End()

virtual ContourModelSetIterator mitk::ContourModelSet::End ( )
inlinevirtual

Return an iterator past the last contour model in the set.

Returns
Iterator pointing past the end of the container.

Definition at line 59 of file mitkContourModelSet.h.

◆ GetContourModelAt()

virtual mitk::ContourModel* mitk::ContourModelSet::GetContourModelAt ( int  index) const
virtual

Return the contour model at the given index.

Parameters
[in]indexZero-based index of the contour model to retrieve.
Returns
Pointer to the ContourModel, or nullptr if the index is out of range.

◆ GetContourModelList()

ContourModelListType* mitk::ContourModelSet::GetContourModelList ( )

Return a pointer to the internal contour model container.

Returns
Pointer to the deque of ContourModel smart pointers.

◆ GetSize()

virtual int mitk::ContourModelSet::GetSize ( ) const
inlinevirtual

Return the number of contour models in the set.

Returns
Number of contained ContourModel instances.

Definition at line 64 of file mitkContourModelSet.h.

◆ InitializeEmpty()

void mitk::ContourModelSet::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.

◆ IsEmpty()

bool mitk::ContourModelSet::IsEmpty ( ) const
overridevirtual

Check whether the set contains no contour models.

Returns
True if the container is empty, false otherwise.

Reimplemented from mitk::BaseData.

◆ mitkClassMacro()

mitk::ContourModelSet::mitkClassMacro ( ContourModelSet  ,
mitk::BaseData   
)

◆ mitkCloneMacro()

mitk::ContourModelSet::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::ContourModelSet::New ( )
static

◆ RemoveContourModel()

virtual bool mitk::ContourModelSet::RemoveContourModel ( mitk::ContourModel *  contourModel)
virtual

Remove a specific contour model from the set.

Parameters
[in]contourModelPointer to the ContourModel to remove.
Returns
True if the contour model was found and removed, false otherwise.

◆ RemoveContourModelAt()

virtual bool mitk::ContourModelSet::RemoveContourModelAt ( int  index)
virtual

Remove the contour model at the given index.

Parameters
[in]indexZero-based index of the ContourModel to remove.
Returns
True if the index was valid and the contour model was removed, false otherwise.

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::ContourModelSet::RequestedRegionIsOutsideOfTheBufferedRegion ( )
inlineoverridevirtual

Determine whether the RequestedRegion is outside of the BufferedRegion.

This method returns true if the RequestedRegion is outside the BufferedRegion (true if at least one pixel is outside). This is used by the pipeline mechanism to determine whether a filter needs to re-execute in order to satisfy the current request. If the current RequestedRegion is already inside the BufferedRegion from the previous execution (and the current filter is up to date), then a given filter does not need to re-execute.

Returns
True if the requested region is outside the buffered region.

Implements mitk::BaseData.

Definition at line 115 of file mitkContourModelSet.h.

◆ SetRequestedRegion()

void mitk::ContourModelSet::SetRequestedRegion ( const itk::DataObject *  data)
inlineoverridevirtual

Set the requested region from this data object to match the requested region of the data object passed in as a parameter.

This method is implemented in the concrete subclasses of BaseData.

Parameters
[in]dataThe data object whose requested region will be matched.

Implements mitk::BaseData.

Definition at line 117 of file mitkContourModelSet.h.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::ContourModelSet::SetRequestedRegionToLargestPossibleRegion ( )
inlineoverridevirtual

Set the RequestedRegion to the LargestPossibleRegion.

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

Implements mitk::BaseData.

Definition at line 114 of file mitkContourModelSet.h.

◆ UpdateOutputInformation()

void mitk::ContourModelSet::UpdateOutputInformation ( )
override

Update the OutputInformation of a ContourModel object.

The BoundingBox of the contour will be updated, if necessary.

◆ VerifyRequestedRegion()

bool mitk::ContourModelSet::VerifyRequestedRegion ( )
inlineoverridevirtual

Verify that the RequestedRegion is within the LargestPossibleRegion.

If the RequestedRegion is not within the LargestPossibleRegion, then the filter cannot possibly satisfy the request. This method returns true if the request can be satisfied (even if it will be necessary to process the entire LargestPossibleRegion) and returns false otherwise. Used by PropagateRequestedRegion(), which throws an InvalidRequestedRegionError exception if the requested region is not within the LargestPossibleRegion.

Returns
True if the requested region is within the largest possible region.

Implements mitk::BaseData.

Definition at line 116 of file mitkContourModelSet.h.

Member Data Documentation

◆ m_Contours

ContourModelListType mitk::ContourModelSet::m_Contours
protected

Definition at line 137 of file mitkContourModelSet.h.

◆ m_UpdateBoundingBox

bool mitk::ContourModelSet::m_UpdateBoundingBox
protected

Definition at line 140 of file mitkContourModelSet.h.


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