Skip to content

Commit

Permalink
BUG: Fix generation camera calibration file
Browse files Browse the repository at this point in the history
Revert previous commit as comments are not supported in json spec.
See https://stackoverflow.com/questions/244777/can-comments-be-used-in-json/244858#244858
  • Loading branch information
jcfr committed Apr 18, 2024
1 parent 33df368 commit 2ee59eb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions AutoscoperM/AutoscoperMLib/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ def generateCameraCalibrationFile(camera: Camera, filename: str):
contents["view-angle"] = camera.vtkCamera.GetViewAngle()
contents["image-width"] = camera.imageSize[0]
contents["image-height"] = camera.imageSize[1]
# The clipping-range field is not used by Autoscoper, it is used to communicate
# information between AutoscoperM and VirtualRadiographGeneration modules within Slicer.
contents["clipping-range"] = camera.vtkCamera.GetClippingRange()

contents_json = json.dumps(contents, indent=4)

# Add comments to file
contents_json += """\n//Note: the clipping-range field is not used by Autoscoper,
this is used to commuincate information between AutoscoperM and
VirtualRadiographGeneration modules within Slicer."""

with open(filename, "w+") as f:
f.write(contents_json)

Expand Down

0 comments on commit 2ee59eb

Please sign in to comment.