{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:12.237030Z", "start_time": "2019-02-27T02:17:12.219158Z" } }, "outputs": [], "source": [ "# for automatic reloading\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:14.423094Z", "start_time": "2019-02-27T02:17:12.239637Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/mnt/cube/tsainbur/conda_envs/tpy3/lib/python3.6/site-packages/tqdm/autonotebook/__init__.py:14: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", " \" (e.g. in jupyter console)\", TqdmExperimentalWarning)\n" ] } ], "source": [ "from birdbrain.atlas import atlas\n", "from birdbrain.utils import um_to_vox\n", "from birdbrain.visualization.plotting_2d import widget_controllers_2d\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To request the zebra finch password email johan.vanaudekerke@uantwerpen.be" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:14.455751Z", "start_time": "2019-02-27T02:17:14.425102Z" } }, "outputs": [], "source": [ "password = None" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:16.018146Z", "start_time": "2019-02-27T02:17:14.457716Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Data already download\n", "Getting voxel data from .img files...\n", "Getting location for each nucleus/region from voxel data...\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=13), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "Atlas created\n" ] } ], "source": [ "# NBVAL_SKIP\n", "dset_dir = '../../data/processed/zebra_finch/'\n", "\n", "zebra_finch_atlas = atlas(\n", " species = 'zebra_finch',\n", " dset_dir = dset_dir,\n", " um_mult = 100,\n", " smoothing = [], #['Brain', 'Brainregions']\n", " password = password\n", ")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:16.051503Z", "start_time": "2019-02-27T02:17:16.020142Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['Nuclei']\n", "['DLM' 'E' 'HVC' 'L' 'LMAN' 'MLd' 'Olfactory_bulb' 'Ov' 'RA' 'Rt' 'TeO'\n", " 'X' 'nXIIts']\n" ] } ], "source": [ "# NBVAL_SKIP\n", "# the only delineation for zebra finch is nuclei\n", "print(np.unique(list(zebra_finch_atlas.brain_labels.type_)))\n", "print(np.unique(list(zebra_finch_atlas.brain_labels.index)))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:17:16.211250Z", "start_time": "2019-02-27T02:17:16.053276Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c159d00ccde8423286ddf6ce910fd42f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=10200.000151991844, description='medial-lateral:', max=10200.000151991844, min=-10200.000151…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "dbf4fd4ba2204ebe831be1a2f79daadd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=10200.000151991844, description='posterior-anterior:', max=10200.000151991844, min=-10200.00…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c69f2aee2dac43f48c367575492d6a90", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=10200.000151991844, description='ventral-dorsal:', max=10200.000151991844, min=-10200.000151…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "573c3d348eed49ae835de3f58d025149", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Region:', index=13, options=('L', 'HVC', 'X', 'RA', 'E', 'LMAN', 'MLd', 'DLM', 'Ov', 'Ol…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4bc1f1c9fad54baab55780235e4b098e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Button(description='Generate graph', style=ButtonStyle())" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NBVAL_SKIP\n", "widget_controllers_2d(zebra_finch_atlas, regions_to_plot=['Nuclei'],brain_masked_image='Atlas');" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }