|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Base class of all data objects. More...
#include <mitkBaseData.h>


Public Member Functions | |
| 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 | SetRequestedRegionToLargestPossibleRegion () override=0 |
| Set the RequestedRegion to the LargestPossibleRegion. More... | |
| bool | RequestedRegionIsOutsideOfTheBufferedRegion () override=0 |
| Determine whether the RequestedRegion is outside of the BufferedRegion. More... | |
| bool | VerifyRequestedRegion () override=0 |
| Verify that the RequestedRegion is within the LargestPossibleRegion. 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 | SetRequestedRegion (const itk::DataObject *data) override=0 |
| Set the requested region from this data object to match the requested region of the data object passed in as a parameter. 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... | |
Protected Member Functions | |
| 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 | |
| bool | m_LastRequestedRegionWasOutsideOfTheBufferedRegion |
| unsigned int | m_SourceOutputIndexDuplicate |
| bool | m_Initialized |
Additional Inherited Members | |
Public Types inherited from mitk::Identifiable | |
| using | UIDType = std::string |
| Type alias for unique identifiers. More... | |
Base class of all data objects.
BaseData is the common base class for all MITK data objects such as images, surfaces, contours, and point sets. It inherits from itk::DataObject and can therefore be included in ITK-style processing pipelines.
It also inherits from OperationActor, enabling it to receive and execute Operation objects (e.g., for undo/redo support), from Identifiable, giving each data object a unique identifier (UID), and from IPropertyOwner, providing a key-value property list for arbitrary metadata storage.
Every BaseData carries a TimeGeometry that describes the spatial and temporal extent of the data. Sub-classes are expected to initialize this geometry appropriately and to implement the pure virtual pipeline region methods.
Definition at line 58 of file mitkBaseData.h.
|
protected |
|
protected |
|
overrideprotected |
|
virtual |
Reset the data object by calling ClearData() and InitializeEmpty().
Reimplemented in mitk::Image, mitk::ContourModelSet, and mitk::ContourModel.
|
protectedvirtual |
reset to non-initialized state, release memory
Reimplemented in mitk::Surface, mitk::PointSet, and mitk::ContourModel.
|
override |
Copy information from the specified data set.
This method is part of the pipeline execution model. By default, a BaseProcess will copy metadata from the first input to all of its outputs. See ProcessObject::GenerateOutputInformation(). Each subclass of DataObject is responsible for copying whatever metadata it needs from another DataObject. The default implementation copies the TimeGeometry and the PropertyList. If a subclass overrides this method, it should always call its superclass version.
| [in] | data | The data object from which to copy information. Must be castable to BaseData. |
| itk::ExceptionObject | if data cannot be cast to BaseData. |
|
overridevirtual |
Execute an operation on this data object.
Override this method if the data can be called by an Interactor (StateMachine). Empty by default. Subclasses should implement all necessary operations here, extracting needed information from the operation parameter.
| [in] | operation | The operation to execute. |
Implements mitk::OperationActor.
Reimplemented in mitk::Surface, and mitk::PointSet.
|
virtual |
Expand the TimeGeometry to a number of time steps.
The method expands the TimeGeometry to the given number of time steps, filling newly created elements with empty geometries. Sub-classes should override this method to handle the elongation of their data vectors, too.
| [in] | timeSteps | The desired number of time steps. |
Reimplemented in mitk::Surface, mitk::PointSet, mitk::Image, and mitk::ContourModel.
|
overridevirtual |
Get a const property by its key.
| [in] | propertyKey | The key identifying the property. |
| [in] | contextName | The context name for the property lookup. An empty string denotes the default context. |
| [in] | fallBackOnDefaultContext | If true and the property is not found in the specified context, the default context is searched as well. |
Implements mitk::IPropertyProvider.
|
inline |
Return the BaseGeometry of the data at time step t as a non-const pointer.
Normally used in GenerateOutputInformation of subclasses of BaseProcess.
| [in] | t | The time step for which to retrieve the geometry (default: 0). |
Definition at line 224 of file mitkBaseData.h.
Referenced by mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), and mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates().
|
override |
Get the modification time of this data object or its geometry, whichever was modified most recently.
|
overridevirtual |
Get a non-const property by its key.
| [in] | propertyKey | The key identifying the property. |
| [in] | contextName | The context name for the property lookup. |
| [in] | fallBackOnDefaultContext | If true, the default context is used as fallback. |
Implements mitk::IPropertyOwner.
| mitk::BaseProperty::Pointer mitk::BaseData::GetProperty | ( | const char * | propertyKey | ) | const |
Get a property by its key from the PropertyList.
| [in] | propertyKey | The key of the property to look up. |
|
overridevirtual |
Get the names of all property contexts.
BaseData has no sub-contexts by default, so this returns an empty vector.
Implements mitk::IPropertyProvider.
|
overridevirtual |
Get all property keys stored in the property list.
| [in] | contextName | The property context to query. An empty string denotes the default context. |
| [in] | includeDefaultContext | If true, keys from the default context are included even when a non-default context is queried. |
Implements mitk::IPropertyProvider.
| mitk::PropertyList::Pointer mitk::BaseData::GetPropertyList | ( | ) | const |
Get the data's property list.
Referenced by mitk::SceneReaderHelpers::ApplyProportionalTimeGeometryProperties().
| itk::SmartPointer<mitk::BaseDataSource> mitk::BaseData::GetSource | ( | ) | const |
Get the process object that generated this data object.
If there is no process object, then the data object has been disconnected from the pipeline, or the data object was created manually.
|
inline |
Return the TimeGeometry of the data as non-const pointer.
Normally used in GenerateOutputInformation of subclasses of BaseProcess.
Definition at line 168 of file mitkBaseData.h.
|
inline |
Return the TimeGeometry of the data as const pointer.
Normally used in GenerateOutputInformation of subclasses of BaseProcess.
Definition at line 152 of file mitkBaseData.h.
Referenced by mitk::SceneReaderHelpers::ApplyProportionalTimeGeometryProperties().
|
inline |
Get the number of time steps from the TimeGeometry.
As the base data does not have a data vector of its own, the number of time steps is defined by the TimeGeometry. Sub-classes may provide a more efficient implementation based on their data vector length.
Definition at line 510 of file mitkBaseData.h.
Referenced by mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates().
| const mitk::BaseGeometry* mitk::BaseData::GetUpdatedGeometry | ( | int | t = 0 | ) |
Return the BaseGeometry of the data at time step t after ensuring it is up-to-date.
Unlike GetGeometry(), this method sets the requested region to the largest possible region and calls UpdateOutputInformation() before returning the geometry, ensuring the geometry is current.
| [in] | t | The time step for which to retrieve the geometry (default: 0). |
| const mitk::TimeGeometry* mitk::BaseData::GetUpdatedTimeGeometry | ( | ) |
Return the TimeGeometry of the data after ensuring it is up-to-date.
Unlike GetTimeGeometry(), this method sets the requested region to the largest possible region and calls UpdateOutputInformation() before returning the TimeGeometry, ensuring the geometry is current.
|
override |
Graft data and information from another data object.
| itk::ExceptionObject | Always throws in the base class. Subclasses must provide their own implementation. |
|
inlineprotectedvirtual |
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 in mitk::Surface, mitk::PointSet, mitk::ContourModelSet, and mitk::ContourModel.
Definition at line 548 of file mitkBaseData.h.
|
protectedvirtual |
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.
Reimplemented in mitk::PlanarFigure, and mitk::BaseDataTestImplementation.
|
virtual |
Check whether the object contains data at any time step.
Iterates over all time steps and returns true only if every time step is empty (or the object is not initialized).
Reimplemented in mitk::MAPRegistrationWrapper, mitk::ContourModelSet, mitk::ContourModel, mitk::IntensityQuantifier, mitk::AbstractGlobalImageFeature, and mitk::AbstractClassifier.
|
virtual |
Check whether the object contains data at the specified time step.
For example, a set of points may be empty at a given time step.
| [in] | t | The time step to check. |
Reimplemented in mitk::MAPRegistrationWrapper, mitk::Surface, mitk::PointSet, and mitk::ContourModel.
|
virtual |
Check whether the data has been initialized.
A data object is considered initialized when at least the geometry and other header data have been set.
| mitk::BaseData::mitkClassMacroItkParent | ( | BaseData | , |
| itk::DataObject | |||
| ) |
|
overrideprotected |
|
overridevirtual |
Remove a property from the property list.
| [in] | propertyKey | The key of the property to remove. Must not be empty. |
| [in] | contextName | The context name. An empty string denotes the default context. |
| [in] | fallBackOnDefaultContext | If true, the property is removed from the default context when the specified context is unknown. |
| mitk::Exception | if the property key is empty or if a non-default context is specified without fallback. |
Implements mitk::IPropertyOwner.
|
overridepure virtual |
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.
Implemented in mitk::SegmentationTaskList, mitk::ROI, mitk::PlanarFigure, mitk::RegEvaluationObject, mitk::MAPRegistrationWrapper, mitk::ImageStatisticsContainer, mitk::VtkWidgetRendering, mitk::Surface, mitk::SlicedData, mitk::PointSet, mitk::PlaneGeometryData, mitk::GeometryData, mitk::CrosshairData, mitk::BaseDataTestImplementation, mitk::ContourModelSet, mitk::ContourModel, mitk::IntensityQuantifier, mitk::AbstractGlobalImageFeature, mitk::AbstractClassifier, and mitk::ExampleDataStructure.
|
virtual |
Set a clone of the provided geometry as the BaseGeometry of the data.
Assumes the data object has only 1 time step (i.e., is a 3D object) and creates a new TimeGeometry. If a TimeGeometry has already been set, it will be replaced.
| [in] | aGeometry3D | The geometry to clone. |
|
virtual |
Set a clone of the provided geometry as the BaseGeometry of a given time step.
| [in] | aGeometry3D | The geometry to clone. |
| [in] | time | The time step at which to set the cloned geometry. |
|
virtual |
Set a clone of the provided TimeGeometry as the TimeGeometry of the data.
| [in] | geometry | The TimeGeometry to clone. |
|
virtual |
Set the BaseGeometry of the data, which will be referenced (not copied!).
Assumes the data object has only 1 time step (i.e., is a 3D object) and creates a new ProportionalTimeGeometry wrapping the given BaseGeometry. If a TimeGeometry has already been set, it will be replaced.
| [in] | aGeometry3D | The geometry to reference. If nullptr, an empty TimeGeometry is created. |
Reimplemented in mitk::PlaneGeometryData, mitk::SlicedData, and mitk::Image.
|
virtual |
Convenience method for setting the origin of the BaseGeometry instances of all time steps.
| [in] | origin | The new origin in world coordinates. |
Reimplemented in mitk::SlicedData.
| void mitk::BaseData::SetProperty | ( | const char * | propertyKey, |
| BaseProperty * | property | ||
| ) |
Set a property in the PropertyList.
| [in] | propertyKey | The key under which to store the property. |
| [in] | property | The property value to store. |
|
overridevirtual |
Set a property in the property list.
| [in] | propertyKey | The key identifying the property. Must not be empty. |
| [in] | property | The property to set. |
| [in] | contextName | The context name. An empty string denotes the default context. |
| [in] | fallBackOnDefaultContext | If true, the property is stored in the default context when the specified context is unknown. |
| mitk::Exception | if the property key is empty or if a non-default context is specified without fallback. |
Implements mitk::IPropertyOwner.
| void mitk::BaseData::SetPropertyList | ( | PropertyList * | propertyList | ) |
Set the data's property list, replacing the existing one.
| [in] | propertyList | The new property list. |
|
overridepure virtual |
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.
| [in] | data | The data object whose requested region will be matched. |
Implemented in mitk::ROI, mitk::PlanarFigure, mitk::RegEvaluationObject, mitk::Surface, mitk::SlicedData, mitk::PointSet, mitk::PlaneGeometryData, mitk::GeometryData, mitk::CrosshairData, mitk::ContourModel, mitk::SegmentationTaskList, mitk::MAPRegistrationWrapper, mitk::ImageStatisticsContainer, mitk::VtkWidgetRendering, mitk::BaseDataTestImplementation, mitk::ContourModelSet, mitk::IntensityQuantifier, mitk::AbstractGlobalImageFeature, mitk::AbstractClassifier, and mitk::ExampleDataStructure.
|
overridepure virtual |
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().
Implemented in mitk::SegmentationTaskList, mitk::ROI, mitk::PlanarFigure, mitk::RegEvaluationObject, mitk::MAPRegistrationWrapper, mitk::ImageStatisticsContainer, mitk::VtkWidgetRendering, mitk::Surface, mitk::SlicedData, mitk::PointSet, mitk::PlaneGeometryData, mitk::GeometryData, mitk::CrosshairData, mitk::BaseDataTestImplementation, mitk::ContourModelSet, mitk::ContourModel, mitk::IntensityQuantifier, mitk::AbstractGlobalImageFeature, mitk::AbstractClassifier, and mitk::ExampleDataStructure.
|
virtual |
Set the TimeGeometry of the data, which will be referenced (not copied!).
| [in] | geometry | The TimeGeometry to reference. |
|
override |
Update the information for this BaseData so that it can be used as an output of a BaseProcess.
This method is used in the pipeline mechanism to propagate information and initialize the metadata associated with a BaseData. Any implementation of this method in a derived class is assumed to call its source's BaseProcess::UpdateOutputInformation(), which determines modified times, LargestPossibleRegions, and any extra metadata like spacing, origin, etc. The default implementation calls the source's UpdateOutputInformation() and then updates the TimeGeometry bounding box.
|
overridepure virtual |
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.
Implemented in mitk::SegmentationTaskList, mitk::ROI, mitk::PlanarFigure, mitk::RegEvaluationObject, mitk::MAPRegistrationWrapper, mitk::ImageStatisticsContainer, mitk::BoundingObjectGroup, mitk::VtkWidgetRendering, mitk::Surface, mitk::SlicedData, mitk::PointSet, mitk::PlaneGeometryData, mitk::GeometryData, mitk::CrosshairData, mitk::BaseDataTestImplementation, mitk::ContourModelSet, mitk::ContourModel, mitk::IntensityQuantifier, mitk::AbstractGlobalImageFeature, mitk::AbstractClassifier, and mitk::ExampleDataStructure.
|
protected |
Definition at line 555 of file mitkBaseData.h.
|
protected |
Definition at line 551 of file mitkBaseData.h.
|
mutableprotected |
Definition at line 553 of file mitkBaseData.h.