Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# get ontologies API and brain structures sets
self.oapi = OntologiesApi()
# get reference space
self.space = ReferenceSpaceApi()
self.spacecache = ReferenceSpaceCache(
manifest=os.path.join(
self.annotated_volume_fld, "manifest.json"
), # downloaded files are stored relative to here
resolution=int(self.resolution[0]),
reference_space_key="annotation/ccf_2017", # use the latest version of the CCF
)
self.annotated_volume, _ = self.spacecache.get_annotation_volume()
# mouse connectivity API [used for tractography]
self.mca = MouseConnectivityApi()
# Get tree search api
self.tree_search = TreeSearchApi()
# get ontologies API and brain structures sets
self.oapi = OntologiesApi()
# get reference space
self.space = ReferenceSpaceApi()
self.spacecache = ReferenceSpaceCache(
manifest=os.path.join(
self.annotated_volume_fld, "manifest.json"
), # downloaded files are stored relative to here
resolution=self.resolution,
reference_space_key="annotation/ccf_2017", # use the latest version of the CCF
)
self.annotated_volume, _ = self.spacecache.get_annotation_volume()
# mouse connectivity API [used for tractography]
self.mca = MouseConnectivityApi()
# Get tree search api
self.tree_search = TreeSearchApi()
"""
Module containing VoxelModelApi.
"""
# Authors: Joseph Knox
# License: Allen Institute Software License
from allensdk.api.cache import cacheable, Cache
from allensdk.api.queries.mouse_connectivity_api import MouseConnectivityApi
class VoxelModelApi(MouseConnectivityApi):
'''HTTP Client extending MouseConnectivityApi to download model data.
'''
HTTP_MODEL_DIRECTORY = "http://download.alleninstitute.org/publications/"\
"A_high_resolution_data-driven_model_of_the_mouse_connectome/"
NODES_FILE = "nodes.csv.gz"
WEIGHTS_FILE = "weights.csv.gz"
SOURCE_MASK_FILE = "source_mask_params.json"
TARGET_MASK_FILE = "target_mask_params.json"
CONNECTION_DENSITY_FILE = 'connection_density.csv.gz'
CONNECTION_STRENGTH_FILE = 'connection_strength.csv.gz'
NORMALIZED_CONNECTION_DENSITY_FILE = 'normalized_connection_density.csv.gz'
NORMALIZED_CONNECTION_STRENGTH_FILE = 'normalized_connection_strength.csv.gz'
def download_model_files(self, file_name, save_file_path=None):