How to use the allensdk.api.queries.svg_api.SvgApi function in allensdk

To help you get started, we’ve selected a few allensdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / brainrender / ABA / atlas_images.py View on Github external
from os import chdir
import pandas as pd
from rich.progress import track

from allensdk.api.queries.svg_api import SvgApi
from allensdk.api.queries.image_download_api import ImageDownloadApi
from allensdk.api.queries.annotated_section_data_sets_api import (
    AnnotatedSectionDataSetsApi,
)
from allensdk.api.queries.ontologies_api import OntologiesApi

from brainrender.Utils.webqueries import send_query
from brainrender.Utils.decorators import fail_on_no_connection


class ImageDownload(SvgApi, ImageDownloadApi):
    """ 
    Handles query to the Allen ImageDownloadApi and saves the data
    """

    mouse_coronal = "Mouse, P56, Coronal"
    mouse_sagittal = "Mouse, P56, Sagittal"
    mouse3d = "Mouse, Adult, 3D Coronal"

    # useful tutorial: https://allensdk.readthedocs.io/en/latest/_static/examples/nb/image_download.html
    @fail_on_no_connection
    def __init__(self):
        SvgApi.__init__(
            self
        )  # https://github.com/AllenInstitute/AllenSDK/blob/master/allensdk/api/queries/svg_api.py
        ImageDownloadApi.__init__(
            self