comparison Framework/Layers/OrthancFrameLayerSource.cpp @ 102:fcec0ab44054 wasm

display volumes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 31 May 2017 17:01:18 +0200
parents 166a555becbf
children 53025eecbc95
comparison
equal deleted inserted replaced
101:af312ce4fe59 102:fcec0ab44054
92 { 92 {
93 size_t index; 93 size_t index;
94 if (loader_.IsGeometryReady() && 94 if (loader_.IsGeometryReady() &&
95 loader_.LookupSlice(index, viewportSlice)) 95 loader_.LookupSlice(index, viewportSlice))
96 { 96 {
97 const Slice& slice = loader_.GetSlice(index); 97 loader_.GetSlice(index).GetExtent(points);
98 const SliceGeometry& plane = slice.GetGeometry();
99
100 double sx = slice.GetPixelSpacingX();
101 double sy = slice.GetPixelSpacingY();
102 double w = static_cast<double>(slice.GetWidth());
103 double h = static_cast<double>(slice.GetHeight());
104
105 points.clear();
106 points.push_back(plane.MapSliceToWorldCoordinates(-0.5 * sx, -0.5 * sy));
107 points.push_back(plane.MapSliceToWorldCoordinates((w - 0.5) * sx, -0.5 * sy));
108 points.push_back(plane.MapSliceToWorldCoordinates(-0.5 * sx, (h - 0.5) * sy));
109 points.push_back(plane.MapSliceToWorldCoordinates((w - 0.5) * sx, (h - 0.5) * sy));
110 return true; 98 return true;
111 } 99 }
112 else 100 else
113 { 101 {
114 return false; 102 return false;