Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update alignment volume_dim voxel source #380

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
6 changes: 3 additions & 3 deletions ingestion_tools/scripts/tests/s3_import/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def voxel_spacing_importer_factory(deposition_config: DepositionImportConfig) ->
vs = VoxelSpacingImporter(
config=deposition_config,
metadata={},
name="14.08",
name="1.1234", # Hardcoding this to match the value in fixtures/annotations/anno_config.yaml
path="vs1",
parents={**run.parents, **{"run": run}},
)
Expand Down Expand Up @@ -1499,7 +1499,7 @@ def test_ingest_triangular_mesh(

# Assert
# verify local_metadata
path = "dataset1/run1/Reconstructions/VoxelSpacing14.080/Annotations/100/some_protein-1.0_triangularmesh.glb"
path = "dataset1/run1/Reconstructions/VoxelSpacing1.123/Annotations/100/some_protein-1.0_triangularmesh.glb"
expected_local_metadata = {
"object_count": 1,
"alignment_metadata_path": "foo",
Expand Down Expand Up @@ -1568,7 +1568,7 @@ def test_ingest_triangular_mesh_hff(
anno.import_metadata()
# Assert
# verify local_metadata
path = "dataset1/run1/Reconstructions/VoxelSpacing14.080/Annotations/100/some_protein-1.0_triangularmesh.glb"
path = "dataset1/run1/Reconstructions/VoxelSpacing1.123/Annotations/100/some_protein-1.0_triangularmesh.glb"
expected_local_metadata = {
"object_count": 1,
"alignment_metadata_path": "foo",
Expand Down
Loading