Commit 4ce5fa49bd2d85b1dd24641b10843cd64b4b2b33
1 parent
eb3e7a37
Exists in
master
and in
25 other branches
Using 3 decimal places in measurements
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
invesalius/data/measures.py
| ... | ... | @@ -240,9 +240,9 @@ class MeasurementManager(object): |
| 240 | 240 | type_ = TYPE[type] |
| 241 | 241 | location = LOCATION[location] |
| 242 | 242 | if type == const.LINEAR: |
| 243 | - value = u"%.2f mm"% m.value | |
| 243 | + value = u"%.3f mm"% m.value | |
| 244 | 244 | else: |
| 245 | - value = u"%.2f°"% m.value | |
| 245 | + value = u"%.3f°"% m.value | |
| 246 | 246 | |
| 247 | 247 | msg = 'Update measurement info in GUI', |
| 248 | 248 | Publisher.sendMessage(msg, |
| ... | ... | @@ -275,9 +275,9 @@ class MeasurementManager(object): |
| 275 | 275 | location = LOCATION[m.location] |
| 276 | 276 | |
| 277 | 277 | if m.type == const.LINEAR: |
| 278 | - value = u"%.2f mm"% m.value | |
| 278 | + value = u"%.3f mm"% m.value | |
| 279 | 279 | else: |
| 280 | - value = u"%.2f°"% m.value | |
| 280 | + value = u"%.3f°"% m.value | |
| 281 | 281 | |
| 282 | 282 | Publisher.sendMessage('Update measurement info in GUI', |
| 283 | 283 | (index, name, colour, |
| ... | ... | @@ -543,7 +543,7 @@ class LinearMeasure(object): |
| 543 | 543 | |
| 544 | 544 | def _draw_text(self): |
| 545 | 545 | p1, p2 = self.points |
| 546 | - text = ' %.2f mm ' % \ | |
| 546 | + text = ' %.3f mm ' % \ | |
| 547 | 547 | math.sqrt(vtk.vtkMath.Distance2BetweenPoints(p1, p2)) |
| 548 | 548 | x,y,z=[(i+j)/2 for i,j in zip(p1, p2)] |
| 549 | 549 | textsource = vtk.vtkTextSource() |
| ... | ... | @@ -804,7 +804,7 @@ class AngularMeasure(object): |
| 804 | 804 | return arc |
| 805 | 805 | |
| 806 | 806 | def _draw_text(self): |
| 807 | - text = u' %.2f ' % \ | |
| 807 | + text = u' %.3f ' % \ | |
| 808 | 808 | self.CalculateAngle() |
| 809 | 809 | x,y,z= self.points[1] |
| 810 | 810 | textsource = vtk.vtkTextSource() | ... | ... |