|
19 | 19 | import matplotlib.pyplot as plt |
20 | 20 | from chrisapp.base import ChrisApp |
21 | 21 | from loguru import logger |
22 | | -from pflog import pflog |
23 | 22 | from markimg.imageCanvas import ImageCanvas |
24 | 23 | import numpy as np |
25 | 24 |
|
@@ -385,10 +384,6 @@ def preamble_show(self, options) -> None: |
385 | 384 | LOG("%25s: [%s]" % (k, v)) |
386 | 385 | LOG("") |
387 | 386 |
|
388 | | - @pflog.tel_logTime( |
389 | | - event='markimg', |
390 | | - log='Draw line segments between landmark points on an input image' |
391 | | - ) |
392 | 387 | def run(self, options): |
393 | 388 | """ |
394 | 389 | Define the code to be run by this plugin app. |
@@ -531,8 +526,8 @@ def run(self, options): |
531 | 526 | femurDiffText = 'Difference'.rjust(16) + f': {femurDiffInfo}' |
532 | 527 | d_femur['Difference'] = femurDiffInfo + \ |
533 | 528 | self.compareLength(d_lengths['Left femur'], d_lengths['Right femur']).split(':')[1] |
534 | | - report_json["FEMUR DIFF"] = str(self.getDiff(d_lengths['Right femur'], d_lengths['Left femur'])) |
535 | | - report_json["FEMUR LATERALITY"] = self.compareLength(d_lengths['Left femur'], d_lengths['Right femur']).split(' ')[0].upper() |
| 529 | + report_json["FEMUR DIFF"] = str(float(self.getDiff(d_lengths['Right femur'], d_lengths['Left femur']))) |
| 530 | + report_json["FEMUR LATERALITY"] = self.compareLength(d_lengths['Left femur'], d_lengths['Right femur']).split(' ')[0] |
536 | 531 |
|
537 | 532 | x_pos = x_pos + line_gap |
538 | 533 | plt.text(x_pos, y_pos, femurDiffText, color='white', fontsize=options.textSize, rotation=90) |
@@ -560,8 +555,8 @@ def run(self, options): |
560 | 555 | tibaiDiffText = 'Difference'.rjust(16) + f': {tibiaDiffInfo}' |
561 | 556 | d_tibia['Difference'] = tibiaDiffInfo + \ |
562 | 557 | self.compareLength(d_lengths['Left tibia'], d_lengths['Right tibia']).split(':')[1] |
563 | | - report_json["TIBIA DIFF"] = str(self.getDiff(d_lengths['Right tibia'], d_lengths['Left tibia'])) |
564 | | - report_json["TIBIA LATERALITY"] = self.compareLength(d_lengths['Left tibia'], d_lengths['Right tibia']).split(' ')[0].upper() |
| 558 | + report_json["TIBIA DIFF"] = str(float(self.getDiff(d_lengths['Right tibia'], d_lengths['Left tibia']))) |
| 559 | + report_json["TIBIA LATERALITY"] = self.compareLength(d_lengths['Left tibia'], d_lengths['Right tibia']).split(' ')[0] |
565 | 560 | x_pos = x_pos + line_gap |
566 | 561 | plt.text(x_pos, y_pos, tibaiDiffText, color='white', fontsize=options.textSize, rotation=90) |
567 | 562 |
|
@@ -591,8 +586,8 @@ def run(self, options): |
591 | 586 | totalDiffInfo = str(totalDiff) + f' {unit}, ' + totalComp.split(':')[0] |
592 | 587 | totalDiffText = 'Total difference'.rjust(16) + f': {totalDiffInfo}' |
593 | 588 | d_total['Difference'] = totalDiffInfo + totalComp.split(':')[1] |
594 | | - report_json["TOTAL DIFF"] = str(totalDiff) |
595 | | - report_json["TOTAL LATERALITY"] = totalComp.split(' ')[0].upper() |
| 589 | + report_json["TOTAL DIFF"] = str(float(totalDiff)) |
| 590 | + report_json["TOTAL LATERALITY"] = totalComp.split(' ')[0] |
596 | 591 | x_pos = x_pos + line_gap |
597 | 592 | plt.text(x_pos, y_pos, totalDiffText, color='white', fontsize=options.textSize, rotation=90) |
598 | 593 |
|
|
0 commit comments