37 QString item = presetAction->text();
44 double lowerBound = (dlevel - dwindow / 2);
48 dlevel = lowerBound + dwindow / 2;
58 double upperBound = (dlevel + dwindow / 2);
62 dlevel = upperBound - dwindow / 2;
141 if (changeRange.exec())
167 QMenu *contextMenu = contextmenu;
168 Q_CHECK_PTR(contextMenu);
170 QAction *sliderFixed = contextMenu->addAction(tr(
"Set Slider Fixed"),
this, SLOT(
setFixed()));
171 sliderFixed->setCheckable(
true);
173 contextMenu->addSeparator();
176 contextMenu->addSeparator();
177 contextMenu->addAction(tr(
"Set Maximum Window"),
this, SLOT(
setMaximumWindow()));
179 contextMenu->addSeparator();
180 contextMenu->addAction(tr(
"Change Scale Range"),
this, SLOT(
changeScaleRange()));
182 contextMenu->addSeparator();
190 for (
auto iter = preset.begin(); iter != preset.end(); iter++)
192 QString item = ((*iter).first.c_str());
197 contextMenu->addSeparator();
209 for (mitk::DataStorage::SetOfObjects::ConstIterator objectIter = allObjects->Begin();
210 objectIter != allObjects->End();
220 bool isHelperObject =
false;
222 if (levelWindowProperty.IsNotNull() && !isHelperObject)
226 QString item = name.c_str();
228 id->setCheckable(
true);
232 id->setChecked(
true);
240 contextMenu->exec(QCursor::pos());
253 auto contextMenu =
new QMenu(
this);
254 Q_CHECK_PTR(contextMenu);
256 QAction *sliderFixed = contextMenu->addAction(tr(
"Set Slider Fixed"),
this, SLOT(
setFixed()));
257 sliderFixed->setCheckable(
true);
259 contextMenu->addSeparator();
262 contextMenu->addSeparator();
263 contextMenu->addAction(tr(
"Set Maximum Window"),
this, SLOT(
setMaximumWindow()));
265 contextMenu->addSeparator();
266 contextMenu->addAction(tr(
"Change Scale Range"),
this, SLOT(
changeScaleRange()));
268 contextMenu->addSeparator();
276 for (
auto iter = preset.begin(); iter != preset.end(); iter++)
278 QString item = ((*iter).first.c_str());
283 contextMenu->addSeparator();
295 for (mitk::DataStorage::SetOfObjects::ConstIterator objectIter = allObjects->Begin();
296 objectIter != allObjects->End();
304 bool isHelperObject =
false;
306 if (levelWindowProperty.IsNotNull() && !isHelperObject)
310 QString item = name.c_str();
312 id->setCheckable(
true);
316 id->setChecked(
true);
324 contextMenu->exec(QCursor::pos());
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)
Sets new Level/Window values and informs 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
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...
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
const LevelWindow & GetLevelWindow()
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
std::map< std::string, double > & getLevelPresets()
itk::SmartPointer< const Self > ConstPointer
DataStorage::SetOfObjects::ConstPointer GetRelevantNodes()
void setUpperLimit(double rangeMax)
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 ...
void SetRangeMinMax(ScalarType min, ScalarType max)
std::map< std::string, double > getLevelPresets()
void ResetDefaultRangeMinMax()
the default min and max range for image will be reset
LevelWindowProperty::Pointer GetLevelWindowProperty()
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)
Sets an specific LevelWindowProperty, all changes will affect the image belonging to this property...
ScalarType GetRangeMax() const
double getWindow(std::string window)
void SetToMaxWindowSize()
std::map< std::string, double > & getWindowPresets()
ScalarType GetRangeMin() const
void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode=nullptr)
(Re-)Initializes the LevelWindowManager by setting the topmost image. Use the removedNode parameter i...
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
ScalarType GetWindow() const
returns the current window size, i.e the range size of the current grey value interval ...
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Class for nodes of the DataTree.
ScalarType GetLevel() const
method that returns the level value, i.e. the center of the current grey value interval ...