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

Provides convenient static access to common MITK core service objects. More...

#include <mitkCoreServices.h>

Static Public Member Functions

static IDataStorageService * GetDataStorageService (us::ModuleContext *context=us::GetModuleContext())
 Get an IDataStorageService instance. More...
 
static INodeSelectionService * GetNodeSelectionService (us::ModuleContext *context=us::GetModuleContext())
 Get an INodeSelectionsService instance. More...
 
static IPropertyAliases * GetPropertyAliases (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyAliases instance. More...
 
static IPropertyDescriptions * GetPropertyDescriptions (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyDescriptions instance. More...
 
static IPropertyDeserialization * GetPropertyDeserialization (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyDeserialization instance. More...
 
static IPropertyExtensions * GetPropertyExtensions (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyExtensions instance. More...
 
static IPropertyFilters * GetPropertyFilters (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyFilters instance. More...
 
static IPropertyPersistence * GetPropertyPersistence (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyPersistence instance. More...
 
static IPropertyRelations * GetPropertyRelations (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyRelations instance. More...
 
static IPropertyTransience * GetPropertyTransience (us::ModuleContext *context=us::GetModuleContext())
 Get an IPropertyTransience instance. More...
 
static IMimeTypeProvider * GetMimeTypeProvider (us::ModuleContext *context=us::GetModuleContext())
 Get an IMimeTypeProvider instance. More...
 
static IPreferencesService * GetPreferencesService (us::ModuleContext *context=us::GetModuleContext())
 Get an IPreferencesService instance. More...
 
template<class S >
static bool Unget (S *service, us::ModuleContext *context=us::GetModuleContext())
 Release a previously acquired service instance. More...
 

Detailed Description

Provides convenient static access to common MITK core service objects.

Most getter methods are guaranteed to return a non-nullptr service object when the corresponding implementation is registered in the core library. To ensure proper lifetime management, wrap the returned pointer in a CoreServicePointer which calls Unget() automatically on destruction:

CoreServicePointer<IMimeTypeProvider> mime(CoreServices::GetMimeTypeProvider());
// Use mime->...
static IMimeTypeProvider * GetMimeTypeProvider(us::ModuleContext *context=us::GetModuleContext())
Get an IMimeTypeProvider instance.
See also
CoreServicePointer

Definition at line 59 of file mitkCoreServices.h.

Member Function Documentation

◆ GetDataStorageService()

static IDataStorageService* mitk::CoreServices::GetDataStorageService ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IDataStorageService instance.

Parameters
contextThe module context of the module getting the service.
Returns
An IDataStorageService instance, or nullptr if no implementation is registered.
Note
Unlike other core services, this may return nullptr if no plugin has registered an implementation (e.g., in headless/testing scenarios).

◆ GetMimeTypeProvider()

static IMimeTypeProvider* mitk::CoreServices::GetMimeTypeProvider ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IMimeTypeProvider instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IMimeTypeProvider instance.

◆ GetNodeSelectionService()

static INodeSelectionService* mitk::CoreServices::GetNodeSelectionService ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an INodeSelectionsService instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr INodeSelectionsService instance.

◆ GetPreferencesService()

static IPreferencesService* mitk::CoreServices::GetPreferencesService ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPreferencesService instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPreferencesService instance.
See also
IPreferences

◆ GetPropertyAliases()

static IPropertyAliases* mitk::CoreServices::GetPropertyAliases ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyAliases instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyAliases instance.

◆ GetPropertyDescriptions()

static IPropertyDescriptions* mitk::CoreServices::GetPropertyDescriptions ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyDescriptions instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyDescriptions instance.

◆ GetPropertyDeserialization()

static IPropertyDeserialization* mitk::CoreServices::GetPropertyDeserialization ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyDeserialization instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyDeserialization instance.

◆ GetPropertyExtensions()

static IPropertyExtensions* mitk::CoreServices::GetPropertyExtensions ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyExtensions instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyExtensions instance.

◆ GetPropertyFilters()

static IPropertyFilters* mitk::CoreServices::GetPropertyFilters ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyFilters instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyFilters instance.

◆ GetPropertyPersistence()

static IPropertyPersistence* mitk::CoreServices::GetPropertyPersistence ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyPersistence instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyPersistence instance.

◆ GetPropertyRelations()

static IPropertyRelations* mitk::CoreServices::GetPropertyRelations ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyRelations instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyRelations instance.

◆ GetPropertyTransience()

static IPropertyTransience* mitk::CoreServices::GetPropertyTransience ( us::ModuleContext *  context = us::GetModuleContext())
static

Get an IPropertyTransience instance.

Parameters
contextThe module context of the module getting the service.
Returns
A non-nullptr IPropertyTransience instance.

Referenced by mitk::SceneReaderHelpers::StripTransientProperties().

◆ Unget()

template<class S >
static bool mitk::CoreServices::Unget ( S *  service,
us::ModuleContext *  context = us::GetModuleContext() 
)
inlinestatic

Release a previously acquired service instance.

Template Parameters
SThe service interface type.
Parameters
[in]serviceThe service instance to release.
[in]contextThe module context used to acquire the service.
Returns
True if the service was successfully released, false otherwise.

Definition at line 159 of file mitkCoreServices.h.

Referenced by mitk::CoreServicePointer< S >::~CoreServicePointer().


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