New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic tissue surface detection #166
Comments
New button on the Camera window, "Find Surface" (right under the "Set Surface" button). This will scan ±200µm from the currently-set surface and find the most in-focus frame to be the new surface. Let me know if it works at all, @jessicatrnh - my mock hardware was not a very good test bed for this feature. |
This should be testable now, with the z-stack code falling back to the slower behavior, though it won't be very fast. |
To test, I preset the surface ~130um below where I would normally set it by eye. When hitting "Find Surface" the function does not work initially--the video stops acquiring and produces this error Hitting the button again immediately starts the acquisition, but the objective overshoots the surface so that the start of the scanning range is ~70um above the actual surface. Consequently, this means that I have to preset the surface at least 200um below the actual surface to have this function work properly, otherwise the objective continues to move away from the slice indefinitely. I tested this again by setting my surface ~300 um below the actual surface and the objective scanned way beyond the range of 200um with an indefinite upper range, and did not detect the clearest frame. |
@jessicatrnh the bug in fast-z-stacks prevented this from being testable. with that fixed, you can try again. |
@outofculture When I try to "Find Surface" the objective moves all the way up out of the solution, then comes down to start scanning at a range about 200um above the previously set surface marker. |
maybe with the focus speed fixed, this will behave? it's worth a test. if it's still doing the extraneous movement, I'll need to dig into MP0. |
Find surface still starts well above previous surface marker (~200um) and scans upward very slowly. The objective does not scan in the +/-200um range from the previous surface marker. |
We also noticed:
|
The "Find Surface" function now scans the depth from +200 to -200 um with reference to the previously set surface, but does not indicate if the surface has been found; it just stops at -200 below previous surface. |
I just added a final "focus to the new surface depth" step to the button behavior. If it doesn't find a new surface, it will stay at the bottom of the scan, as before. I tested the rest of the algorithm, and it found the surface on the few test files I have, but if you run it on a slice and it doesn't find a surface, please save a ±200µm, top-down z-stack for me to test against. |
Scans the depth range but does not return anything for surface detection. Stack is saved in autopatch_test\2024.03.12_000\Surface_Finder_Stack |
okay, it should do more than just scan this time. |
@outofculture So it does. The feature scans from +200 to -200 microns from the previously set surface. However, the correct surface is not detected and the surface marker is now reset to the bottom of the range. See autopatch_test\2024.03.19_000\Surface_Finding stack for the latest stack |
and again! |
@outofculture This works now! behavior: scans the 400um range and resets and focuses on surface depth. Might be about -25um from where I would consider the surface to be but this is working. |
Automatically determine z-location of tissue surface
The text was updated successfully, but these errors were encountered: