Matching experiment section images with brain segmentation

Hi

I have a question regarding matching the Mouse Connectivity experiments section images with the brain segmentation in the Brain Atlas reference space. So far I was not able to find a way to project the segmentation onto a section image. Does such API exist? Querying by pixel can also be an option though less preferable due to high amount of the API invocations (I need information regarding many points) and the latency it would incur.

Thank you very much in advance!
David

Hello

You are correct that there is no API to project a complete reference segmentation on to a section image. However, there is an API to map a pixel of a section image to a point in the CCF. This is what drives our “image sync” functionality (image below), and could be used to do what you are describing. Documentation for this API is at https://help.brain-map.org/display/api/Image-to-Image+Synchronization#Image-to-ImageSynchronization-Image-To-Reference .

1 Like

Thank you so much for your reply! Is it possible to submit a group of queries in a single API call? I need to obtain this information about the whole image, which can be pretty time-consuming considering the REST call round-trip time. Thank you!

One more question is what is Reference Space ID and how I obtain one? I am using Python SDK and I haven’t found it anywhere Thank you!

1 Like

No, there is no single API available to do this, but all of the information is available via APIs. So, theoretically you could write something to do this more efficiently. Here are some resources:

Documentation of the SectionImage.image_to_reference method: http://api.brain-map.org/doc/SectionImage.html

List of reference spaces: http://api.brain-map.org/api/v2/data/ReferenceSpace/query.json

Information on our API query language: http://help.brain-map.org/pages/viewpage.action?pageId=5308449

Example API query to get transform values at the SectionDataSet level:
http://api.brain-map.org/api/v2/data/query.json?criteria=model::SectionDataSet,rma::criteria,[id$eq524874308],alignment3d,rma::include,alignment3d

Example API query to get transform values at the SectionImage level:
http://api.brain-map.org/api/v2/data/query.json?criteria=model::SectionImage,rma::criteria,[data_set_id$eq524874308][section_number$eq14],alignment2d,rma::include,alignment2d

Thank you so much Wayne!

I played with it but still did not manage to match a pixel from the section image to the matching id from the structure tree. If there is any sample code I can use, it would be greatly appreciated. Thanks in advance!

This repo contains a notebook from a colleague that may help you do what you want. I do need to draw your attention to the Level of Support noted on the repo.

Best regards,
Wayne

Thank you so much Wayne!