Skip to content

Commit

Permalink
minor cosmetic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Apr 2, 2024
1 parent ab85eba commit 7b964bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions markimg/markimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,12 @@ def run(self, options):
d_pixel[item] = px_length

unit = 'cm'
msg = ''
warning_msg = ''
if ht_scale == 0:
unit = 'px'
msg = ('WARNING: \n'
'DICOM is missing FOVDimension tag.\n'
'Calculations in cm are not possible.')
warning_msg = ('WARNING: \n'
'DICOM is missing FOVDimension tag.\n'
'Calculations in cm are not possible.')

if options.textPos == "left":
x_pos = 0
Expand Down Expand Up @@ -540,9 +540,9 @@ def run(self, options):
x_pos = x_pos + line_gap
plt.text(x_pos, y_pos, totalLeftInfo, color='white', fontsize=options.textSize, rotation=90)

totalDiff = self.getDiff(self.getSum(d_lengths['Left femur'], d_lengths['Left tibia']), \
totalDiff = self.getDiff(self.getSum(d_lengths['Left femur'], d_lengths['Left tibia']),
self.getSum(d_lengths['Right femur'], d_lengths['Right tibia']))
totalComp = self.compareLength(self.getSum(d_lengths['Left femur'], d_lengths['Left tibia']), \
totalComp = self.compareLength(self.getSum(d_lengths['Left femur'], d_lengths['Left tibia']),
self.getSum(d_lengths['Right femur'], d_lengths['Right tibia']))

totalDiffInfo = str(totalDiff) + f' {unit}, ' + totalComp
Expand All @@ -551,13 +551,14 @@ def run(self, options):
x_pos = x_pos + line_gap
plt.text(x_pos, y_pos, totalDiffText, color='white', fontsize=options.textSize, rotation=90)

# Print some blank lines
for i in range(0, 2):
x_pos = x_pos + line_gap
plt.text(x_pos, y_pos, '', color='white', fontsize=options.textSize, rotation=90)
rotation = 0
plt.text(x_pos, y_pos, msg, color='cyan', fontsize=options.textSize, rotation=90)
for i in range(0, 2):
if warning_msg:
# Print some blank lines
for i in range(0, 2):
x_pos = x_pos + line_gap
plt.text(x_pos, y_pos, '', color='white', fontsize=options.textSize, rotation=90)
rotation = 0
plt.text(x_pos, y_pos, warning_msg, color='cyan', fontsize=options.textSize, rotation=90)
for i in range(0, 4):
x_pos = x_pos + line_gap
plt.text(x_pos, y_pos, '', color='white', fontsize=options.textSize, rotation=90)
plt.text(x_pos, y_pos, options.addText, color=options.addTextColor, fontsize=options.addTextSize,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='markimg',
version='1.4.5',
version='1.4.6',
description='An app to mark landmark points and lines on an input image',
long_description=readme,
author='FNNDSC',
Expand Down

0 comments on commit 7b964bc

Please sign in to comment.