prerelease
branch. A high-level overview and user instructions can be found here. The feature was originally developed in a standalone repository but has since been merged into BakingTray.pStack
is a structure containing a preview image stack along with some extra information. These were used for developing the auto-ROI feature. For example, the command autoROI.test.runOnStackStruct(pStack)
calculates bounding boxes for a whole acquisition. We can then evaluate if a good job was done and tweak the algorithm accordingly.pStack
is a structure which needs to be generated by the user. It's a good idea to generate these and store to disk in some reasonable way. e.g. Inside sub-directories divided up however makes sense, such as one directory containing all acquisitions of single samples, one with two samples, etc. To generate a pStack
file do the followingimStack
, below) obtained from the BakingTray preview stacks.binarized
and borders
) in the pStack
structure. These need to be populated with what we will treat as a proxy for ground truth: which regions actually contain brain. This is necessary for subsequent evaluation steps but is not necessary to run the automatic tissue-finding code. This is done with:pStack
files. First ensure you have run analyses on all samples. Run the test script on one directory:n
), expanded by about 200 microns, then applied to section n+1
. When section n+1
is imaged, the bounding boxes are re-calculated as before. This approach takes into account the fact that the imaged area of most samples changes during the acquisition. Because the acquisition is tiled and we round up to the nearest tile, we usually end up with a border of more than 200 microns. In practice, this avoids clipping the sample in cases where it gets larger quickly as we section through it. There is likely no need to search for cases where sample edges are clipped in order to add tiles. We image rectangular bounding boxes rather than oddly shaped tile patterns because in most cases our tile size is large.imStack
is a downsampled stack that originates from the preview images of a BakingTray serial section 2p acquisition. To calculate the bounding boxes for section 11 we would run:autoROI.test.runOnStackStruct
, above. Then, as described above, we can run:autoROI
actually give us back the bounding boxes when run the first time (i.e. not in a loop over a stack)? It does the following:binarizeImage
. getBoundingBoxes
, which calls regionProps
to return a bounding box. autoROI.mergeOverlapping
to merge bounding boxes in cases where the is is appropriate. This function is currently problematic as it exhibits some odd behaviours that can cause very large overlaps between bounding boxes. autoROI.test.evaluateBoundingBoxes
works on a stats structure saved by autoROI.test.runOnAllInDir
. We can do the whole test directory with autoROI.test.evaluateDir
.previewStacks/tests
. If this is the first time you are doing this and need a reference then output of the test should be moved to previewStacks/test_reference
. So you have:cd
to the tests
directory and run autoROI.evaluate.plotResults(PATH_TO_previewStacks)
. e.g.hBTview.view_acquire.overlayLastBoundingBoxes
. You can even overlay the tile pattern: