Commit 8b8a3d12 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Account for CTF translations

parent e2c0c39d
Pipeline #44565 passed with stage
in 6 minutes and 10 seconds
......@@ -322,8 +322,8 @@ class FullRadiosPipeline(FullFieldPipeline):
self.phase_retrieval.retrieve_phase(
self.radios[i],
padding_mode=padding_mode,
translation_vh=None,
normalize_by_mean=None,
translation_vh=self.dataset_info.ctf_translations[i],
normalize_by_mean=options["ctf_normalize_by_mean"],
)
......
......@@ -100,6 +100,7 @@ class DatasetAnalyzer(object):
self.radio_dims = (self.dataset_scanner.dim_1, self.dataset_scanner.dim_2)
self._binning = (1, 1)
self.translations = None
self.ctf_translations = None
self.axis_position = None
self._radio_dims_notbinned = self.radio_dims
......
......@@ -37,7 +37,8 @@ class NabuValidator(object):
self.convert_negative_indices()
self.get_angles()
self._get_rotation_axis()
self._get_translation_file()
self._get_translation_file("reconstruction", "translation_movements_file", "translations")
self._get_translation_file("phase", "ctf_translations_file", "ctf_translations")
self._get_resources()
self._get_output_filename()
......@@ -130,9 +131,8 @@ class NabuValidator(object):
self.dataset_infos.axis_correction = axis_correction
def _get_translation_file(self):
rec_params = self.nabu_config["reconstruction"]
transl_file = rec_params["translation_movements_file"]
def _get_translation_file(self, config_section, config_key, dataset_info_attr):
transl_file = self.nabu_config[config_section][config_key]
if transl_file in (None, ''):
return
translations = None
......@@ -150,7 +150,7 @@ class NabuValidator(object):
except:
print("Something wrong with translation_movements_file %s" % transl_file)
raise
self.dataset_infos.translations = translations
setattr(self.dataset_infos, dataset_info_attr, translations)
def _get_resources(self):
......
......@@ -208,7 +208,7 @@ nabu_config = {
"validator": optional_string_validator,
"type": "optional",
},
"ctf_translations": {
"ctf_translations_file": {
"default": "",
"help": "A file where each line has two values: horizontal and vertical displacements. There should be as many values as there are projection images.",
"validator": optional_file_location_validator,
......
......@@ -417,4 +417,3 @@ class ProcessConfig:
phase_options["ctf_lim1"] = ctf_advanced_params["lim1"]
phase_options["ctf_lim2"] = ctf_advanced_params["lim2"]
phase_options["ctf_normalize_by_mean"] = ctf_advanced_params["normalize_by_mean"]
phase_options["ctf_translations"] = user_phase_options["ctf_translations"]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment