Skip to content
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
5 changes: 5 additions & 0 deletions src/murfey/client/contexts/tomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
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"),
]

Expand Down Expand Up @@ -339,6 +340,9 @@
"frame_count": environment.data_collection_parameters.get(
"frame_count", 0
),
"tilt_axis": environment.data_collection_parameters.get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale behind defaulting to 85 degrees?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically the tilt axis is around that, on our microscopes it seems to be between about 83 and 87 degrees. This value gets sent to AreTomo which takes is as an initial guess to refine from, so it doesn't need to be exact

"tilt_axis", 85
),
"mc_binning": environment.data_collection_parameters.get(
"motion_corr_binning", 1
),
Expand Down Expand Up @@ -570,6 +574,7 @@
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"])

Check warning on line 577 in src/murfey/client/contexts/tomo.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/client/contexts/tomo.py#L577

Added line #L577 was not covered by tests
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"])
Expand Down
2 changes: 2 additions & 0 deletions src/murfey/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"],
Expand Down
1 change: 1 addition & 0 deletions src/murfey/server/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/murfey/util/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/murfey/util/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down