Skip to content

Commit

Permalink
fix: Add scipy as dependency and fix read_tile_sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabor committed Jun 3, 2024
2 parents ce2ba07 + 49ad86a commit 409f6a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies = [
'pydantic',
'psutil',
'matplotlib',
'scipy',
'aind-data-schema',
'aind-codeocean-api==0.3.0',
'aind-ng-link>=1.0.15',
Expand Down
19 changes: 10 additions & 9 deletions src/aind_exaspim_pipeline_utils/qc/tile_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_tile_xyz_size(zgpath: str, level: int): # pragma: no cover


def read_tile_sizes(xml_ViewSetups: OrderedDict) -> dict[int, np.ndarray]: # pragma: no cover
"""Iterate over the 15 tile ids and read their sizes from the ViewSetup section of the xml file.
"""Read all the tile sizes defined in the given xml section.
Parameters
----------
Expand All @@ -125,15 +125,16 @@ def read_tile_sizes(xml_ViewSetups: OrderedDict) -> dict[int, np.ndarray]: # pr
as defined in the xml file, i.e. x,y,z.
"""
tile_sizes = {}
for x in range(15):
for xml_vSetup in xml_ViewSetups["ViewSetup"]:
if xml_vSetup["id"]:
break
else:
raise KeyError("setupId {} was not found".format(x))

vsl = xml_ViewSetups["ViewSetup"]
if not isinstance(vsl, list):
# One entry case
vsl = [
vsl,
]
for xml_vSetup in vsl:
x = int(xml_vSetup["id"])
xml_sizes = xml_vSetup["size"]
tile_sizes[x] = np.array([int(x) for x in xml_sizes.strip().split()], dtype=int)
tile_sizes[x] = np.array([int(y) for y in xml_sizes.strip().split()], dtype=int)
return tile_sizes


Expand Down

0 comments on commit 409f6a8

Please sign in to comment.