{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:11:38.071793Z", "start_time": "2019-02-27T02:11:35.747112Z" }, "scrolled": true }, "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", "import numpy as np\n", "from birdbrain.visualization.plotting_2d import widget_controllers_2d" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load data, create atlas object" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:12:00.750063Z", "start_time": "2019-02-27T02:11:38.074799Z" } }, "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=66), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Atlas created\n" ] } ], "source": [ "dset_dir = '../../data/processed/canary/'\n", "\n", "canary_atlas = atlas(\n", " species = 'canary',\n", " dset_dir = dset_dir,\n", " um_mult = 1,\n", " smoothing = []#['Brain', 'Brainregions']\n", ")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:12:00.757720Z", "start_time": "2019-02-27T02:12:00.752191Z" } }, "outputs": [ { "data": { "text/plain": [ "Index(['Nuclei', 'Skull', 'Tracts', 'Brain', 'Combined_set', 'Subdivisions',\n", " 'T2_rare_3d', 'T2_flash_3d_hr'],\n", " dtype='object')" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "canary_atlas.voxel_data.index" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:12:00.853489Z", "start_time": "2019-02-27T02:12:00.759296Z" } }, "outputs": [ { "data": { "text/plain": [ "(299, 401, 478)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.shape(canary_atlas.voxel_data.loc['Brain', 'voxels'])" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:12:00.941436Z", "start_time": "2019-02-27T02:12:00.855543Z" } }, "outputs": [ { "data": { "text/plain": [ "(299, 401, 478)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.shape(canary_atlas.voxel_data.loc['T2_rare_3d', 'voxels'])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:12:01.103432Z", "start_time": "2019-02-27T02:12:00.943244Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "89c7cfb286a542978f6fa2d0e69da7ae", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=9000.0, description='medial-lateral:', max=9000.0, min=-8880.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0e0654eb98ed4735b1bbae7559f5fd38", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=10980.0, description='posterior-anterior:', max=10980.0, min=-13020.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ce79d8b214e84aa1a67add32f100a5be", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=2760.0, description='ventral-dorsal:', max=2760.0, min=-25860.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "257b000268e741e18be80e333b338903", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Region:', index=24, options=('L2', 'HVC', 'OB', 'E', 'lMAN', 'mMAN', 'area X', 'Bas', 'R…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "390eb782e32b40f3a295792c44947cef", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Button(description='Generate graph', style=ButtonStyle())" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "widget_controllers_2d(canary_atlas, ['Nuclei'], brain_masked_image='T2_rare_3d', region_alpha = 0.5) " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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 }