39 QString item = presetAction->text();
46 double lowerBound = (dlevel - dwindow / 2);
50 dlevel = lowerBound + dwindow / 2;
60 double upperBound = (dlevel + dwindow / 2);
64 dlevel = upperBound - dwindow / 2;
143 if (changeRange.exec())
184 if (
nullptr == contextMenu)
194 sliderFixed->setCheckable(
true);
196 contextMenu->addSeparator();
199 contextMenu->addSeparator();
202 contextMenu->addSeparator();
205 contextMenu->addSeparator();
212 for (
auto iter = preset.begin(); iter != preset.end(); iter++)
214 QString item = ((*iter).first.c_str());
220 contextMenu->addSeparator();
245 for (mitk::DataStorage::SetOfObjects::ConstIterator objectIter = allObjects->Begin();
246 objectIter != allObjects->End();
255 bool isHelperObject =
false;
271 if (levelWindowProperty.IsNotNull())
275 QString item = name.c_str();
277 id->setCheckable(
true);
281 id->setChecked(
true);
289 contextMenu->exec(QCursor::pos());
298 auto contextMenu =
new QMenu(
this);
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr, bool fallBackOnDataProperties=true) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
ScalarType GetLevel() const
method that returns the level value, i.e. the center of the current grey value interval ...
The LevelWindowProperty class Property for the mitk::LevelWindow.
void ResetDefaultLevelWindow()
Resets the level and the window value to the default values.
void SetLevelWindow(const LevelWindow &levelWindow)
Set new Level/Window values and inform all listeners about changes.
void SetFixed(bool fixed)
void SetToImageRange(const Image *image)
sets level/window to the min/max greyvalues of the given Image
const LevelWindow & GetLevelWindow()
Return Level/Window values for the current image.
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
std::map< std::string, double > & getLevelPresets()
DataStorage::SetOfObjects::ConstPointer GetRelevantNodes()
Returns all nodes in the DataStorage that have the following properties:
void setUpperLimit(double rangeMax)
void SetRangeMinMax(ScalarType min, ScalarType max)
void SetSelectedImages(bool selectedImagesMode, const DataNode *removedNode=nullptr)
(Re-)Initialize the LevelWindowManager by setting the selected images. Use the removedNode parameter ...
std::map< std::string, double > getLevelPresets()
bool IsVisible(const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
bool IsAutoTopMost()
Return true, if the changes on slider or line-edits will affect the topmost layer image...
void ResetDefaultRangeMinMax()
the default min and max range for image will be reset
LevelWindowProperty::Pointer GetLevelWindowProperty()
Return the current LevelWindowProperty object from the image that is affected by changes.
static RenderingManager * GetInstance()
void setPresets(std::map< std::string, double > &level, std::map< std::string, double > &window, QString initLevel, QString initWindow)
void newPresets(std::map< std::string, double > newLevel, std::map< std::string, double > newWindow)
std::map< std::string, double > getWindowPresets()
void SetAuto(const Image *image, bool tryPicTags=true, bool guessByCentralSlice=true, unsigned selectedComponent=0)
sets level/window to optimize the contrast of the given Image
void SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty)
Set a specific LevelWindowProperty; all changes will affect the image belonging to this property...
ScalarType GetRangeMax() const
ScalarType GetWindow() const
returns the current window size, i.e the range size of the current grey value interval ...
bool IsSelectedImages()
Return true, if changes on slider or line-edits will affect the currently selected images...
double getWindow(std::string window)
ScalarType GetRangeMin() const
void SetToMaxWindowSize()
std::map< std::string, double > & getWindowPresets()
void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode=nullptr)
(Re-)Initialize the LevelWindowManager by setting the topmost image. Use the removedNode parameter if...
static LevelWindowPreset * New()
void SetLevelWindow(ScalarType level, ScalarType window, bool expandRangesIfNecessary=true)
void setLowerLimit(double rangeMin)
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image...
double getLevel(std::string name)
Image * GetCurrentImage()
Return the currently active image.
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Class for nodes of the DataTree.
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...