Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

generate-well-points

For a Nikon Ti2 microscope, generate an entire set of imaging coordinates according to a template from a set of reference points.

Each chip has 3 large wells, and diagonally offset from each large well sit 2 small wells holding the embryos. Navigating to each position is tedious, this repo allows the user to get save 2 references per chip, and generate all imaging positions needed from a previously compiled template positions file.

Web Front-End

This app has a web front end hosted on Streamlit: https://generate-well-points.streamlit.app/ This allows for 2 file uploads as described below, and outputs all imaging positions.

First time setup

You only need to record one chip, 9 positions: the 6 small wells E1..E6, then the 3 large well centres. Every chip is the same part and each one is fitted to its own references, so that single chip is enough to place all of them. Save it as template9.xml.

Then click E1 and E6 on each chip you want to image, export as refs.xml, and run:

pixi run generate refs.xml template9.xml positions.xml 1

The 1 says the template holds one chip. Since the template only has the well centres, each centre is scattered into 6 random positions inside a 3 mm radius, so 4 chips come back as 96 positions.

Load those in NIS, drag the well positions to where you actually want them, and save. Leave E1..E6 alone — they are the reference landmarks. That saved file is your template from now on, and because it already holds the scattered positions it is never scattered again.

If you would rather not have random positions at all, add --no-scatter and you get just the well centres back.

pixi run generate refs.xml template9.xml positions.xml 1 --no-scatter

The script returns the number of positions corresponding to the number of references you provided. So, 4 reference points would result in 18 (2 chips) positions with --no-scatter enabled.

Usage

2 files are necessary for this: a reference.xml file with 2 positions for each chip you wish to generate the positions for. Additionally, you will need a template.xml for all positions you wish to image.

pixi run generate path/to/your/refs.xml path/to/your/template.xml path/to/your/positions.xml

The template is assumed to hold 1 chip (read: 9 points). Add a 4th argument with the number of chips if it holds a different number. This might be the case if you generate a full 4-chip position set, but you wish to change some positions for later chips - you can reuse that file, but be sure to name the number of chips in your template, as well as the paramter --no-scatter.

pixi run generate refs.xml template27.xml positions.xml 3

Clicking fewer chips than the template holds is fine: 4 clicks against a 4-chip template does the first 2 chips and skips the rest.

Every session. Click 2 reference points per chip: E1 then E6 (8 clicks for 4 chips), export as refs.xml for example, run the same command against your template.

E1 and E6 are opposite corners of the chip, top left and bottom right.

Naming and layout

Large wells are numbered top to bottom, each owning the two small wells beside it. The odd number is up and to the left of its large well, the even one down and to the right.

W1  top     ->  E1, E2
W2  middle  ->  E3, E4
W3  bottom  ->  E5, E6

Record the template in that order: E1..E6 first, then W1, W2, W3. With a multi-chip template, all of chip 1's positions come before chip 2's.

How it works

Each chip is fitted separately with a rigid transform — rotation and translation, scale locked at 1. Only X and Y are fitted. Each point's Z is carried over from the template.

Two checks are printed per chip:

  • spacing — the two reference positions against the template.
  • rotation — near 180° means the chip was flipped, or there is some other issue.

Caveats or things to keep in mind

If you use the full 96-points template, but you give a refs.xml with only 4 points, the script will return all positions (with random positions) for the corresponding 2 chips.

About

For a Nikon Ti2 microscope, generate an entire set of imaging coordinates according to a template from a set of reference points.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages