# How to sync section images with MRI coordinates?

**URL:** <https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043>\
**Category:** Technical\
**Tags:** mri, analysis, how-to, image-registration\
**Created:** [April 16, 2021, 8:46am UTC](https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043 "2021-04-16T08:46:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justgos](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/justgos/32/389_2.png) [@justgos](https://community.brain-map.org/u/justgos)\
**Post date:** [April 16, 2021, 8:46am UTC](https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043/1 "2021-04-16T08:46:10Z")

</div>

Hi!

i want to align 2D slice image to the MRI space and having difficulty getting information about Z axis (and also some dangling parameters in X and Y):

Given the slide image [102058920](http://api.brain-map.org/api/v2/section_image_download/102058920?downsample=4&annotation=false&expression=false), which belongs to the root specimen H0351.1009, i take two points at the image’s extremes: `[0,0,0]` and `[30287, 41968,0]` (width and height at the original scale) and apply the `tvr` part of the specimen’s 710418 (the direct parent of this section image) `alignment3d` transformation to them (and divide by 1000, as those are micrometers and the MRI is in millimeters).  
The resulting coordinates give me a kinda plausible positions within the specimen’s MRI volume, but the two problems remain:

- Z coordinate is not affecte by this transformation (it’s still 0)
- there are non-zero attributes `parent_x_coord`, `parent_y_coord` and `parent_z_coord` for each specimen from the one specified in the slice image - 710418 - all the way up to the root one - 708900. An i’ve also encountered slice images linked to the specimens without `alignment3d` attribute at all, so the should presumably be aligned via this coorinates only

Is there some kind of a documentation of how these alignment are properly calculated?  
Or is there a source code for the API (not the SDK) which i can look into and find it myself?

---

<div class="post-metadata">

**Author:** ![justgos](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/justgos/32/389_2.png) [@justgos](https://community.brain-map.org/u/justgos)\
**Post date:** [April 16, 2021, 8:46am UTC](https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043/2 "2021-04-16T08:46:55Z")

</div>

additional links (was unable to insert 'em in the original post as a new user):

- specimen’s MRI volume - [http://api.brain-map.org/api/v2/well\_known\_file\_download/157722290](http://api.brain-map.org/api/v2/well_known_file_download/157722290)
- specimen 710418’s info - [http://api.brain-map.org/api/v2/data/query.xml?criteria=model::Specimen[id$eq710418],rma::include,alignment3d](http://api.brain-map.org/api/v2/data/query.xml?criteria=model::Specimen%5Bid%24eq710418%5D,rma::include,alignment3d)

---

<div class="post-metadata">

**Author:** ![lydian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/lydian/32/174_2.png) [@lydian](https://community.brain-map.org/u/lydian)\
**Post date:** [April 20, 2021, 5:51pm UTC](https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043/3 "2021-04-20T17:51:05Z")

</div>

Hi @justgos,

We have only mapped our whole brain mouse image data to the mouse CCF.

Since we have not mapped human tissue images to its MRI or any other standard space and hence we don’t have “alignment3D” parameters for them.

---

<div class="post-metadata">

**Author:** ![justgos](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/justgos/32/389_2.png) [@justgos](https://community.brain-map.org/u/justgos)\
**Post date:** [April 21, 2021, 8:09am UTC](https://community.brain-map.org/t/how-to-sync-section-images-with-mri-coordinates/1043/4 "2021-04-21T08:09:30Z")

</div>

i see. Thanks for clarifying that!

A bit weird that specimen 710418 (linked above) has the alignment3D and is a part of a human brain, but maybe that’s just a preliminary mapping.
