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

Method SetSliceOrientation

Interaction/Image/vtkImageViewer2.cxx:260–295  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

258
259//------------------------------------------------------------------------------
260void vtkImageViewer2::SetSliceOrientation(int orientation)
261{
262 if (orientation < vtkImageViewer2::SLICE_ORIENTATION_YZ ||
263 orientation > vtkImageViewer2::SLICE_ORIENTATION_XY)
264 {
265 vtkErrorMacro("Error - invalid slice orientation " << orientation);
266 return;
267 }
268
269 if (this->SliceOrientation == orientation)
270 {
271 return;
272 }
273
274 this->SliceOrientation = orientation;
275
276 // Update the viewer
277
278 int* range = this->GetSliceRange();
279 if (range)
280 {
281 this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
282 }
283
284 this->UpdateOrientation();
285 this->UpdateDisplayExtent();
286
287 if (this->Renderer && this->GetInput())
288 {
289 double scale = this->Renderer->GetActiveCamera()->GetParallelScale();
290 this->Renderer->ResetCamera();
291 this->Renderer->GetActiveCamera()->SetParallelScale(scale);
292 }
293
294 this->Render();
295}
296
297//------------------------------------------------------------------------------
298void vtkImageViewer2::UpdateOrientation()

Callers 5

QtVTKRenderWindowsMethod · 0.45
SetSliceOrientationToXYFunction · 0.45
SetSliceOrientationToYZFunction · 0.45
SetSliceOrientationToXZFunction · 0.45
TestStencilWithLassoFunction · 0.45

Calls 8

GetSliceRangeMethod · 0.95
UpdateOrientationMethod · 0.95
UpdateDisplayExtentMethod · 0.95
GetInputMethod · 0.95
RenderMethod · 0.95
GetActiveCameraMethod · 0.80
SetParallelScaleMethod · 0.80
ResetCameraMethod · 0.45

Tested by 1

TestStencilWithLassoFunction · 0.36