Closed pderdeyn closed 2 months ago
Thanks for raising this @pderdeyn, we'll take a look.
@alessandrofelder I wonder if this is related to what we saw with napari in 2D/3D on Friday? Is it possible that there's something going on with 2D and 3D visualisation in napari, so that in one of the views, the data is (or at least appears to be) flipped?
I wonder if this is related to what we saw with napari in 2D/3D on Friday?
Maybe... we should find a clear way to check this for ourselves (that doesn't require neuroanatomy knowledge) and then discuss it with the napari community if needed?
A quick test on the latest napari suggests that it isn't a napari thing, this looks fine to me: 2D
3D
I had a quick look at this last week, and it looks like the issue is somewhere in the intersection of setting the hemisphere and creating the projections.
I had a quick look at this last week, and it looks like the issue is somewhere in the intersection of setting the hemisphere and creating the projections.
Actually I think I'm wrong, I think the issue is just in creating the projections. I (very scientifically!) created an image with an L
marked into it in two axes, so that you can always tell which axis is which.
This brain is psl
and registering it with this orientation appears to work correctly. The downsampled_standard.tiff
image is correctly oriented:
This suggests that brainreg
and brainglobe-space
are working properly. Of course they could be cancelling each other out, but I'm assuming that these two mature packages are correct.
However, if I click on Check orientation
then the brain appears flipped (hard to see, but there's a slight mark in the left hemisphere, which is now rendered on the right).
I assume this is the reason for the issue reported here. I haven't worked out why this is happening yet.
I think I'm missing something here. In the orientation checking function, the input data (napari layer) is reoriented (using brainglobe-space) to the atlas orientation. This looks correct (L
is in the correct place):
However, when looking at the projection images in the above comment, it seems that the first projection (bottom left) is correct (assuming the view is front to back), but the second (bottom middle) is not (assuming the view is top down). I don't think we can say anything about the third (bottom right).
@IgorTatarnikov and I spent some time diagnosing this. Our conclusions are:
check_orientation
code, which hides the left hemisphere when we actually want to show it (and same for right hemisphere)Fantastic. Thanks for the fix you all <3
Hey @pderdeyn, a new version with this fix should be out in an hour or so. pip install brainreg -U
will update.
I just wanted to confirm that I tried this today on an updated version and it works as expected. Thanks again
Describe the bug Orientation doesn't seem to be consistent between the "Check orientation" button in napari brainreg plugin versus when running the registration. The "left-right" lateral direction seems to be flipped between the two for my useage. Note that I am using a single hemisphere
To Reproduce I have one hemisphere of an imaged brain to align with an atlas. Using the check orientation button in napari's brain reg plugin, I find that my data orientation should be
lpi
for a brain geometry ofLeft hemisphere
(screenshot 1). However, when I run this hemisphere through brain reg, I find that the atlas is actually the incorrect lateral orientation and left and right need to be flipped (screenshot 2). I'm able to fix my brain my switching torpi
(screenshot 4), even though the "check orientation" results don't look correct anymore (screenshot 3).Expected behaviour Registration should occur with the correct orientation if the "Check orientation" results look good
Screenshots
"Check orientation" results for
lpi
Registration results for
lpi
"Check orientation" results for
rpi
Registration results for
rpi
Computer used (please complete the following information):