Follow up on wrong rotation angles using image to reference API

Dear Allen Brain Atlas team,

We are trying to compute the 10um resolution expression grid for E13.5 developing mouse. However, we observed a wrong rotation angle problem. My student and I have spent almost a month on this and really appreciate any suggestion and comments

Our method overview.
Step 1. Download the ISH images of all SectionDataSets at E13.5
Step 2. Use image to reference API to synchronize all images to the reference space.
Step 3. Use the reference space to generate 10um resolution data.

However, we found that ISH images that are mapped to the reference space present very different rotations.

We showed an example of original images (i.e., before synchronizing to the reference space), After synchronization (extract multiple slice in the z-axis and then aggregate them using np.sum from 3D reference space) and our reimplementation of using reverse angle tvs instead of tsv below. We can see that images after synchronization have very different angles.

We can see there is an angle between downloaded section 48 and section 41 images in the original images. The angle between section 41 and 48 becomes even larger after synchronization! This means the two sections are not aligned, the mouse head towards different directions.

Since the angle after the alignment grows even larger, we guess we can reduce the angle by reverse the rotation matrix.
We thus implement the synchronization by first obtaining the ailngment2d matrix and do the np.dot matrix multiplication. To implement the reverse angle, we use “tvs” affine matrix, instead of “tsv” (because actually their rotations are inverse). “tvs” can also be found in the link of “tsv”.
Notably, when we use “tvs”, the resulted (rx, ry, rz) is different from the synchronization API (the img-to-reference API) for the same (sx, sy).

Therefore, we guess the correct rotation should be “tvs”, not “tsv”. The image to reference API might be wrong? Could someone help us? Really appreciated!

Thank you,
Sheng Wang
Assistant professor of computer science
University of Washington

could anyone help us with this? Thank you!

Thank you for your patience, Sheng Wang. We are looking to get you an accurate answer to your question, and hope do so soon.

Best,
Tyler

Thank you very much! Feel free to email me at swang91@uw.edu

I am happy to provide more code/data on my side to reproduce these figures.