diff --git a/ingestion_tools/scripts/importers/alignment.py b/ingestion_tools/scripts/importers/alignment.py index 67d19bd1d..da205c5ab 100644 --- a/ingestion_tools/scripts/importers/alignment.py +++ b/ingestion_tools/scripts/importers/alignment.py @@ -120,7 +120,9 @@ 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) + dim = tomogram.get_source_volume_info().get_dimensions() + return {d: voxel_size * dim[d] for d in "xyz"} def is_default_alignment(self) -> bool: return "default" in self.file_paths diff --git a/ingestion_tools/scripts/tests/s3_import/test_alignments.py b/ingestion_tools/scripts/tests/s3_import/test_alignments.py index eadb0eac9..8a3c6288e 100644 --- a/ingestion_tools/scripts/tests/s3_import/test_alignments.py +++ b/ingestion_tools/scripts/tests/s3_import/test_alignments.py @@ -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 * 6, "y": 13.48 * 8, "z": 13.48 * 10}, "volume_offset": {"x": -1, "y": 2, "z": -3}, "x_rotation_offset": -2.3, } @@ -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 * 6, "y": 13.48 * 8, "z": 13.48 * 10}, "volume_offset": {"x": -1, "y": 2, "z": -3}, "x_rotation_offset": -2.3, } @@ -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 * 6, "y": 13.48 * 8, "z": 13.48 * 10}, "volume_offset": {"x": 0, "y": 0, "z": 0}, "x_rotation_offset": 0, } diff --git a/schema/core/v2.0.0/metadata.yaml b/schema/core/v2.0.0/metadata.yaml index 372bf7122..5b30727e5 100644 --- a/schema/core/v2.0.0/metadata.yaml +++ b/schema/core/v2.0.0/metadata.yaml @@ -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: