Skip to content

Commit

Permalink
Various bug fixes (#11)
Browse files Browse the repository at this point in the history
* Update version, change name of GRBL robot

* Update system_config__demo.json

* Provide autofish version in log file

* Various smaller fixes in the logger

* Update README.md

* Update automator.py

* Update README.md

add information about LEICA Thunder

* Update README.md
  • Loading branch information
muellerflorian authored Nov 6, 2024
1 parent 3681be1 commit c71b029
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 96 deletions.
71 changes: 42 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@

# autoFISH - automated FISH experiments

Python library to control an automated fluidics system and perform microscope acquisition for iterative FISH experiments.
Python library to control an automated fluidics system and perform acquisition on a microscope for sequential FISH experiments.

Documentation of this **package**:
**TESTED FOR WIN 10 only**: micromanager and most microscope controls work only under Windows.

- [**PDF**](https://drive.google.com/file/d/1BJOog03O_1Qd0z9-Iew3j0tdCUELFUi3/view?usp=drive_link)
- [**WORD**](https://docs.google.com/document/d/1TDRwhDQSY43seuwou7y4bqMeq4aE-g-U/edit?usp=drive_link&ouid=115789064117209337821&rtpof=true&sd=true)
## Documentation

Documentation to **build the fluidics system**:
We provide details documentation for the fluidics system and the experimental workflows with the links below:

- [**PDF**](https://drive.google.com/file/d/1uwClR1c6G9sGJg4e6qd6qb3mEDM5nUBS/view?usp=drive_link)
- [**WORD**](https://docs.google.com/document/d/1WErUkE9Bn6kUm9p4lFHiR1-yyyQqX7Lv/edit?usp=drive_link&ouid=115789064117209337821&rtpof=true&sd=true)
### Fluidics system and software usage

**TESTED FOR WIN 10 only**: micromanager and most microscope controls work only under Windows.
- Documentation of this **package**:
[**PDF**](https://drive.google.com/open?id=1-Fr_Dbg0eQDSbhBmq2gmJ1FDb4Uy_ToI&usp=drive_fs) or
[**WORD**](https://docs.google.com/document/d/1-IA6f02elFrF7JSLvXx199cNjnm8ciBB?rtpof=true&usp=drive_fs)

- Documentation to **build the fluidics system**:
[**PDF**](https://drive.google.com/open?id=1-3anf7ieKRPeKJ387K1XaBH0heWWIocm&usp=drive_fs) or
[**WORD**](https://docs.google.com/document/d/1-NUsaEacdTHfEi9gJ_SppbXEfD7z9-im?rtpof=true&usp=drive_fs)

![fluidics-system](docs/fluidics-overview.png)
- Documentation to **use a TTL trigger with the LEICA Thunder**:
[**PDF**](https://drive.google.com/open?id=1-bkihEoPfgZdNXIDN6bbxiwU0kXM9xOt&usp=drive_fs) or
[**WORD**](https://docs.google.com/document/d/1-ZXZ6kcjAJHre7fJ8rNfXpDT03TYYEI-?rtpof=true&usp=drive_fs)

## Getting started

Expand All @@ -28,35 +34,32 @@ We recommend using a package manager (conda) to maintain a clean Python installa
1. Download latest version of miniconda from [**here**](https://docs.conda.io/en/latest/miniconda.html).
2. Open Anaconda terminal and create dedicated environment: `conda create --name autofish python=3.9`
3. Activate environment: `conda activate autofish`
4. Pip install autofish (as an alternative see development installation below)
4. Pip install **autofish** (as an alternative see development installation below)
- Base version (without pycromanager) : `pip install -i https://test.pypi.org/simple/autofish`
- Install pycromanager : `pip install pycromanager`
- [Optional] Install pycromanager : `pip install pycromanager`

#### Installation for development

If you want to further develop the package, several options exist. A simply one is local installation.
### Starting autofish

Rather than performing the pip install from pypi (step 4 above), you can install it locally
1. Open Anaconda terminal and activate environment: `conda activate autofish`
2. Start user interface with command `autofish`

1. Download the zip archive of the branch you are interested in.
2. Unzip on your machine.
3. Open Anaconda terminal at location of the autofish package.
4. Activate environment: `conda activate autofish`
5. Editable install `pip install . -e`
### Upgrading to a new version

### Pycromanager
1. Open Anaconda terminal and activate environment: `conda activate autofish`
2. Upgrade autoFISH `pip install --upgrade https://test.pypi.org/simple/autofish`

One of the acquisition options is via Pycromanager. We found that keeping both micromanager and Pycromanager up-to-date can help to prevent problems.
### Development installation

**Last tested, compatible versions**:
If you want to modify develop the package, several options exist.

- Pycromanager: 0.27.2
- Micromanager: nightly 20230224
1. Recommended is to **`clone` the repository**. This will then also allow to propose your changes to the main autoFISH repository as a PullRequest. See for instance [here](https://codex.so/fork-and-pull-en) for an explanation for how this is done. This also allows to easier add changes from the main repository
2. An alternative is a **local installation**. While this might be easier in the short run, it will be challenig to integrate future changes on the main repository. Rather than performing the pip install (step 4 above), you

### Starting autofish

1. Open Anaconda terminal and activate environment: `conda activate autofish`
2. Start user interface with command `autofish`
1. Download the zip archive of the branch you are interested in.
2. Unzip on your machine.
3. Open Anaconda terminal at location of the autofish package.
4. Activate environment: `conda activate autofish`
5. Editable install `pip install . -e`

### Configuration files

Expand All @@ -67,6 +70,16 @@ The behavior of the fluidics and acquistion system is defined by several config
- We provide config files that we use on our system (with a Nikon Ti): <https://github.com/fish-quant/autofish/tree/main/configs>


## Pycromanager

One of the acquisition options is by using Pycromanager. We found that keeping both micromanager and Pycromanager up-to-date can help to prevent problems.

**Last tested, compatible versions**:

- Pycromanager: 0.27.2
- Micromanager: nightly 20230224


## Reporting a problem/suggestion

If you encounter a problem or you have a suggestion, please file an [**issue**](https://github.com/fish-quant/autofish/issues).
22 changes: 14 additions & 8 deletions autofish/autofish_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
import threading
from datetime import datetime
import pathlib

import autofish
from autofish.automator import Robot
from autofish.imager import pycroManager, fileSync_write, fileSync_create, TTL_sync
from autofish.coordinator import Controller

from importlib.metadata import version
# ---------------------------------------------------------------------------
# Functions
# ---------------------------------------------------------------------------


sg.theme('DarkAmber')
NAME_SIZE = 23
microscope_options = ('pycromanager', 'TTL sync', 'file synce - create', 'file sync - write')
Expand All @@ -37,9 +38,10 @@ def make_window_control():
[sg.HorizontalSeparator()],
[sg.Button('Initiate controller', key='-INITIATE_CONTROL-', disabled=True)],
[sg.HorizontalSeparator()],
[sg.Button('RUN all ROUNDS!', key='-RUN_ALL_ROUNDS-', disabled=True),
sg.Button('STOP sequential RUN', key='-STOP_SEQ-', disabled=True)],
[sg.Text('Save path'), sg.Text(' ', key='-OUTPUT_DIR_SAVE_IMGS-')],
[sg.Button('RUN all ROUNDS!', key='-RUN_ALL_ROUNDS-', disabled=True)
#sg.Button('STOP sequential RUN', key='-STOP_SEQ-', disabled=True)
],
[sg.Text(''), sg.Text(' ', key='-OUTPUT_DIR_SAVE_IMGS-')],
]

return sg.Window('Automator - automate sequential FISH', layout, location=(800, 600), finalize=True)
Expand Down Expand Up @@ -166,8 +168,9 @@ def make_window_fluidics():
[sg.Text(' >> Run sequences <<')],
[sg.Text('Choose sequence: '),
sg.Combo(['To-be-specified'], key='-SEQ_LIST-'),
sg.Button('RUN sequence', key='-RUN_SEQ-', disabled=True),
sg.Button('STOP sequence', key='-STOP_SEQ-', disabled=False)],
sg.Button('RUN sequence', key='-RUN_SEQ-', disabled=True)
#sg.Button('STOP sequence', key='-STOP_SEQ-', disabled=False)
],

#[sg.HorizontalSeparator()],
#[sg.Text(' Pippette robot status'),
Expand Down Expand Up @@ -206,6 +209,10 @@ def main():
handler.setFormatter(formatter)
logger.addHandler(handler)

logger_stream.info(f'More detailed log file can be found here {handler.baseFilename}.')
logger_stream.info(f"Using autofish version {version('autofish')}.")
logger.info(f"Using autofish version {version('autofish')}.")

# >>> Event Loop
while True:

Expand Down Expand Up @@ -459,7 +466,6 @@ def main():
# >> FLUIDICS system
# ******************************************************************************************************
elif event == '-INITIATE_SYSTEM-':
logger_stream.info(f'Initiate Robot & open serial ports. More info in log {f_log}')

try:
R = Robot(values['-CONFIG_SYSTEM-'], logger=logger, logger_short=logger_stream)
Expand Down
Loading

0 comments on commit c71b029

Please sign in to comment.