Skip to content

Commit

Permalink
use pixel spacing if FOV dimension is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Oct 14, 2024
1 parent 4b2b8ae commit fe35524
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion csv2json/csv2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ def make_json(self,csvFilePath, jsonFilePath, dcm_file_list,tags,detail_tags):
height = dimension[0]
width = dimension[1]
except:
print(f"\nWARNING: Original dimension does not exist for {key}.")
print(f"\nWARNING: Original dimension does not exist for {key}."
f"\nUsing PixelSpacing for height and width calculation.")
pixel_spacing = dcm_image.PixelSpacing
height = round(pixel_spacing[0] * dcm_image.Rows)
width = round(pixel_spacing[0] * dcm_image.Columns)



Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = 'csv2json',
version = '1.3.5',
version = '1.3.6',
description = 'An app to convert CSV generated from pl-lld_inference to a JSON representation',
long_description = readme,
author = 'FNNDSC',
Expand Down

0 comments on commit fe35524

Please sign in to comment.