Skip to content

Commit

Permalink
DOC: Remove redundant sphinx directives duplicating type annotations
Browse files Browse the repository at this point in the history
The generated API documentation reports the types based on the type
annotations.
  • Loading branch information
jcfr committed Mar 28, 2024
1 parent e1a65df commit 0f0f110
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
1 change: 0 additions & 1 deletion AutoscoperM/AutoscoperM.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,6 @@ def extractSubVolumeForVRG(
:param cameraDebugMode: Whether or not to keep the extracted volume in the scene, defaults to False
:return: tuple containing the extracted volume and the bounds of the volume
:rtype: tuple[vtk.vtkImageData, list[float]]
"""
mergedSegmentationNode = SubVolumeExtraction.mergeSegments(volumeNode, segmentationNode)
newVolumeNode = SubVolumeExtraction.extractSubVolume(
Expand Down
23 changes: 1 addition & 22 deletions AutoscoperM/AutoscoperMLib/RadiographGeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,12 @@ def generateNCameras(
Generate N cameras
:param N: Number of cameras to generate
:type N: int
:param bounds: Bounds of the volume
:type bounds: list[int]
:param offset: Offset from the volume. Defaults to 100.
:type offset: int
:param imageSize: Image size. Defaults to [512,512].
:type imageSize: list[int]
:param camDebugMode: Whether or not to show the cameras in the scene. Defaults to False.
:type camDebugMode: bool
:return: List of cameras
:rtype: list[Camera]
"""
# find the center of the bounds
center = [(bounds[0] + bounds[1]) / 2, (bounds[2] + bounds[3]) / 2, (bounds[4] + bounds[5]) / 2]
Expand Down Expand Up @@ -165,17 +155,12 @@ def generateCamerasFromMarkups(
Generate cameras from a markups fiducial node
:param fiduaicalNode: Markups fiducial node
:type fiduaicalNode: slicer.vtkMRMLMarkupsFiducialNode
:param volumeBounds: Bounds of the volume
:type volumeBounds: list[int]
:param clippingRange: Clipping range
:type clippingRange: tuple[int]
:param viewAngle: View angle
:type viewAngle: int
:param imageSize: Image size. Defaults to [512,512].
:type imageSize: list[int]
:param cameraDebug: Whether or not to show the cameras in the scene. Defaults to False.
:type cameraDebug: bool
:return: List of cameras
"""
center = [
Expand Down Expand Up @@ -210,16 +195,10 @@ def optimizeCameras(
Optimize the cameras by finding the N cameras with the best data intensity density.
:param cameras: Cameras
:type cameras: list[Camera]
:param cameraDir: Camera directory
:type cameraDir: str
:param nOptimizedCameras: Number of optimized cameras to find
:type nOptimizedCameras: int
:return: Optimized cameras
:rtype: list[Camera]
"""
import glob
import os
Expand Down
20 changes: 0 additions & 20 deletions TrackingEvaluation/TrackingEvaluationLib/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ def loadTraAsSequence(data: np.ndarray) -> list[vtk.vtkMatrix4x4]:
Converts the tracking data to a list of vtkMatrix4x4.
:param data: The tracking data.
:type data: np.ndarray
:return: The tracking data as a sequence.
:rtype: list[vtk.vtkMatrix4x4]
"""
_, cols = data.shape

Expand Down Expand Up @@ -50,10 +48,8 @@ def tmpTFMLoader(
Loads a tfm file and returns the matrix.
:param fileName: The filename of the tfm file.
:type fileName: str
:return: The matrix from the tfm file.
:rtype: vtk.vtkMatrix4x4
"""
with open(fileName) as f:
lines = f.readlines()
Expand All @@ -73,9 +69,7 @@ class ModelData:
Class to store the model data.
:param modelFileName: The filename of the model.
:type modelFileName: str
:param groundTruthSequenceData: The ground truth sequence data.
:type groundTruthSequenceData: np.ndarray
"""

def __init__(self, modelFileName: str, groundTruthSequenceData: np.ndarray):
Expand Down Expand Up @@ -140,7 +134,6 @@ def loadUserTrackingSequence(self, userSequence: list[vtk.vtkMatrix4x4]):
Load the user tracking sequence.
:param userSequence: The user tracking sequence.
:type userSequence: list[vtk.vtkMatrix4x4]
"""
self.userSequence = userSequence

Expand All @@ -149,7 +142,6 @@ def updateTransform(self, index: int):
Update the transform of the model node.
:param index: The index of the transform.
:type index: int
"""
if self.userSequence is None:
slicer.util.errorDisplay("No user tracking data!")
Expand All @@ -168,11 +160,8 @@ def evaluateError(self, index: int, translationTol: float = 1.0, degreeTol: floa
in the correct position.
:param index: The index of the transform.
:type index: int
:param translationTol: The translation tolerance in mm.
:type translationTol: float
:param degreeTol: The rotation tolerance in degrees.
:type degreeTol: float
"""
if self.userSequence is None:
slicer.util.errorDisplay("No user tracking data!")
Expand Down Expand Up @@ -241,7 +230,6 @@ def setColor(self, rgb: tuple[float, float, float] = (1.0, 1.0, 1.0)):
Update the color of the model node.
:param rgb: The RGB color to set.
:type rgb: Tuple[float, float, float]
"""
self.userDisplayNode.SetColor(rgb[0], rgb[1], rgb[2])

Expand All @@ -250,7 +238,6 @@ def setGroundTruthVisible(self, visible: bool):
Hide or show the ground truth model node.
:param visible: whether the ground truth model node is visible or not.
:type visible: bool
"""
self.groundTruthDisplayNode.SetVisibility(visible)

Expand All @@ -260,9 +247,7 @@ class Scene:
Class to store the scene data.
:param sampleDataType: The sample data type.
:type sampleDataType: str
:param userSequenceFileName: The filename of the user sequence.
:type userSequenceFileName: str
"""

def __init__(self, sampleDataType: str, userSequenceFileName: str):
Expand Down Expand Up @@ -312,10 +297,8 @@ def _parseUserSequence(self, userSequenceFileName: str) -> list[int]:
Internal function to parse the user sequence.
:param userSequenceFileName: The filename of the user sequence.
:type userSequenceFileName: str
:return: List of indices that correspond to any models with Nan tracking values.
:rtype: list[int]
"""

if not os.path.exists(userSequenceFileName):
Expand Down Expand Up @@ -355,11 +338,8 @@ def updateTransforms(self, index: int, translationTol: float = 1.0, degreeTol: f
Update the transforms of the models and evaluate the error compared to the ground truth.
:param index: The index of the transform.
:type index: int
:param translationTol: The translation tolerance.
:type translationTol: float
:param degreeTol: The degree tolerance.
:type degreeTol: float
"""
self.currentFrame = index
for i, model in enumerate(self.models): # Probably want to make this multithreaded instead of sequential.
Expand Down

0 comments on commit 0f0f110

Please sign in to comment.