Commit 08fa55cd authored by bliss administrator's avatar bliss administrator
Browse files

Add possibility to move to half acquisition position right after setup

parent 368b259a
......@@ -203,7 +203,7 @@ class Tomo(TomoParameters):
self._tomo_optic = tomo.TomoOptic(
self.tomo_name, config, param_name, optic_defaults
)
active_optic = None
if self._tomo_optic.parameters.active_optic is not None:
active_optic = get_config().get(self._tomo_optic.parameters.active_optic)
......@@ -625,13 +625,13 @@ class Tomo(TomoParameters):
label="Shift Value?", defval=self.halftomo.parameters.shift_in_fov_factor
)
ret = ret2 = False
ret = ret2 = ret3 = False
while ret2 is False:
while ret3 is False:
ret = BlissDialog(
[[dlg_size_type], [dlg_size_value]],
title="Tomo Half Acquisition Setup (1/2)",
title="Tomo Half Acquisition Setup (1/3)",
).show()
# returns False on cancel
......@@ -688,14 +688,36 @@ class Tomo(TomoParameters):
ret2 = BlissDialog(
[[dlg_default], [dlg_nb_images]],
title="Tomo Half Acquisition Setup (2/2)",
title="Tomo Half Acquisition Setup (2/3)",
).show()
if ret2 != False:
self.parameters.tomo_n = ret2[dlg_nb_images]
dlg_move_acq_pos = UserCheckBox(
label="Move To Acquisition Position Now", defval=self.halftomo.parameters.move_to_acquisition_position
)
ret3 = BlissDialog(
[[dlg_move_acq_pos]],
title="Tomo Half Acquisition Setup (3/3)",
).show()
if ret3 != False:
self.halftomo.parameters.move_to_acquisition_position = ret3[dlg_move_acq_pos]
else:
break
if self.halftomo.parameters.move_to_acquisition_position:
self.field_of_view = "Half"
if not self.halftomo.started_once:
print(f"Storing current {self.halftomo.lat_align_axis.name} pos. {self.halftomo.lat_align_axis.position} as full-frame reference\n")
print(f"Previous value was {self.halftomo.parameters.full_frame_position}\n")
self.halftomo.parameters.full_frame_position = self.halftomo.lat_align_axis.position
acquisition_pos = self.halftomo.lat_align_axis.position + self.halftomo.parameters.shift_in_mm
print("Move to acquisition position")
umv(self.halftomo.lat_align_axis,acquisition_pos)
def pcotomo_setup(self):
......@@ -1245,12 +1267,13 @@ class Tomo(TomoParameters):
self.field_of_view = "Half"
else:
if self.field_of_view == "Half":
self.active_tomo.started_once = False
change = True
self.halftomo.setup_done = False
self.field_of_view = "Full"
if self.active_tomo == self.halftomo:
self.active_tomo = self.fasttomo
self.active_tomo.prepare()
if change and not self.parameters.half_acquisition:
......
......@@ -487,8 +487,6 @@ class HalfTomo(FastTomo, TomoParameters):
contains all info about tomo (hardware, parameters)
lat_align_axis : Axis
shifts sample before acquisition
setup_done : boolean
flag used to check if half acquisition has been configured by setup
started_once : boolean
flag used to detect if half acquisition has already been run
......@@ -518,11 +516,11 @@ class HalfTomo(FastTomo, TomoParameters):
half_defaults["shift_in_mm"] = 0
half_defaults["shift_in_pixels"] = 0
half_defaults["return_to_full_frame_position"] = False
half_defaults["move_to_acquisition_position"] = False
# Initialise the TomoParameters class
TomoParameters.__init__(self, param_name, half_defaults)
self.setup_done = False
self.started_once = False
log_info(self, "__init__() leaving")
......@@ -540,10 +538,6 @@ class HalfTomo(FastTomo, TomoParameters):
ccd_cols = self.tomo.tomo_ccd.get_image_parameters()["size"][0]
col_bin = self.tomo.tomo_ccd.get_image_parameters()["binning"][0]
print(f"Current pixel size: {pixel_size*1000:.2f} um")
print(f"Current horz. image pixels: {ccd_cols}")
print(f"Current horz. image size: {pixel_size*ccd_cols:.2f} mm")
if not self.started_once:
print(
f"Storing current {self.lat_align_axis.name} pos. {self.lat_align_axis.position} as full-frame reference\n"
......@@ -559,6 +553,7 @@ class HalfTomo(FastTomo, TomoParameters):
f"{self.lat_align_axis.name} shift: {self.parameters.shift_in_mm:.3f} mm - {self.parameters.shift_in_pixels:.1f} pixels - {self.parameters.shift_in_fov_factor:.3f} FOV\n"
)
self.parameters.acquisition_position = (
self.parameters.full_frame_position + self.parameters.shift_in_mm
)
......
Markdown is supported
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