Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acquisition Rate of planar mode is not used #145

Merged
merged 1 commit into from
Feb 28, 2024
Merged
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
47 changes: 32 additions & 15 deletions sashimi/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from lightparam.param_qt import ParametrizedQt
from lightparam import Param, ParameterTree
from sashimi.hardware.light_source import light_source_class_dict
from typing import Union

# from sashimi.hardware import light_source_class_dict
from sashimi.processes.scanning import ScannerProcess
Expand Down Expand Up @@ -224,16 +225,20 @@ def calculate_calibration(self):


def get_voxel_size(
scanning_settings: ZRecordingSettings,
scanning_settings: Union[ZRecordingSettings, SinglePlaneSettings],
camera_settings: CameraSettings,
):
scan_length = (
scanning_settings.piezo_scan_range[1] - scanning_settings.piezo_scan_range[0]
)

binning = int(camera_settings.binning)

inter_plane = scan_length / scanning_settings.n_planes
if isinstance(scanning_settings, SinglePlaneSettings):
inter_plane = 1
else:
scan_length = (
scanning_settings.piezo_scan_range[1]
- scanning_settings.piezo_scan_range[0]
)
inter_plane = scan_length / scanning_settings.n_planes
Comment on lines +234 to +241
Copy link
Member Author

Choose a reason for hiding this comment

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

Inside get_voxel_size:
checks if the scanning_settings are single_plane_settings and if so sets the z_voxel size to 1


return (
inter_plane,
Expand All @@ -244,13 +249,16 @@ def get_voxel_size(

def convert_save_params(
save_settings: SaveSettings,
scanning_settings: ZRecordingSettings,
scanning_settings: Union[ZRecordingSettings, SinglePlaneSettings],
camera_settings: CameraSettings,
trigger_settings: TriggerSettings,
):
n_planes = scanning_settings.n_planes - (
scanning_settings.n_skip_start + scanning_settings.n_skip_end
)
if isinstance(scanning_settings, SinglePlaneSettings):
n_planes = 0
else:
n_planes = scanning_settings.n_planes - (
scanning_settings.n_skip_start + scanning_settings.n_skip_end
)
Comment on lines -251 to +261
Copy link
Member Author

Choose a reason for hiding this comment

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

Inside convert_save_params checks if the settings are for planar mode, and if so, sets n_planes to 0


return SavingParameters(
output_dir=Path(save_settings.save_dir),
Expand Down Expand Up @@ -472,12 +480,21 @@ def n_planes(self):

@property
def save_params(self):
return convert_save_params(
self.save_settings,
self.volume_setting,
self.camera_settings,
self.trigger_settings,
)
if self.global_state == GlobalState.PLANAR_PREVIEW:
save_p = convert_save_params(
self.save_settings,
self.single_plane_settings,
self.camera_settings,
self.trigger_settings,
)
else:
save_p = convert_save_params(
self.save_settings,
self.volume_setting,
self.camera_settings,
self.trigger_settings,
)
return save_p
Comment on lines +483 to +497
Copy link
Member Author

Choose a reason for hiding this comment

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

inside save_params checks if we are in planar mode and returns the planar settings - if not defaults to volume settings


@property
def scan_params(self):
Expand Down
Loading