Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image. More...
#include <mitkLevelWindowManager.h>
Public Types | |
typedef LevelWindowManager | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
void | SetDataStorage (DataStorage *dataStorage) |
DataStorage * | GetDataStorage () |
void | SetAutoTopMostImage (bool autoTopMost, const DataNode *removedNode=nullptr) |
(Re-)Initialize the LevelWindowManager by setting the topmost image. Use the removedNode parameter if a node was removed. More... | |
void | SetSelectedImages (bool selectedImagesMode, const DataNode *removedNode=nullptr) |
(Re-)Initialize the LevelWindowManager by setting the selected images. Use the removedNode parameter if a node was removed. More... | |
void | RecalculateLevelWindowForSelectedComponent (const itk::EventObject &) |
void | Update (const itk::EventObject &) |
Update the level window. This function is called if a property of a data node is changed. Relevant properties are defined in the protected 'ObserverToPropertyValueMap'-members. More... | |
void | UpdateSelected (const itk::EventObject &) |
Update the level window. This function is only called if the 'selected' property of a data node is changed. This is done in order to avoid finding the correct image each time a node is selected but the 'm_SelectedImages' bool value is set to false (as the normal 'Update'-function would do). Changes of the 'selected' property happen quite a lot so this should not slow down the application. More... | |
void | SetLevelWindowProperty (LevelWindowProperty::Pointer levelWindowProperty) |
Set a specific LevelWindowProperty; all changes will affect the image belonging to this property. More... | |
void | SetLevelWindow (const LevelWindow &levelWindow) |
Set new Level/Window values and inform all listeners about changes. More... | |
LevelWindowProperty::Pointer | GetLevelWindowProperty () const |
Return the current LevelWindowProperty object from the image that is affected by changes. More... | |
const LevelWindow & | GetLevelWindow () const |
Return Level/Window values for the current image. More... | |
bool | IsAutoTopMost () const |
Return true, if level window changes will affect the topmost layer image. More... | |
bool | IsSelectedImages () const |
Return true, if level window changes will affect the currently selected images. More... | |
void | DataStorageAddedNode (const DataNode *dataNode=nullptr) |
This method is called when a node is added to the data storage. A listener on the data storage is used to call this method automatically after a node was added. More... | |
void | DataStorageRemovedNode (const DataNode *dataNode=nullptr) |
This method is called when a node is removed from the data storage. A listener on the data storage is used to call this method automatically before a node will be removed. More... | |
void | OnPropertyModified (const itk::EventObject &) |
Change notifications from mitkLevelWindowProperty. More... | |
Image * | GetCurrentImage () const |
Return the currently active image. More... | |
int | GetNumberOfObservers () const |
Return the number of observers for data node's "visible" property. This basically returns the number of relevant nodes to observe. More... | |
DataStorage::SetOfObjects::ConstPointer | GetRelevantNodes () const |
Return all nodes in the data storage that have the following properties: More... | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
Changes on Level/Window can be set with SetLevelWindow() and will affect either the topmost layer image, if IsAutoTopMost() returns true, or an image which is set by SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty). Additionally the changes on Level/Window will affect one or multiple selected images, if IsSelectedImages() returns true. Only one of the two different modes can be enabled at the same time.
Changes to Level/Window, when another image gets active or by SetLevelWindow(const LevelWindow& levelWindow), will be sent to all listeners by Modified().
DataStorageChanged() listens to the DataStorage for new or removed images. Depending on the currently enabled mode, the new image becomes active or not. If an image is removed from the DataStorage and m_AutoTopMost is false, there is a check to proof, if the active image is still available. If not, then m_AutoTopMost becomes true.
Note that this class is not thread safe at the moment!
Definition at line 51 of file mitkLevelWindowManager.h.
typedef itk::SmartPointer<const Self> mitk::LevelWindowManager::ConstPointer |
Definition at line 55 of file mitkLevelWindowManager.h.
Definition at line 55 of file mitkLevelWindowManager.h.
Definition at line 55 of file mitkLevelWindowManager.h.
typedef itk::Object mitk::LevelWindowManager::Superclass |
Definition at line 55 of file mitkLevelWindowManager.h.
Pointer mitk::LevelWindowManager::Clone | ( | ) | const |
void mitk::LevelWindowManager::DataStorageAddedNode | ( | const DataNode * | dataNode = nullptr | ) |
This method is called when a node is added to the data storage. A listener on the data storage is used to call this method automatically after a node was added.
mitk::Exception | Throws an exception if something is wrong, e.g. if the number of observers differs from the number of nodes. |
void mitk::LevelWindowManager::DataStorageRemovedNode | ( | const DataNode * | dataNode = nullptr | ) |
This method is called when a node is removed from the data storage. A listener on the data storage is used to call this method automatically before a node will be removed.
mitk::Exception | Throws an exception if something is wrong, e.g. if the number of observers differs from the number of nodes. |
|
inlinevirtual |
Definition at line 55 of file mitkLevelWindowManager.h.
|
virtual |
Image* mitk::LevelWindowManager::GetCurrentImage | ( | ) | const |
Return the currently active image.
DataStorage* mitk::LevelWindowManager::GetDataStorage | ( | ) |
const LevelWindow& mitk::LevelWindowManager::GetLevelWindow | ( | ) | const |
Return Level/Window values for the current image.
LevelWindowProperty::Pointer mitk::LevelWindowManager::GetLevelWindowProperty | ( | ) | const |
Return the current LevelWindowProperty object from the image that is affected by changes.
int mitk::LevelWindowManager::GetNumberOfObservers | ( | ) | const |
Return the number of observers for data node's "visible" property. This basically returns the number of relevant nodes to observe.
DataStorage::SetOfObjects::ConstPointer mitk::LevelWindowManager::GetRelevantNodes | ( | ) | const |
Return all nodes in the data storage that have the following properties:
@ return The filtered list of relevant nodes in the data storage
|
inlinestatic |
Definition at line 55 of file mitkLevelWindowManager.h.
bool mitk::LevelWindowManager::IsAutoTopMost | ( | ) | const |
Return true, if level window changes will affect the topmost layer image.
bool mitk::LevelWindowManager::IsSelectedImages | ( | ) | const |
Return true, if level window changes will affect the currently selected images.
|
static |
void mitk::LevelWindowManager::OnPropertyModified | ( | const itk::EventObject & | ) |
Change notifications from mitkLevelWindowProperty.
void mitk::LevelWindowManager::RecalculateLevelWindowForSelectedComponent | ( | const itk::EventObject & | ) |
void mitk::LevelWindowManager::SetAutoTopMostImage | ( | bool | autoTopMost, |
const DataNode * | removedNode = nullptr |
||
) |
(Re-)Initialize the LevelWindowManager by setting the topmost image. Use the removedNode parameter if a node was removed.
autoTopMost | Set the topmost layer image to be affected by changes, if true. |
removedNode | A node was removed from the data storage if != nullptr. |
void mitk::LevelWindowManager::SetDataStorage | ( | DataStorage * | dataStorage | ) |
void mitk::LevelWindowManager::SetLevelWindow | ( | const LevelWindow & | levelWindow | ) |
Set new Level/Window values and inform all listeners about changes.
void mitk::LevelWindowManager::SetLevelWindowProperty | ( | LevelWindowProperty::Pointer | levelWindowProperty | ) |
Set a specific LevelWindowProperty; all changes will affect the image belonging to this property.
mitk::Exception | Throw an exception if the there is no image in the data storage which belongs to this property. |
void mitk::LevelWindowManager::SetSelectedImages | ( | bool | selectedImagesMode, |
const DataNode * | removedNode = nullptr |
||
) |
(Re-)Initialize the LevelWindowManager by setting the selected images. Use the removedNode parameter if a node was removed.
selectedImagesMode | Set the selected images to be affected by changes, if true. |
removedNode | A node was removed from the data storage if != nullptr. |
void mitk::LevelWindowManager::Update | ( | const itk::EventObject & | ) |
Update the level window. This function is called if a property of a data node is changed. Relevant properties are defined in the protected 'ObserverToPropertyValueMap'-members.
void mitk::LevelWindowManager::UpdateSelected | ( | const itk::EventObject & | ) |
Update the level window. This function is only called if the 'selected' property of a data node is changed. This is done in order to avoid finding the correct image each time a node is selected but the 'm_SelectedImages' bool value is set to false (as the normal 'Update'-function would do). Changes of the 'selected' property happen quite a lot so this should not slow down the application.