|
51 | 51 | get_microscope, |
52 | 52 | get_security_config, |
53 | 53 | ) |
54 | | -from murfey.util.processing_params import default_spa_parameters |
| 54 | +from murfey.util.processing_params import default_spa_parameters, motion_corrected_mrc |
55 | 55 | from murfey.util.tomo import midpoint |
56 | 56 |
|
57 | 57 | logger = logging.getLogger("murfey.server.feedback") |
@@ -106,37 +106,16 @@ def get_all_tilts(tilt_series_id: int) -> List[str]: |
106 | 106 | ).all() |
107 | 107 | if not complete_results: |
108 | 108 | return [] |
| 109 | + visit_name = complete_results[0][2].visit |
109 | 110 | instrument_name = complete_results[0][2].instrument_name |
110 | 111 | results = [r[0] for r in complete_results] |
111 | 112 | machine_config = get_machine_config(instrument_name=instrument_name)[ |
112 | 113 | instrument_name |
113 | 114 | ] |
114 | | - |
115 | | - def _mc_path(mov_path: Path) -> str: |
116 | | - for p in mov_path.parts: |
117 | | - if "-" in p and p.startswith(("bi", "nr", "nt", "cm", "sw")): |
118 | | - visit_name = p |
119 | | - break |
120 | | - else: |
121 | | - raise ValueError(f"No visit found in {mov_path}") |
122 | | - visit_idx = Path(mov_path).parts.index(visit_name) |
123 | | - core = Path(*Path(mov_path).parts[: visit_idx + 1]) |
124 | | - ppath = Path(mov_path) |
125 | | - sub_dataset = "/".join(ppath.relative_to(core).parts[:-1]) |
126 | | - extra_path = machine_config.processed_extra_directory |
127 | | - mrc_out = ( |
128 | | - core |
129 | | - / machine_config.processed_directory_name |
130 | | - / sub_dataset |
131 | | - / extra_path |
132 | | - / "MotionCorr" |
133 | | - / "job002" |
134 | | - / "Movies" |
135 | | - / str(ppath.stem + "_motion_corrected.mrc") |
136 | | - ) |
137 | | - return str(mrc_out) |
138 | | - |
139 | | - return [_mc_path(Path(r.movie_path)) for r in results] |
| 115 | + return [ |
| 116 | + motion_corrected_mrc(Path(r.movie_path), visit_name, machine_config) |
| 117 | + for r in results |
| 118 | + ] |
140 | 119 |
|
141 | 120 |
|
142 | 121 | def get_job_ids(tilt_series_id: int, appid: int) -> JobIDs: |
|
0 commit comments