Skip to content

Commit

Permalink
Merge pull request #77 from camlloyd/boundaries
Browse files Browse the repository at this point in the history
Set missing data points to default value of `0`
  • Loading branch information
camlloyd authored Dec 5, 2024
2 parents 17a67b3 + f3933b8 commit 476f002
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/oct_to_tiff/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ def extract_boundaries(input_path: str | Path) -> None:
tree = DET.parse(input_path)
root = tree.getroot()

array_size = int(root.findtext("./Curve_Set/Image/Curve/ARRAY"))
array_size = int(root.findtext("./Curve_Set/Image/Curve/ARRAY", 0))
data_points = [
int(point.text) for point in root.findall("./Curve_Set/Image/Curve/D")
int(point.text) if point.text else 0
for point in root.findall("./Curve_Set/Image/Curve/D")
]
scan_length = np.arange(len(data_points))
num_files = len(data_points) // array_size
Expand Down

0 comments on commit 476f002

Please sign in to comment.