Access connectivity streamline data

The new and beautiful web-based Brain Explorer shows streamlines when selecting a mouse connectivity experiment. The raw microscopic sections have been available for quite some time, but I can’t get my hands on the processed streamline data. It would be very useful for establishing termination patterns. Is it publicly available? I have searched documentation, but this data seems to have been recently generated, it isn’t mentioned anywhere.

Hi @erpuntbakker,

Welcome to the forum!

There is unfortunately not a nice way to download the streamlines for a given experiment. The closest is the python script on this page, which I don’t think is updated for the latest version of our reference and connectivity data. It seems like an up-to-date version of this functionality might be a cool thing to have, so I’ve made an issue on AllenSDK, our open-source Python package for data access and analysis tools, to track it.

Depending on the specifics of your work, you might be able to instead use our voxelized projection data (from which the streamlines were generated using a fast-marching algorithm). You can learn more about how to access these data from the AllenSDK’s notebook of mouse connectivity example code.

Thanks for writing,
Nile

2 Likes

Thanks a lot for the helpful answer.
I am able to access the streamline data from the developer tools in Chrome, while using the web-version of Brain Explorer. For now I use that as a work-around.

1 Like

Hi,
I was wondering if there is any updates on the streamline data being available for download. I’ve tried the old download_api.py but it no longer seems to work (it freezes where it should download.) Is there any alternative for downloading lines from experiments, and has the fast marching algorithm been applied to the newer experiments?

Thanks

Hi ndeh

No, I’m afraid that we have not had any developers available to make any improvements to the streamlines downloading.

The download that you mentioned should work though. An example of the URL that will be built up by the Python program is:
http://api.brain-map.org/api/v2/data/query.json?criteria=service::mouse_connectivity_target_spatial[seed_point$eq2900,2300,4500][section_data_set$eq156394513]

You should be able to drop that into your web browser to check that it works. If it doesn’t maybe you can reply with more information about how it is not working.

Best regards,
Wayne

Thank you so much Wayne!
yeah, this works.

Hi Wayne,
Is there a limit on the api queries? I started downloading the lines, but after some point the query response[‘success’] is False, which I guess means the server didn’t reply. I was using 10 threads.

Thanks
Nima

There is no defined limit on number of API queries, but it might be that there is a practical limit just based on the server resources. It looks like you may have found that limit. It could also be that other users were actively using the resource at the same time.

Hi Wayne

Actually, it seems that the server is down, since Friday. The rest of the API works fine, but I tried this one from multiple computers and any query to the “mouse_connectivity…” services is unsuccessful:

{"success": false, "id": -1, "start_row": 0, "num_rows": 0, "total_rows": 0, "msg": "Error in query: service::mouse_connectivity_injection_structure[injection_structures$eqIsocortex][primary_structure_only$eqtrue], Connection reset by peer"}

so, I suspect the whole server is down. I couldn’t find a support email to ask them to look into it. Can you reach out to them, Wayne?

Thank you
Nima

Yes, I will check it out and get the right people to start working on solving the problem. Apologies for the inconvenience.
Wayne

Hi Nima

This is fixed now.

Wayne

Thank you Wayne, but, it crashed again…
and I know I did it, because when I first ran the download command it was fine, but when started 5 threads for download it immediately crashed. Last time, it ran fine for a while and crashed later…
Is there any other way to obtain the line data. I feel the connectivity server is too feeble and unreliable for a full download…

The script below downloads the streamlines in the same way as Brain Explorer does it.
https://neuroinformatics.nl/HBP/allen-connectivity-viewer/streamline-downloader.html

You can see the result here:

https://neuroinformatics.nl/HBP/allen-connectivity-viewer

Best regards,

Rembrandt Bakker

4 Likes

Thank you Rembrandt,
pretty cool website! In the visualization tool, are you querying the data live from the api?
The api is back online. I’ll try my luck again, doing my best not to crash it again :slight_smile:

Best,
Nima Dehmamy

Hi Nima,

the code is there to query the data live from the api, but I use it to create a cache and work from there.

In zipped form the data is really compact.

Best regards,

Rembrandt

Hi Rembrandt,

Thanks for the great script! When I use the allen-connectivity-viewer I can load experiments quite fast (I am working with this exp id in particular: 480074702). However if I use the streamline-downloader for the same experiment it doesn’t work, that’s a problem because I would like to download the json file. I can download json files for other experiments but not this particular one, I guess it is due to the size?

Best Regards,
Roberto

Hello everyone,

I have been working on a python based application to render anatomical data from the Allen data sets and neuronal morphological data from the Mouse Light project (see: BrainRender.

I have tried the suggestions online, but I haven’t found a convenient way to download streamline data like that in the new brain explorer yet. Is there any update on this?

Kind regards,
Federico

1 Like

I tested the experiment 480074702 in the streamline-downloader, and it works but takes a minute or so to respond. You can also use the cache that I created: https://neuroinformatics.nl/HBP/allen-connectivity-viewer/json/streamlines_480074702.json.gz.

1 Like

Thanks!
Actually I tried the day after with another computer and everything went fine, I thought I had deleted the post :confused:

Our systems administrators are putting some effort into making this service more resilient. We hope that you will experience less of these service blips in the future.