Medical Imaging Interaction Toolkit  2021.02.99-74f51bc4
Medical Imaging Interaction Toolkit
mitk::LevelWindowManager Class Reference

Provides access to the LevelWindowProperty object and LevelWindow of the "current" image. More...

#include <mitkLevelWindowManager.h>

Inheritance diagram for mitk::LevelWindowManager:
Collaboration diagram for mitk::LevelWindowManager:

Public Types

typedef LevelWindowManager Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
void SetDataStorage (DataStorage *dataStorage)
 
DataStorageGetDataStorage ()
 
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 LevelWindowGetLevelWindow () 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...
 
ImageGetCurrentImage () 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 ()
 

Detailed Description

Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.

  • provides a LevelWindowProperty for purposes like GUI editors
  • this property comes from one of two possible sources
    • either something (e.g. the application) sets the property because of some user selection
    • OR the "Auto top-most" logic is used to search a DataStorage for the image with the highest "layer" property value

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.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

Definition at line 55 of file mitkLevelWindowManager.h.

Member Function Documentation

◆ Clone()

Pointer mitk::LevelWindowManager::Clone ( ) const

◆ DataStorageAddedNode()

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.

Exceptions
mitk::ExceptionThrows an exception if something is wrong, e.g. if the number of observers differs from the number of nodes.

◆ DataStorageRemovedNode()

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.

Exceptions
mitk::ExceptionThrows an exception if something is wrong, e.g. if the number of observers differs from the number of nodes.

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::LevelWindowManager::GetClassHierarchy ( ) const
inlinevirtual

Definition at line 55 of file mitkLevelWindowManager.h.

◆ GetClassName()

virtual const char* mitk::LevelWindowManager::GetClassName ( ) const
virtual

◆ GetCurrentImage()

Image* mitk::LevelWindowManager::GetCurrentImage ( ) const

Return the currently active image.

Returns
The member variable holding the currently active image.

◆ GetDataStorage()

DataStorage* mitk::LevelWindowManager::GetDataStorage ( )

◆ GetLevelWindow()

const LevelWindow& mitk::LevelWindowManager::GetLevelWindow ( ) const

Return Level/Window values for the current image.

Returns
The LevelWindow value for the current image.

◆ GetLevelWindowProperty()

LevelWindowProperty::Pointer mitk::LevelWindowManager::GetLevelWindowProperty ( ) const

Return the current LevelWindowProperty object from the image that is affected by changes.

Returns
The current LevelWindowProperty

◆ GetNumberOfObservers()

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.

Returns
The current number of observers which are registered in this object.

◆ GetRelevantNodes()

DataStorage::SetOfObjects::ConstPointer mitk::LevelWindowManager::GetRelevantNodes ( ) const

Return all nodes in the data storage that have the following properties:

  • "binary" == false
  • "levelwindow"
  • DataType == Image / DiffusionImage / TensorImage / OdfImage / ShImage

@ return The filtered list of relevant nodes in the data storage

◆ GetStaticNameOfClass()

static const char* mitk::LevelWindowManager::GetStaticNameOfClass ( )
inlinestatic

Definition at line 55 of file mitkLevelWindowManager.h.

◆ IsAutoTopMost()

bool mitk::LevelWindowManager::IsAutoTopMost ( ) const

Return true, if level window changes will affect the topmost layer image.

Returns
Return the member value that denotes the auto-topmost mode.

◆ IsSelectedImages()

bool mitk::LevelWindowManager::IsSelectedImages ( ) const

Return true, if level window changes will affect the currently selected images.

Returns
Return the member value that denotes the selected-images mode.

◆ New()

static Pointer mitk::LevelWindowManager::New ( )
static

◆ OnPropertyModified()

void mitk::LevelWindowManager::OnPropertyModified ( const itk::EventObject &  )

Change notifications from mitkLevelWindowProperty.

◆ RecalculateLevelWindowForSelectedComponent()

void mitk::LevelWindowManager::RecalculateLevelWindowForSelectedComponent ( const itk::EventObject &  )

◆ SetAutoTopMostImage()

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.

Parameters
autoTopMostSet the topmost layer image to be affected by changes, if true.
removedNodeA node was removed from the data storage if != nullptr.

◆ SetDataStorage()

void mitk::LevelWindowManager::SetDataStorage ( DataStorage dataStorage)

◆ SetLevelWindow()

void mitk::LevelWindowManager::SetLevelWindow ( const LevelWindow levelWindow)

Set new Level/Window values and inform all listeners about changes.

◆ SetLevelWindowProperty()

void mitk::LevelWindowManager::SetLevelWindowProperty ( LevelWindowProperty::Pointer  levelWindowProperty)

Set a specific LevelWindowProperty; all changes will affect the image belonging to this property.

Exceptions
mitk::ExceptionThrow an exception if the there is no image in the data storage which belongs to this property.

◆ SetSelectedImages()

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.

Parameters
selectedImagesModeSet the selected images to be affected by changes, if true.
removedNodeA node was removed from the data storage if != nullptr.

◆ Update()

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.

◆ UpdateSelected()

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.


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