aba_utils

Contents

parse_neurons_colors [#28]

Check the source code online
1
def parse_neurons_colors(neurons, color):
Copied!
  docstring:
1
Prepares the color info to render neurons
2
3
:param neurons: str, list, dict. File(s) with neurons data or list of
4
rendered neurons.
5
6
:param color: default None. Can be:
7
8
- None: each neuron is given a random color
9
10
- color: rbg, hex etc. If a single color is passed all neurons will
11
have that color
12
13
- cmap: str with name of a colormap: neurons are colored based on
14
their sequential order and cmap
15
16
- dict: a dictionary specifying a color for soma, dendrites and axon
17
actors, will be the same for all neurons
18
19
- list: a list of length = number of neurons with either a single
20
color for each neuron
21
22
or a dictionary of colors for each neuron
Copied!

parse_tractography_colors [#147]

Check the source code online
1
def parse_tractography_colors(tractography, include_all_inj_regions,
2
color=None, color_by='manual', VIP_regions=[], VIP_color=None,
3
others_color='salmon'):
Copied!
  docstring:
1
parses color arguments to render tracrography data
2
3
:param tractography: list of dictionaries with tractography data
4
5
:param color: color of rendered tractography data
6
7
:param color_by: str, specifies which criteria to use to color the
8
tractography (Default value = "manual")
9
10
Options:
11
12
- manual: the user needs to provide a color or list of colors
13
14
- target_region: tracts are colored according to the region where the
15
injection was done.
16
17
if VIP_regions is passed, then only tracts for the VIP regions are
18
colored
19
20
:param VIP_regions: list of brain regions with VIP treatement (Default
21
value = [])
22
23
:param VIP_color: str, color to use for VIP data (Default value =
24
None)
25
26
:param include_all_inj_regions: bool (Default value = False)
27
28
:param others_color: str, color for not VIP data (Default value =
29
"white")
Copied!

experiments_source_search [#243]

Check the source code online
1
def experiments_source_search(mca, SOI, *args, source=True, **kwargs):
Copied!
  docstring:
1
Returns data about experiments whose injection was in the SOI,
2
structure of interest
3
4
:param SOI: str, structure of interest. Acronym of structure to use as
5
seed for teh search
6
7
:param *args:
8
9
:param source: (Default value = True)
10
11
:param **kwargs:
Copied!

parse_streamline [#301]

Check the source code online
1
def parse_streamline(*args, filepath=None, data=None,
2
show_injection_site=True, color='ivory', alpha=0.8, radius=10,
3
**kwargs):
Copied!
  docstring:
1
Given a path to a .json file with streamline data (or the data
2
themselves), render the streamline as tubes actors.
3
4
Either filepath or data should be passed
5
6
:param filepath: str, optional. Path to .json file with streamline
7
data (Default value = None)
8
9
:param data: panadas.DataFrame, optional. DataFrame with streamline
10
data. (Default value = None)
11
12
:param color: str color of the streamlines (Default value = 'ivory')
13
14
:param alpha: float transparency of the streamlines (Default value =
15
.8)
16
17
:param radius: int radius of the streamlines actor (Default value =
18
10)
19
20
:param show_injection_site: bool, if True spheres are used to render
21
the injection volume (Default value = True)
22
23
:param *args:
24
25
:param **kwargs:
Copied!

make_url_given_id [#378]

Check the source code online
1
def make_url_given_id(expid):
Copied!
  docstring:
1
Get url of JSON file for an experiment, give it's ID number
2
3
:param expid: int with experiment ID number
Copied!

download_streamlines [#390]

Check the source code online
1
def download_streamlines(eids, streamlines_folder=None):
Copied!
  docstring:
1
Given a list of expeirmental IDs, it downloads the streamline data
2
from the https://neuroinformatics.nl cache and saves them as
3
4
json files.
5
6
:param eids: list of integers with experiments IDs
7
8
:param streamlines_folder: str path to the folder where the JSON files
9
should be saved, if None the default is used (Default value = None)
Copied!

extract_ids_from_csv [#430]

Check the source code online
1
def extract_ids_from_csv(csv_file, download=False, **kwargs):
Copied!
  docstring:
1
Parse CSV file to extract experiments IDs and link to downloadable
2
streamline data
3
4
Given a CSV file with info about experiments downloaded from:
5
http://connectivity.brain-map.org
6
7
extract experiments ID and get links to download (compressed)
8
streamline data from https://neuroinformatics.nl.
9
10
Also return the experiments IDs to download data from:
11
https://neuroinformatics.nl/HBP/allen-connectivity-viewer/streamline-
12
downloader.html
13
14
:param csv_file: str with path to csv file
15
16
:param download: if True the data are downloaded automatically
17
(Default value = False)
18
19
:param **kwargs:
Copied!
Last modified 1yr ago