""" 
    This tutorial shows how download and rendered afferent mesoscale projection data
    using the AllenBrainAtlas (ABA) and Scene classes and coloring a subset of the 
    data differently based on the location of virus injection
"""
import brainrender

brainrender.SHADER_STYLE = "cartoon"
from brainrender.scene import Scene
from brainrender.atlases.mouse import ABA


# Create a scene
scene = Scene()

# Get the center of mass of the region of interest
p0 = scene.atlas.get_region_CenterOfMass("ZI")

# Get projections to that point
analyzer = ABA()
tract = analyzer.get_projection_tracts_to_target(p0=p0)

# Add the brain regions and the projections to it
scene.add_brain_regions(["ZI"], alpha=0.4, use_original_color=True)
scene.add_tractography(tract, color_by="target_region", VIP_regions=['SCm'], VIP_color='green')

scene.render()
