{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:10.686466Z", "start_time": "2019-02-27T02:28:08.305819Z" } }, "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" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load data, create atlas object" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:15.735789Z", "start_time": "2019-02-27T02:28:10.689495Z" } }, "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" ] }, { "name": "stdout", "output_type": "stream", "text": [ "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 =[],\n", " updated_y_sinus = [0, 1500, 0]\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Estimate the number of neurons in a region" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:15.741543Z", "start_time": "2019-02-27T02:28:15.738250Z" } }, "outputs": [], "source": [ "# Estimate of total number of neurons from https://www.pnas.org/content/113/26/7255/tab-figures-data\n", "starling_n_neurons = 482.50*10**6\n", "starling_n_neurons_std = 88.29*10**6" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:15.833237Z", "start_time": "2019-02-27T02:28:15.743499Z" } }, "outputs": [], "source": [ "nucleus = 'CMM'" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:16.024719Z", "start_time": "2019-02-27T02:28:15.837596Z" } }, "outputs": [ { "data": { "text/plain": [ "0.0026046479908523462" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n_brain_voxels = np.sum(starling_atlas.voxel_data.loc['Brain', 'voxels'])\n", "n_region_voxels = np.sum(starling_atlas.voxel_data.loc['Nuclei', 'voxels']==starling_atlas.brain_labels.loc[nucleus,'label'])\n", "n_region_voxels/n_brain_voxels" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:16.031214Z", "start_time": "2019-02-27T02:28:16.027497Z" } }, "outputs": [], "source": [ "estimated_region_num_neurons = int((n_region_voxels/n_brain_voxels) * starling_n_neurons)\n", "estimated_region_num_neurons_std = int((n_region_voxels/n_brain_voxels) * starling_n_neurons_std) " ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:16.124715Z", "start_time": "2019-02-27T02:28:16.033145Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CMM has an estimated 1,256,742+=229,964 neurons\n" ] } ], "source": [ "print(nucleus+\" has an estimated {:,}+={:,} neurons\".format(estimated_region_num_neurons, estimated_region_num_neurons_std))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2019-02-27T02:28:16.215488Z", "start_time": "2019-02-27T02:28:16.128516Z" } }, "outputs": [], "source": [ "##TODO - print region volume in mL" ] } ], "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 }