Medical Imaging Interaction Toolkit
2016.11.0
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 *ds) |
DataStorage * | GetDataStorage () |
returns the datastorage More... | |
void | SetAutoTopMostImage (bool autoTopMost, const DataNode *removedNode=nullptr) |
(Re-)Initializes the LevelWindowManager by setting the topmost image. Use the removedNode parameter if a node was removed... More... | |
void | RecaluclateLevelWindowForSelectedComponent (const itk::EventObject &) |
void | Update (const itk::EventObject &e) |
gets called if a visible property changes More... | |
void | SetLevelWindowProperty (LevelWindowProperty::Pointer levelWindowProperty) |
Sets an specific LevelWindowProperty, all changes will affect the image belonging to this property. More... | |
void | SetLevelWindow (const LevelWindow &levelWindow) |
Sets new Level/Window values and informs all listeners about changes. More... | |
const LevelWindow & | GetLevelWindow () |
LevelWindowProperty::Pointer | GetLevelWindowProperty () |
bool | isAutoTopMost () |
void | DataStorageAddedNode (const DataNode *n=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 *removedNode=nullptr) |
This method is called when a node is removed to the data storage. A listener on the data storage is used to call this method automatically directly before a node will be removed. More... | |
void | OnPropertyModified (const itk::EventObject &e) |
change notifications from mitkLevelWindowProperty More... | |
Image * | GetCurrentImage () |
return the currently active image More... | |
int | GetNumberOfObservers () |
DataStorage::SetOfObjects::ConstPointer | GetRelevantNodes () |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Protected Types | |
typedef std::pair< unsigned long, DataNode::Pointer > | PropDataPair |
typedef std::map< PropDataPair, BaseProperty::Pointer > | ObserverToPropertyMap |
Protected Member Functions | |
LevelWindowManager () | |
~LevelWindowManager () | |
void | UpdateObservers () |
void | ClearPropObserverLists () |
internal help method to clear both lists/maps. More... | |
void | CreatePropObserverLists () |
internal help method to create both lists/maps. More... | |
Protected Attributes | |
DataStorage::Pointer | m_DataStorage |
LevelWindowProperty::Pointer | m_LevelWindowProperty |
pointer to the LevelWindowProperty of the current image More... | |
ObserverToPropertyMap | m_PropObserverToNode |
map to hold observer IDs to every visible property of DataNode�s BaseProperty More... | |
ObserverToPropertyMap | m_PropObserverToNode2 |
map to hold observer IDs to every layer property of DataNode�s BaseProperty More... | |
ObserverToPropertyMap | m_PropObserverToNode3 |
ObserverToPropertyMap | m_PropObserverToNode4 |
ObserverToPropertyMap | m_PropObserverToNode5 |
const mitk::DataNode * | m_NodeMarkedToDelete |
bool | m_AutoTopMost |
unsigned long | m_ObserverTag |
bool | m_IsObserverTagSet |
unsigned long | m_PropertyModifiedTag |
Image * | m_CurrentImage |
bool | m_IsPropertyModifiedTagSet |
bool | m_SettingImgForLvlWinProp |
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).
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 how m_AutoTopMost is set, 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 54 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 130 of file mitkLevelWindowManager.h.
Definition at line 54 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 129 of file mitkLevelWindowManager.h.
Definition at line 54 of file mitkLevelWindowManager.h.
typedef itk::Object mitk::LevelWindowManager::Superclass |
Definition at line 54 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 31 of file mitkLevelWindowManager.cpp.
|
protected |
Definition at line 42 of file mitkLevelWindowManager.cpp.
References DataStorageAddedNode(), DataStorageRemovedNode(), and m_DataStorage.
|
protected |
internal help method to clear both lists/maps.
Definition at line 517 of file mitkLevelWindowManager.cpp.
Pointer mitk::LevelWindowManager::Clone | ( | ) | const |
|
protected |
internal help method to create both lists/maps.
Definition at line 559 of file mitkLevelWindowManager.cpp.
References m_DataStorage, mitk::New(), RecaluclateLevelWindowForSelectedComponent(), and Update().
void mitk::LevelWindowManager::DataStorageAddedNode | ( | const DataNode * | n = 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. |
Definition at line 266 of file mitkLevelWindowManager.cpp.
References mitkThrow.
Referenced by SetDataStorage(), and ~LevelWindowManager().
void mitk::LevelWindowManager::DataStorageRemovedNode | ( | const DataNode * | removedNode = nullptr | ) |
This method is called when a node is removed to the data storage. A listener on the data storage is used to call this method automatically directly 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. |
Definition at line 282 of file mitkLevelWindowManager.cpp.
References m_DataStorage, mitkThrow, and mitk::NodePredicateProperty::New().
Referenced by SetDataStorage(), and ~LevelWindowManager().
|
inlinevirtual |
Definition at line 54 of file mitkLevelWindowManager.h.
|
virtual |
mitk::Image * mitk::LevelWindowManager::GetCurrentImage | ( | ) |
return the currently active image
Definition at line 512 of file mitkLevelWindowManager.cpp.
Referenced by QmitkLevelWindowWidgetContextMenu::useAllGreyvaluesFromImage(), and QmitkLevelWindowWidgetContextMenu::useOptimizedLevelWindow().
mitk::DataStorage * mitk::LevelWindowManager::GetDataStorage | ( | ) |
returns the datastorage
Definition at line 348 of file mitkLevelWindowManager.cpp.
References m_DataStorage.
const mitk::LevelWindow & mitk::LevelWindowManager::GetLevelWindow | ( | ) |
Definition at line 244 of file mitkLevelWindowManager.cpp.
Referenced by QmitkLevelWindowWidgetContextMenu::getContextMenu().
mitk::LevelWindowProperty::Pointer mitk::LevelWindowManager::GetLevelWindowProperty | ( | ) |
Definition at line 238 of file mitkLevelWindowManager.cpp.
Referenced by QmitkLevelWindowWidgetContextMenu::getContextMenu().
int mitk::LevelWindowManager::GetNumberOfObservers | ( | ) |
mitk::Exception | Throws an exception if the number of observers differs from the number of relevant objects which means that something is wrong. |
Definition at line 343 of file mitkLevelWindowManager.cpp.
mitk::DataStorage::SetOfObjects::ConstPointer mitk::LevelWindowManager::GetRelevantNodes | ( | ) |
returns all nodes in the DataStorage that have the following properties: "visible" == true, "binary" == false, "levelwindow", and DataType == Image
Definition at line 483 of file mitkLevelWindowManager.cpp.
References m_DataStorage, mitk::BoolProperty::New(), mitk::NodePredicateOr::New(), mitk::NodePredicateAnd::New(), mitk::NodePredicateDataType::New(), mitk::NodePredicateProperty::New(), and mitk::New().
Referenced by QmitkLevelWindowWidgetContextMenu::getContextMenu().
|
inlinestatic |
Definition at line 54 of file mitkLevelWindowManager.h.
bool mitk::LevelWindowManager::isAutoTopMost | ( | ) |
Definition at line 354 of file mitkLevelWindowManager.cpp.
Referenced by QmitkLevelWindowWidgetContextMenu::getContextMenu(), and QmitkLevelWindowWidgetContextMenu::setImage().
|
static |
void mitk::LevelWindowManager::OnPropertyModified | ( | const itk::EventObject & | e | ) |
change notifications from mitkLevelWindowProperty
Definition at line 87 of file mitkLevelWindowManager.cpp.
Referenced by SetLevelWindowProperty().
void mitk::LevelWindowManager::RecaluclateLevelWindowForSelectedComponent | ( | const itk::EventObject & | event | ) |
Definition at line 359 of file mitkLevelWindowManager.cpp.
References mitk::LevelWindow::SetAuto(), and Update().
Referenced by CreatePropObserverLists().
void mitk::LevelWindowManager::SetAutoTopMostImage | ( | bool | autoTopMost, |
const DataNode * | removedNode = nullptr |
||
) |
(Re-)Initializes the LevelWindowManager by setting the topmost image. Use the removedNode parameter if a node was removed...
autoTopMost | true: sets the topmost layer image to be affected by changes |
removedNode | != NULL a node was removed from DataStorage |
Definition at line 92 of file mitkLevelWindowManager.cpp.
References mitk::RenderingModeProperty::COLORTRANSFERFUNCTION_COLOR, mitk::RenderingModeProperty::LOOKUPTABLE_COLOR, m_DataStorage, and min().
Referenced by QmitkLevelWindowWidgetContextMenu::setImage().
void mitk::LevelWindowManager::SetDataStorage | ( | mitk::DataStorage * | ds | ) |
Definition at line 63 of file mitkLevelWindowManager.cpp.
References DataStorageAddedNode(), DataStorageRemovedNode(), and m_DataStorage.
void mitk::LevelWindowManager::SetLevelWindow | ( | const LevelWindow & | levelWindow | ) |
Sets new Level/Window values and informs all listeners about changes.
Definition at line 257 of file mitkLevelWindowManager.cpp.
Referenced by QmitkLevelWindowWidgetContextMenu::changeScaleRange(), QmitkLevelWindowWidgetContextMenu::setDefaultLevelWindow(), QmitkLevelWindowWidgetContextMenu::setDefaultScaleRange(), QmitkLevelWindowWidgetContextMenu::setFixed(), QmitkLevelWindowWidgetContextMenu::setMaximumWindow(), QmitkLevelWindowWidgetContextMenu::setPreset(), QmitkLevelWindowWidgetContextMenu::useAllGreyvaluesFromImage(), and QmitkLevelWindowWidgetContextMenu::useOptimizedLevelWindow().
void mitk::LevelWindowManager::SetLevelWindowProperty | ( | LevelWindowProperty::Pointer | levelWindowProperty | ) |
Sets an specific LevelWindowProperty, all changes will affect the image belonging to this property.
mitk::Exception | Throws an exception if the there is no image in the data storage which belongs to this property. |
Definition at line 180 of file mitkLevelWindowManager.cpp.
References m_DataStorage, mitkThrow, mitk::New(), and OnPropertyModified().
Referenced by QmitkLevelWindowWidgetContextMenu::setImage().
void mitk::LevelWindowManager::Update | ( | const itk::EventObject & | e | ) |
gets called if a visible property changes
Definition at line 392 of file mitkLevelWindowManager.cpp.
References min(), and MITK_ERROR.
Referenced by CreatePropObserverLists().
|
protected |
updates the internal observer list. Ignores nodes which are marked to be deleted in the variable m_NodeMarkedToDelete
Definition at line 337 of file mitkLevelWindowManager.cpp.
|
protected |
Definition at line 152 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 156 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 127 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 154 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 157 of file mitkLevelWindowManager.h.
|
protected |
pointer to the LevelWindowProperty of the current image
Definition at line 128 of file mitkLevelWindowManager.h.
|
protected |
this variable holds a data node which will be deleted from the datastorage immedeately (if there is one, NULL otherways)
Definition at line 149 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 153 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 155 of file mitkLevelWindowManager.h.
|
protected |
map to hold observer IDs to every visible property of DataNode�s BaseProperty
Definition at line 133 of file mitkLevelWindowManager.h.
|
protected |
map to hold observer IDs to every layer property of DataNode�s BaseProperty
Definition at line 135 of file mitkLevelWindowManager.h.
|
protected |
map to hold observer IDs to every Image Rendering.Mode property of DataNode�s BaseProperty
Definition at line 136 of file mitkLevelWindowManager.h.
|
protected |
map to hold observer IDs to every Image.Displayed Component property of DataNode�s BaseProperty
Definition at line 139 of file mitkLevelWindowManager.h.
|
protected |
map to hold observer IDs to every image for level window property of DataNode�s BaseProperty
Definition at line 142 of file mitkLevelWindowManager.h.
|
protected |
Definition at line 158 of file mitkLevelWindowManager.h.