Skip to content

Commit

Permalink
BUG: Remove obsolete VRG Generation functionality
Browse files Browse the repository at this point in the history
Removes the 'Manual Camera Placement' and 'Automatic Camera Placement'
VRG Generation UI groups from the Pre-Processing modules, along with all
of their associated backend code. This includes the removal of the
CalculateDataIntensityDensity and VirtualRadiographGeneration modules.
  • Loading branch information
sbelsk committed Nov 10, 2024
1 parent b427272 commit 34a9c6e
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 1,406 deletions.
413 changes: 1 addition & 412 deletions AutoscoperM/AutoscoperM.py

Large diffs are not rendered by default.

34 changes: 2 additions & 32 deletions AutoscoperM/AutoscoperMLib/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import slicer
import vtk

from .RadiographGeneration import Camera


def loadSegmentation(segmentationNode: slicer.vtkMRMLSegmentationNode, filename: str):
"""
Expand All @@ -35,34 +33,6 @@ def loadSegmentation(segmentationNode: slicer.vtkMRMLSegmentationNode, filename:
return None


def generateCameraCalibrationFile(camera: Camera, filename: str):
"""
Generates a VTK camera calibration json file from the given camera.
:param camera: Camera
:param filename: Output file name
"""
import json

contents = {}
contents["@schema"] = "https://autoscoperm.slicer.org/vtkCamera-schema-1.0.json"
contents["version"] = 1.0
contents["focal-point"] = camera.vtkCamera.GetFocalPoint()
contents["camera-position"] = camera.vtkCamera.GetPosition()
contents["view-up"] = camera.vtkCamera.GetViewUp()
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)

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


def generateConfigFile(
mainDirectory: str,
subDirectories: list[str],
Expand Down Expand Up @@ -265,7 +235,7 @@ def writeTRA(fileName: str, transforms: list[vtk.vtkMatrix4x4]) -> None:
traFile.write(",".join(row) + "\n")


def writeTemporyFile(filename: str, data: vtk.vtkImageData) -> str:
def writeTemporaryFile(filename: str, data: vtk.vtkImageData) -> str:
"""
Writes a temporary file to the slicer temp directory
Expand All @@ -285,7 +255,7 @@ def writeTemporyFile(filename: str, data: vtk.vtkImageData) -> str:
return writer.GetFileName()


def removeTemporyFile(filename: str):
def removeTemporaryFile(filename: str):
"""
Removes a temporary file from the slicer temp directory
Expand Down
239 changes: 0 additions & 239 deletions AutoscoperM/AutoscoperMLib/RadiographGeneration.py

This file was deleted.

1 change: 0 additions & 1 deletion AutoscoperM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(MODULE_PYTHON_SCRIPTS
${MODULE_NAME}.py
${MODULE_NAME}Lib/__init__.py
${MODULE_NAME}Lib/IO.py
${MODULE_NAME}Lib/RadiographGeneration.py
${MODULE_NAME}Lib/SubVolumeExtraction.py
)

Expand Down
Loading

0 comments on commit 34a9c6e

Please sign in to comment.