Skip to content

Commit

Permalink
Adding new valves, components, and smaller fixes (#7)
Browse files Browse the repository at this point in the history
* Update setup.cfg

* Cosmetic updates in autofish_gui.py

* Add templates for missing docstrings

* First clean up of error messages when initiating robot.

* changes to help that volume file is updated rather than always recreated

should close #4

* small updates in documentation

* small changes

* update gitignore

* remove not needed blanks

* some more cosmetic clean-ups

* correct bug with wrongly assigned feed for valve

* Add support for Longer pump

* cosmetic changes

* Update README.md

* update gitignore

* continue integration of Longer pump

* bug fixing for Longer control

* Smaller fixes for longer pump support

* clean up

* Started bug fix on reading csv file from french computers

Some cleanup

* Update README.md

* Correct bug for flow sensor, zero robot when closing interface

* New sync option via creation of text file

Smaller cosmetic changes
Corrected bug in demo mode

* Correction of bug with moving to zero and keeping old position in memory

* TTL trigger

* Update .DS_Store

* TTL cleanup

* Update autofish_manual.pdf

* Update imager.py

* remove tests

* Add control for outlet valve

* updated config files for outlet valve

* Updated docs

* Added control for pycromanager

Specify stage-speed and Core-timeout in config file.

* Update .gitignore

* Added code to test components

* Update pump-longer-bt100.py

* new valve added

* updates on documentation

* update readme and remove pdfs

* update bug when trying to open TTL without specified file

* Delete .DS_Store

* Various small bug fixes
  • Loading branch information
muellerflorian authored Jul 31, 2024
1 parent d2ce796 commit 5dc9b6b
Show file tree
Hide file tree
Showing 29 changed files with 2,109 additions and 924 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ env.bak/
venv.bak/

# mkdocs documentation
/site
/site
.DS_Store
.DS_Store
.DS_Store
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

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

See dedicated documentation [**here**](https://github.com/fish-quant/autofish/blob/master/docs/autofish_manual.pdf) for how to install and use this package.
Documentation of this **package**:

- [**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 to **build the fluidics system**:

- [**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)

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

Expand All @@ -15,10 +23,35 @@ See dedicated documentation [**here**](https://github.com/fish-quant/autofish/bl

### Installation

1. Download latest version of miniconda from [**here**](https://docs.conda.io/en/latest/miniconda.html) (can also be Python 3.X).
We recommend using a package manager (conda) to maintain a clean Python installation. This nees to be done only once.

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 `pip install -i https://test.pypi.org/simple/ autofish`
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`

#### Installation for development

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

Rather than performing the pip install from pypi (step 4 above), you can install it locally

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`

### Pycromanager

One of the acquisition options is via 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

### Starting autofish

Expand All @@ -29,13 +62,10 @@ See dedicated documentation [**here**](https://github.com/fish-quant/autofish/bl

The behavior of the fluidics and acquistion system is defined by several config files.

* To test the installation of autofish, you can use demo configurations which require neither a microscope nor a fluidics systems: <https://github.com/fish-quant/autofish/tree/main/demo>

* We provide config files that we use on our system (with a Nikon Ti): <https://github.com/fish-quant/autofish/tree/main/configs>
- To test the installation of autofish, you can use demo configurations which require neither a microscope nor a fluidics systems: <https://github.com/fish-quant/autofish/tree/main/demo>

### Building the Fluidics system
- We provide config files that we use on our system (with a Nikon Ti): <https://github.com/fish-quant/autofish/tree/main/configs>

See dedicated documentation [**here**](https://github.com/fish-quant/autofish/blob/master/docs/fluidics_construction.pdf) for how to build the fluidics system.

## Reporting a problem/suggestion

Expand Down
71 changes: 71 additions & 0 deletions autofish/Arduino_TTL_sync/Arduino_TTL_sync.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
String serial_InBytes;


// Define pins
int TTL_start_OUT = 12;
int TTL_finished_IN = 10;
int val_TTL_finished_IN;

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(TTL_start_OUT, OUTPUT);
pinMode(TTL_finished_IN, INPUT);

Serial.begin(9600);
Serial.setTimeout(1000);

// TTL signal for debugging
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);

}
void loop() {

// TTL signal for debugging (pin 8 can be used to simulate incoming TTL)
digitalWrite(7, HIGH);
digitalWrite(8, LOW);


if (Serial.available() > 0){

/*
// DEBUGGIN : print TTL signal
val_TTL_in = digitalRead(TTL_in); // read the input pin
Serial.println(val_TTL_in);
delay(10);
*/

// Read from serial port
serial_InBytes = Serial.readStringUntil('\n');
//Serial.println(InBytes);

// Start acquisition
if (serial_InBytes == "start"){
Serial.println("Sending TTL trigger to launch acquisition");
digitalWrite(TTL_start_OUT, HIGH);
digitalWrite(LED_BUILTIN, HIGH);

// Wait for trigger that acquisition is done
val_TTL_finished_IN = 0;
while (val_TTL_finished_IN==0) {
val_TTL_finished_IN = digitalRead(TTL_finished_IN); // read the input pin
Serial.println(val_TTL_finished_IN);
delay(500);
}

// Signal received that acquisition is finished
Serial.println("finished");
digitalWrite(TTL_start_OUT, LOW);
digitalWrite(LED_BUILTIN, LOW);
}

// Unknown command
else{
Serial.println("Unknown command: " + serial_InBytes);
}

delay(500);

}
}

Loading

0 comments on commit 5dc9b6b

Please sign in to comment.