{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:32:08.201364Z", "start_time": "2019-02-27T02:32:05.052364Z" } }, "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_3d import plot_regions_3d, rotate_plot" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:32:35.710066Z", "start_time": "2019-02-27T02:32:08.204235Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "qform_code 32 not valid; setting to 0\n", "qform_code 32 not valid; setting to 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Data already download\n", "Loading brain labels...\n", "Getting voxel data from .img files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "qform_code 32 not valid; setting to 0\n", "qform_code 32 not valid; setting to 0\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=1), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=22), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=12), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "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=45), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "Atlas created\n" ] } ], "source": [ "dset_dir = '../../data/processed/starling/'\n", "\n", "starling_atlas = atlas(\n", " species = 'starling',\n", " dset_dir = dset_dir,\n", " um_mult = 100,\n", " smoothing = ['Brain', 'Nuclei', 'Tracts'],\n", " updated_y_sinus = [0, 1500, 0]\n", ")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:32:35.725262Z", "start_time": "2019-02-27T02:32:35.712575Z" } }, "outputs": [], "source": [ "tracts = [[reg, 'Tracts'] for reg in list(starling_atlas.brain_labels[starling_atlas.brain_labels.type_ == 'Tracts'].region.values)]\n", "nuclei = [[reg, 'Nuclei'] for reg in list(starling_atlas.brain_labels[starling_atlas.brain_labels.type_ == 'Nuclei'].region.values)]\n", "brain_regions = [[reg, 'Brainregions'] for reg in list(starling_atlas.brain_labels[starling_atlas.brain_labels.type_ == 'Brainregions'].region.values)]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:32:57.782815Z", "start_time": "2019-02-27T02:32:35.727406Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/mnt/cube/tsainbur/conda_envs/tpy3/lib/python3.6/site-packages/traittypes/traittypes.py:101: UserWarning: Given trait value dtype \"uint8\" does not match required type \"float32\". A coerced copy has been created.\n", " np.dtype(self.dtype).name))\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=22), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "895a847f88714cbf9732ca662d1e8381", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5b590705c9b44950945d1f8a8b995ded", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=0.0, description='medial-lateral:', max=10937.0, min=-10737.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1e63e05987744e04b1202afa98a506e9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=0.0, description='posterior-anterior:', max=13337.0, min=-8337.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b96cb9e35ba140e68539b9d69525c983", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FloatSlider(value=0.0, description='ventral-dorsal:', max=4237.0, min=-17437.0, step=100.0)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "43534e89d83f4c1e9cd55bac15f4f48a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Region:', index=22, options=('Field_L', 'NCM', 'Ov', 'MLd', 'CMM', 'TeO', 'Entopallium',…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot, vec = plot_regions_3d(starling_atlas, regions_to_plot = nuclei, downsample_pct = 1,\n", " polygon_simplification = 0,\n", " verbose=False)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:33:01.831203Z", "start_time": "2019-02-27T02:32:57.784929Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(IntProgress(value=0, max=120), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\r" ] } ], "source": [ "rotate_plot(plot, n_frames = 60, fr=32, nrot = 2, radius = 8000)" ] }, { "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 }