Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into kaloster/docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloster committed Dec 11, 2024
2 parents 6ea9eff + c6f375c commit c0d1540
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 113 deletions.
184 changes: 92 additions & 92 deletions apiv2/poetry.lock

Large diffs are not rendered by default.

70 changes: 56 additions & 14 deletions ingestion_tools/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ingestion_tools/scripts/importers/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_tomogram_volume_dimension(self) -> dict:
if not tomogram:
# If no source tomogram is found don't create a default alignment metadata file.
raise TomogramNotFoundError()
voxel_size = round(tomogram.get_source_volume_info().voxel_size, 3)
voxel_size = round(tomogram.get_voxel_spacing().as_float(), 3)
dim = tomogram.get_source_volume_info().get_dimensions()
return {d: voxel_size * dim[d] for d in "xyz"}

Expand Down
10 changes: 8 additions & 2 deletions ingestion_tools/scripts/importers/visualization_precompute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from pathlib import Path
from typing import Any

from cryoet_data_portal_neuroglancer.precompute import points, segmentation_mask

from common import colors
from common.config import DepositionImportConfig
from common.finders import DefaultImporterFactory
Expand Down Expand Up @@ -90,6 +88,10 @@ def neuroglancer_precompute(self, output_prefix: str, voxel_spacing: float) -> N
precompute_path = self._get_neuroglancer_precompute_path(annotation_path, output_prefix)
metadata = self.annotation.metadata
tmp_path = fs.localwritable(precompute_path)
# Importing this at runtime instead of compile time since zfpy (a dependency of this
# module) cannot be imported successfully on darwin/ARM machines.
from cryoet_data_portal_neuroglancer.precompute import points

points.encode_annotation(
self.annotation.get_output_data(annotation_path),
metadata,
Expand Down Expand Up @@ -136,6 +138,10 @@ def neuroglancer_precompute(self, output_prefix: str, voxel_spacing: float) -> N
precompute_path = self._get_neuroglancer_precompute_path(annotation_path, output_prefix)
tmp_path = fs.localwritable(precompute_path)
zarr_file_path = fs.destformat(self.annotation.get_output_filename(annotation_path, "zarr"))
# Importing this at runtime instead of compile time since zfpy (a dependency of this
# module) cannot be imported successfully on darwin/ARM machines.
from cryoet_data_portal_neuroglancer.precompute import segmentation_mask

segmentation_mask.encode_segmentation(
zarr_file_path,
Path(tmp_path),
Expand Down
2 changes: 1 addition & 1 deletion ingestion_tools/scripts/tests/s3_import/test_alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_default_alignment_import_with_tomograms(
"tilt_offset": 0,
"tilt_path": None,
"tiltx_path": None,
"volume_dimension": {"x": 13.48 * 6, "y": 13.48 * 8, "z": 13.48 * 10},
"volume_dimension": {"x": 4.123 * 6, "y": 4.123 * 8, "z": 4.123 * 10},
"volume_offset": {"x": 0, "y": 0, "z": 0},
"x_rotation_offset": 0,
}
Expand Down
Loading

0 comments on commit c0d1540

Please sign in to comment.