MCPcopy Create free account
hub / github.com/Kitware/VTK / SetWindowLevel

Method SetWindowLevel

Interaction/Widgets/vtkImagePlaneWidget.cxx:1228–1263  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1226
1227//------------------------------------------------------------------------------
1228void vtkImagePlaneWidget::SetWindowLevel(double window, double level, int copy)
1229{
1230 if (copy)
1231 {
1232 this->CurrentWindow = window;
1233 this->CurrentLevel = level;
1234 return;
1235 }
1236
1237 if (this->CurrentWindow == window && this->CurrentLevel == level)
1238 {
1239 return;
1240 }
1241
1242 // if the new window is negative and the old window was positive invert table
1243 if (((window < 0 && this->CurrentWindow > 0) || (window > 0 && this->CurrentWindow < 0)) &&
1244 !this->UserControlledLookupTable)
1245 {
1246 this->InvertTable();
1247 }
1248
1249 this->CurrentWindow = window;
1250 this->CurrentLevel = level;
1251
1252 if (!this->UserControlledLookupTable)
1253 {
1254 double rmin = this->CurrentLevel - 0.5 * fabs(this->CurrentWindow);
1255 double rmax = rmin + fabs(this->CurrentWindow);
1256 this->LookupTable->SetTableRange(rmin, rmax);
1257 }
1258
1259 if (this->Enabled)
1260 {
1261 this->Interactor->Render();
1262 }
1263}
1264
1265//------------------------------------------------------------------------------
1266void vtkImagePlaneWidget::GetWindowLevel(double wl[2])

Callers 15

OnCharMethod · 0.95
SetInputConnectionMethod · 0.95
SetLookupTableMethod · 0.95
ExecuteMethod · 0.45
QtVTKRenderWindowsMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
TestResliceCursorWidget2Function · 0.45
ExecuteMethod · 0.45
TestResliceCursorWidget3Function · 0.45
ExecuteMethod · 0.45
SetThickModeMethod · 0.45

Calls 3

InvertTableMethod · 0.95
SetTableRangeMethod · 0.80
RenderMethod · 0.65

Tested by 6

ExecuteMethod · 0.36
TestResliceCursorWidget2Function · 0.36
ExecuteMethod · 0.36
TestResliceCursorWidget3Function · 0.36
ExecuteMethod · 0.36
TestCornerAnnotationFunction · 0.36