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: Updating alignment dimensions and offsets to Angstrom #323

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion ingestion_tools/scripts/importers/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ 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()
return tomogram.get_source_volume_info().get_dimensions()
voxel_size = round(tomogram.get_source_volume_info().voxel_size, 3)
return {d: voxel_size for d in "xyz"}
uermel marked this conversation as resolved.
Show resolved Hide resolved

def is_default_alignment(self) -> bool:
return "default" in self.file_paths
Expand Down
6 changes: 3 additions & 3 deletions ingestion_tools/scripts/tests/s3_import/test_alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_alignment_import_item(
"tilt_offset": -0.3,
"tilt_path": f"{prefix}/{id_prefix}/TS_run1.tlt",
"tiltx_path": f"{prefix}/{id_prefix}/TS_run1.xtilt",
"volume_dimension": {"x": 6, "y": 8, "z": 10},
"volume_dimension": {"x": 13.48, "y": 13.48, "z": 13.48},
"volume_offset": {"x": -1, "y": 2, "z": -3},
"x_rotation_offset": -2.3,
}
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_alignment_import_item_aretomo(
"tilt_offset": -0.3,
"tilt_path": None,
"tiltx_path": None,
"volume_dimension": {"x": 6, "y": 8, "z": 10},
"volume_dimension": {"x": 13.48, "y": 13.48, "z": 13.48},
"volume_offset": {"x": -1, "y": 2, "z": -3},
"x_rotation_offset": -2.3,
}
Expand Down 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": 6, "y": 8, "z": 10},
"volume_dimension": {"x": 13.48, "y": 13.48, "z": 13.48},
"volume_offset": {"x": 0, "y": 0, "z": 0},
"x_rotation_offset": 0,
}
Expand Down
66 changes: 33 additions & 33 deletions schema/core/v2.0.0/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,65 +752,65 @@ classes:
attributes:
x:
any_of:
- range: integer
- range: IntegerFormattedString
- range: float
- range: FloatFormattedString
required: true
description: Number of pixels in the 3D data fast axis
description: X dimension of the reconstruction volume in angstrom
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å
y:
any_of:
- range: integer
- range: IntegerFormattedString
- range: float
- range: FloatFormattedString
required: true
description: Number of pixels in the 3D data medium axis
description: Y dimension of the reconstruction volume in angstrom
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å
z:
any_of:
- range: integer
- range: IntegerFormattedString
- range: float
- range: FloatFormattedString
required: true
description: Number of pixels in the 3D data slow axis. This is the image projection direction at zero stage tilt
description: Z dimension of the reconstruction volume in angstrom
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å

AlignmentOffset:
description: &desc_alignment_offset The offset of a alignment in voxels in each dimension relative to the canonical tomogram.
attributes:
x:
any_of:
- range: integer
- range: cdp-common:IntegerFormattedString
- range: float
- range: cdp-common:FloatFormattedString
required: true
description: x offset relative to the canonical tomogram in pixels
ifabsent: "int(0)"
description: X shift of the reconstruction volume in angstrom
ifabsent: "float(0)"
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å
y:
any_of:
- range: integer
- range: cdp-common:IntegerFormattedString
- range: float
- range: cdp-common:FloatFormattedString
required: true
description: y offset relative to the canonical tomogram in pixels
ifabsent: "int(0)"
description: Y shift of the reconstruction volume in angstrom
ifabsent: "float(0)"
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å
z:
any_of:
- range: integer
- range: cdp-common:IntegerFormattedString
- range: float
- range: cdp-common:FloatFormattedString
required: true
ifabsent: "int(0)"
description: z offset relative to the canonical tomogram in pixels
description: Z shift of the reconstruction volume in angstrom
ifabsent: "float(0)"
unit:
descriptive_name: pixels
symbol: px
descriptive_name: Angstrom
symbol: Å


Alignment:
Expand Down
Loading