Commit ecae62b9611b6f154df828ac1388430dfa3ddb39
1 parent
1fbf17c3
Exists in
master
and in
54 other branches
the ball reference is proportional to the slice spacing
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
invesalius/data/viewer_volume.py
... | ... | @@ -219,8 +219,14 @@ class Viewer(wx.Panel): |
219 | 219 | self.interactor.Render() |
220 | 220 | |
221 | 221 | def CreateBallReference(self): |
222 | + MRAD = 3.0 | |
223 | + proj = prj.Project() | |
224 | + s = proj.spacing | |
225 | + # The sphere's radius will be MRAD times bigger than the media of the | |
226 | + # spacing values. | |
227 | + r = (s[0] + s[1] + s[2]) / 3.0 * MRAD | |
222 | 228 | self.ball_reference = vtk.vtkSphereSource() |
223 | - self.ball_reference.SetRadius(5) | |
229 | + self.ball_reference.SetRadius(r) | |
224 | 230 | |
225 | 231 | mapper = vtk.vtkPolyDataMapper() |
226 | 232 | mapper.SetInput(self.ball_reference.GetOutput()) | ... | ... |