diff --git a/src/murfey/client/contexts/tomo.py b/src/murfey/client/contexts/tomo.py index 331b9a728..1ed8362ea 100644 --- a/src/murfey/client/contexts/tomo.py +++ b/src/murfey/client/contexts/tomo.py @@ -79,6 +79,7 @@ class TomographyContext(Context): ProcessingParameter("pixel_size_on_image", "Pixel Size"), ProcessingParameter("motion_corr_binning", "Motion Correction Binning"), ProcessingParameter("frame_count", "Number of image frames"), + ProcessingParameter("tilt_axis", "Stage rotation angle"), ProcessingParameter("num_eer_frames", "Number of EER Frames"), ] @@ -339,6 +340,9 @@ def _add_tilt( "frame_count": environment.data_collection_parameters.get( "frame_count", 0 ), + "tilt_axis": environment.data_collection_parameters.get( + "tilt_axis", 85 + ), "mc_binning": environment.data_collection_parameters.get( "motion_corr_binning", 1 ), @@ -570,6 +574,7 @@ def gather_metadata( mdoc_metadata["experiment_type"] = "tomography" mdoc_metadata["voltage"] = float(mdoc_data["Voltage"]) mdoc_metadata["frame_count"] = int(mdoc_data_block["NumSubFrames"]) + mdoc_metadata["tilt_axis"] = float(mdoc_data_block["RotationAngle"]) mdoc_metadata["image_size_x"] = int(mdoc_data["ImageSize"][0]) mdoc_metadata["image_size_y"] = int(mdoc_data["ImageSize"][1]) mdoc_metadata["magnification"] = int(mdoc_data_block["Magnification"]) diff --git a/src/murfey/server/__init__.py b/src/murfey/server/__init__.py index 2ace38da3..fe16f2043 100644 --- a/src/murfey/server/__init__.py +++ b/src/murfey/server/__init__.py @@ -2471,6 +2471,7 @@ def feedback_callback(header: dict, message: dict) -> None: "dose_per_frame": preproc_params.dose_per_frame, "frame_count": preproc_params.frame_count, "kv": preproc_params.voltage, + "tilt_axis": preproc_params.tilt_axis, "pixel_size": preproc_params.pixel_size, "manual_tilt_offset": -tilt_offset, "node_creator_queue": machine_config.node_creator_queue, @@ -2841,6 +2842,7 @@ def feedback_callback(header: dict, message: dict) -> None: voltage=message["voltage"], dose_per_frame=message["dose_per_frame"], frame_count=message["frame_count"], + tilt_axis=message["tilt_axis"], motion_corr_binning=message["motion_corr_binning"], gain_ref=message["gain_ref"], eer_fractionation_file=message["eer_fractionation_file"], diff --git a/src/murfey/server/api/__init__.py b/src/murfey/server/api/__init__.py index 94083b4a2..357b80210 100644 --- a/src/murfey/server/api/__init__.py +++ b/src/murfey/server/api/__init__.py @@ -735,6 +735,7 @@ def register_completed_tilt_series( "dose_per_frame": preproc_params.dose_per_frame, "frame_count": preproc_params.frame_count, "kv": preproc_params.voltage, + "tilt_axis": preproc_params.tilt_axis, "pixel_size": preproc_params.pixel_size, "manual_tilt_offset": -tilt_offset, "node_creator_queue": machine_config.node_creator_queue, diff --git a/src/murfey/util/db.py b/src/murfey/util/db.py index 4ba1f90fe..12772fcff 100644 --- a/src/murfey/util/db.py +++ b/src/murfey/util/db.py @@ -459,6 +459,7 @@ class TomographyPreprocessingParameters(SQLModel, table=True): # type: ignore pixel_size: float dose_per_frame: float frame_count: int + tilt_axis: float voltage: int eer_fractionation_file: Optional[str] = None motion_corr_binning: int = 1 diff --git a/src/murfey/util/models.py b/src/murfey/util/models.py index 33b919302..f1545c386 100644 --- a/src/murfey/util/models.py +++ b/src/murfey/util/models.py @@ -316,6 +316,7 @@ class ProcessFile(BaseModel): # Rename to TomoProcessFile pixel_size: float dose_per_frame: float frame_count: int + tilt_axis: Optional[float] mc_uuid: Optional[int] = None voltage: float = 300 mc_binning: int = 1 @@ -351,6 +352,7 @@ class CompletedTiltSeries(BaseModel): class PreprocessingParametersTomo(BaseModel): dose_per_frame: float frame_count: int + tilt_axis: float gain_ref: Optional[str] experiment_type: str voltage: float