-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* partial settings implementation * update microscope settings code * Update from main (#3) * add examples * minor acq engine update * fix timelapse enum bug * Update .gitignore * Create pyproject.toml * Create setup.py * Create setup.cfg * Update pyproject.toml * Update pyproject.toml * implement yaml acq settings * update settings logging * continue settings refactor * update setting and setup_daq * update acquire * bugfix * enforce dataset structure * cleanup * revamp acq hooks * register run-mantis-acquisition command * add project version * mock autofocus * add ls ctr task * add ls_channel_counter_task * remove LS z counter * add_acq_finished_check * improve acq timing * Update acq_engine.py * add moving between positions * add autofocus * better autofocus function * clean up * small fixes * Update demo_acquisition_settings.yaml * extend support for demo run * demo run support * fix wait for device bug * modulate xy stage speed * debug xy speed modulation * ls channel specific daq config * edited acquisition cli and updated docstrings * add simple phase recon * update autofocus * increase LS saving_queue_size * update autofocus * Revert "edited acquisition cli and updated docstrings" This reverts commit 6c9fda4. * Shalin edited acquisition cli and updated docstrings Co-Authored-By: Shalin Mehta <[email protected]> * Update mantis_acquisition_settings.yaml * rename example acq settings * move run_acquisition to cli module * better acq cleanup * add settings documentation * update documentation * Create write_pos_csv.py --------- Co-authored-by: Shalin Mehta <[email protected]>
- Loading branch information
1 parent
ef72dd3
commit 68bc5f7
Showing
40 changed files
with
1,524 additions
and
3,906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import csv | ||
from mantis.acquisition.BaseSettings import PositionSettings | ||
|
||
position_settings = PositionSettings(**{}) | ||
|
||
pos_list = [] | ||
for i in range(position_settings.num_positions): | ||
pos_list.append( | ||
{ | ||
'position_ind': i, | ||
'well_id': position_settings.position_labels[i].split('-')[0], | ||
'site_num': position_settings.position_labels[i].split('_')[-1], | ||
'label': position_settings.position_labels[i], | ||
'x_position': position_settings.xyz_positions[i][0], | ||
'y_position': position_settings.xyz_positions[i][1], | ||
'z_position': position_settings.xyz_positions[i][2], | ||
} | ||
) | ||
|
||
path = r'Z:\rawdata\mantis\2023_04_05_mantis_HEK\48wells_1timepoint_4' | ||
with open(os.path.join(path, 'positions.csv'), 'w', newline='') as csvfile: | ||
fieldnames = list(pos_list[0].keys()) | ||
writer = csv.DictWriter(csvfile, fieldnames=fieldnames) | ||
|
||
writer.writeheader() | ||
writer.writerows(pos_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import numpy as np | ||
from typing import Optional, List, Tuple, Sequence | ||
from pydantic.dataclasses import dataclass | ||
from dataclasses import field | ||
|
||
|
||
@dataclass | ||
class ConfigSettings: | ||
config_group: str | ||
config_name: str | ||
|
||
|
||
@dataclass | ||
class DevicePropertySettings: | ||
device_name: str | ||
property_name: str | ||
property_value: str | ||
|
||
|
||
@dataclass | ||
class TimeSettings: | ||
num_timepoints: Optional[int] = 0 | ||
time_internal_s: Optional[float] = 0 # in seconds | ||
|
||
|
||
@dataclass | ||
class PositionSettings: | ||
xyz_positions: list = field(default_factory=list) | ||
position_labels: List[str] = field(default_factory=list) | ||
num_positions: int = field(init=False, default=0) | ||
|
||
def __post_init__(self): | ||
assert len(self.xyz_positions) == len(self.position_labels) | ||
self.num_positions = len(self.xyz_positions) | ||
|
||
|
||
@dataclass | ||
class ChannelSettings: | ||
exposure_time_ms: List[float] = field(default_factory=list) # in ms | ||
channel_group: Optional[str] = None | ||
channels: List[str] = field(default_factory=list) | ||
use_sequencing: bool = False | ||
num_channels: int = field(init=False, default=0) | ||
acquisition_rate: float = field(init=False, default=None) | ||
|
||
def __post_init__(self): | ||
self.num_channels = len(self.channels) | ||
assert len(self.exposure_time_ms) == len(self.channels), \ | ||
'Number of channels must equal number of exposure times' | ||
|
||
|
||
@dataclass | ||
class SliceSettings: | ||
z_stage_name: Optional[str] = None | ||
z_start: Optional[float] = None | ||
z_end: Optional[float] = None | ||
z_step: Optional[float] = None | ||
use_sequencing: bool = False | ||
num_slices: int = field(init=False, default=0) | ||
acquisition_rate: float = field(init=False, default=None) | ||
z_range: List[float] = field(init=False, repr=False, default_factory=list) | ||
|
||
def __post_init__(self): | ||
if self.z_step is not None: | ||
self.z_range = list(np.arange(self.z_start, self.z_end+self.z_step, self.z_step)) | ||
self.num_slices = len(self.z_range) | ||
|
||
|
||
@dataclass | ||
class MicroscopeSettings: | ||
roi: Optional[Tuple[int, int, int, int]] = None | ||
config_group_settings: List[ConfigSettings] = field(default_factory=list) | ||
device_property_settings: List[DevicePropertySettings] = field(default_factory=list) | ||
reset_device_properties: List[DevicePropertySettings] = field(default_factory=list) | ||
z_sequencing_settings: List[DevicePropertySettings] = field(default_factory=list) | ||
channel_sequencing_settings: List[DevicePropertySettings] = field(default_factory=list) | ||
use_autofocus: bool = False | ||
autofocus_stage: Optional[str] = None | ||
autofocus_method: Optional[str] = None |
Oops, something went wrong.