BakingTray
Search…
autoROI

What is autoROI?

With conventional acquisitions the user draws a box around the area they wish to image and the resulting set of x/y positions is applied to all sections. The main drawback of this approach is that for most samples much of the imaged area will be blank. Inexperienced users might draw boxes that cause them to lose data or draw vastly larger boxes than necessary. It takes time to learn how to draw a box that tightly captures the tissue of interest across all slices. To solve this problem, the prerelease branch of BakingTray now has an "autoROI" feature. The following video shows it in action on a simulated sample.

How does it work?

The user takes a preview image as before: imaging the entire sample (or samples) with a low resolution tile scan. The software uses this image to calculate a threshold separating tissue from non-tissue. To do this, the software uses pixels along the borders of the preview image, which it assumes will contain no sample tissue. The minimum bounding-box around the sample is calculated, expanded a little for caution, and fitted with a tile pattern. After the user presses "Bake", this tile pattern is imaged. Once each section is complete the location of the sample is calculated again and fitted with a new tile pattern.
Brains like, most samples, tend to present a small surface area initially, before becoming larger and then smaller again. The auto-ROI handles this gradual increase in exposed area by adding a generous border around the area being imaged.
The autoROI will image about 20% fewer tiles compared to a perfectly-drawn ROI. In practice the autoROI reduces imaged tiles by as much as 50% for users who are overly generous with their manually drawn ROIs.

Constraints

    All samples must be visible in the first preview image. If you have multiple samples that are different heights simply make sure they are mounted such that they all appear at the same time. ROIs associated with shorter samples that end early will just disappear.
    ROIs are rectangular bounding-boxes meaning that still some blank tiles will persist.
    Your preview image should not contain sample tissue at the edges. Ideally it also should be small enough that the edges of the preview still contain agar. i.e. don't image a ridiculously large preview area.
    It is known to work poorly for samples which contain one more fairly isolated regions each of which present a small surface area (e.g. two or three tiles) and may become occluded by flapping membranes.
    You must crop samples (even single samples) after acquisition or your final data size will be larger than before. This is because the ROIs can be larger than person would have drawn for some sections.

Embedding samples

The agar autofluoresces slightly. You should avoid the possibility that the field of view will contain regions without agar, as the algorithm may then consider the agar to be the sample and enlarge the imaged area substantially. This is best avoided by mounting brains with a substantial agar border:
A brain well-mounted for use with autoROI
Here is an example of how the autoROI failed to produce any benefit with three brains embedded in small agar blocks. The image shows a stitched plane from one physical section. The look-up table is adjusted to show to the weak signal from the agar. Note how the algorithm has identified the agar as tissue and is imaging that. The final imaged area will be very large and the acquisition will run more slowly than a well-drawn manual ROI.
Three brains poorly mounted for autoROI acquisition

How to use it

The following instructions should be carried out after you have set the objective height and sorted out the bidirectional phase correction: see the checklist. Set the acquisition mode to "Tiled: auto-ROI" in the main window.
Before taking the preview, make sure you have set the PMT gains and laser power to the values you plan to use during imaging. You can change them a bit later, but it's best if you are at or close to the final values right now. Open the Acquisition Preview GUI and run a Preview. In auto-ROI mode, BakingTray will automatically take the preview with all channels that you will later go on to save. You do not need to check/uncheck the channels to display yourself. Your finished preview will have a green border zone around the edge. It is important that:
    There is no sample in this area
    It contains agar
Re-take the preview if there is sample in this border region. You do not need to leave a really big gap between the sample and the edge: the sample just has to not enter the green zone. The agar auto-fluoresces and you will skew the threshold obtained by the auto-ROI if the green zone is outside of the agar. Change the look-up table to confirm the green border contains agar. Once you have a suitable preview image, press the "Auto-Thresh" button.
BakingTray will calculate the threshold between tissue and non-tissue pixels, identify where the sample or samples are located, and overlay the resulting tile pattern:
You will notice that the BakingTray has automatically selected a channel for the preview. This will be the channel with the brightest overall signal. You can not change this. Once you are done press "Bake".

Post-acquisition: stitching, cropping, etc

On the web-preview you should see that the sample always largely fills the image area, which changes size as the acquisition progresses. The final stitched images will all be of the same size. They are padded with zeros so the sample is continuous across sections.
If you use the sample splitter tool you may find the "auto" feature fails because it is confused by the zero padding. You will probably have to draw ROIs manually.
If you have acquired only one sample at high resolution it is still good practice to crop it to reduce data size. This is because the autoROI is slightly generous with the imaged area to avoid losing tissue. In some cases it might add an extra row of tiles which then get propagated to all sections when the sample is stitched.

How well does it work?

In case you are wondering how well it works (will you lose data?) then read on: The feature was developed using real BakingTray preview image stacks from 133 past acquisitions encompassing over 300 samples. The acquisitions included a variety of organs, multiple samples and single samples per acquisition, and plenty of problematic recordings (low SNR, occluded tissue, mounting problems, etc). The algorithm parameters were tweaked using this large and diverse dataset and, despite the challenge, performed near perfectly. There is never major data loss: at worst there is negligible tissue loss around the sample edges. In 88% of samples less than 1 tiles worth of tissue was missed. In 95% of cases less than 5 tiles worth of tissue was missed.
Number of missed tiles across all test datasets
Acquisitions with the most tissue loss were almost all unusual cases which exhibited problems such as very low signal to noise or were otherwise badly set up. The algorithm is robust to floating sections obscuring the tissue and will abort the acquisition if no sample tissue at all is found. Acquisitions with multiple samples are easily handled; ROIs will merge if samples become closer together and un-merge again later as needed.
The worst performing example where the samples are of high quality is this (red boxes indicate imaged areas):
The autoROI has been tested on less than 10 real acquisitions and has so far performed well. At the moment the recommendation is that you should use it unless the sample is very precious.
Last modified 10mo ago