{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "In the case of **gray matter**, it is the activity of the neurons that is of particular salience, however a static image cannot capture this. As such, researchers often turn to functional MRI scanning to assess the activities of cortical tissue over a given period of time. In this way, the data structure for fMRI is extended over a 4th dimension, time. This allows researchers to investigate how blood oxygen levels (**BOLD**, a proxy measure for neural activity) evolve over time, and associate these changes with experimental manipulations. However, the **white mater** does not contain neuron bodies, and thus typically does not exhibit the kind of biophysical processes that are measured by fMRI. Moreover, what we are intreseted in, relative to **white matter** is not it's *activity* but rather, its *connectivity*. Just as fMRI does not measure brain/neuronal activity directly, the imaging modality used in the study of **white mater**, diffusion MRI, doesn't measure the characteristic of interest (axonal structure/connectivity) directly. Instead, diffusion MRI measures the propensity of water to move in a specific direction. Because **myelin** (the lipid-dense neural structure component which gives white matter it's lighter apperance) restricts water from escaping out of an axon, water thus tends to move in a direction that is perpindicular to the axon (in other words, along the length of the axon). \n", "\n", "Each of these more specialized approaches to investigating brain tissue requires a specialized processing method. In both cases, the processing is specific to a given voxel, as is the characteristic that is to be inferred from looking at these measures. For fMRI, the temporal structure of the **BOLD** signal must be inferred from the changes observed between sampling time points (i.e. slices in the fMRI data object's 4th dimension). For dMRI the axonal structure must be inferred from a multitude of measurements (taken at various angular orientations) of water's diffusion propensity. Interestingly though, in order to explore connective characteristics of the white matter, this derived model of diffusion propensity must be used as the foundation for the generation of another model which attempts to encapsulate the gross axonal structure of the white matter.\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Given that we are attempting to use these brain images for research, it seems that we would want these to be of the highest resolution possble so that we can see the brain's constiuent components in in fine detail. Given our previous look at nifti data stuctures, we know that the resolution is actually fairly coarse (~ 1mm^3). But just for the sake of argument, lets think about how many voxels would it take to represent the brain on a cellular level. \n", "\n", "**What sort of information would we need to make an informed estimate about this?**\n", "\n", "Well, first we would need an estimate of how many neurons are in the cerebral cortex. Herculano-Houzel notes in a 2009 review (https://doi.org/10.3389/neuro.09.031.2009) that a good estimate of this number is actually a recent development, and that most numbers cited were unsubstantiated. The number provided by Herculano-Houzel is **16 billion** neurons in the cerebral cortex (though **69 billion** appear to be located in the cerebellum), and approximately **85 billion non-neuronal cells**\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voxel dimensions for T1 (in mm)\n", "(1.25, 1.25, 1.25)\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Number of non zero (data containing) voxels\n", "972417\n" ] } ], "source": [ "#preloading and processing\n", "import nibabel as nib\n", "import numpy as np\n", "t1Path='/Users/plab/Documents/JupyerData/proj-5c50b6f12daf2e0032f880eb/sub-100206/dt-neuro-anat-t1w.tag-acpc_aligned.tag-brain_extracted.id-5c57072befbc2800526291bb/t1.nii.gz'\n", "img = nib.load(t1Path)\n", "print('Voxel dimensions for T1 (in mm)')\n", "voxelDims=img.header.get_zooms()\n", "print(voxelDims)\n", "print('')\n", "\n", "volData = img.get_fdata()\n", "unwrappedData=np.ndarray.flatten(volData)\n", "\n", "def largeVal(n):\n", " return n>0\n", "\n", "result=map(largeVal,unwrappedData)\n", "largeBool=list(result)\n", "largeNum=sum(largeBool)\n", "print('Number of non zero (data containing) voxels')\n", "print(largeNum)\n", "\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Estimated number neurons\n", "100000000000\n", "\n", "Estimated number of glia\n", "1000000000000\n", "\n", "Number of cells per voxel (estimate)\n", "1131201.9431992653\n", "Number of cells per cubic mm (estimate)\n", "579175.3949180238\n", "\n", "Current data storage usage for T1\n", "3593891 bytes\n", "0.0033470718190073967 gigabytes\n", "\n", "Storage for a \n" ] }, { "ename": "NameError", "evalue": "name 'percellT1bytes' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Storage for a '\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[0mperCellT1bytes\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcellPerVox\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mlargeNum\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;36m8\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 47\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'{percellT1bytes} bytes'\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 48\u001b[0m \u001b[0mperCellT1gigabytes\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mperCellT1bytes\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m1073741824\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'{perCellT1gigabytes} gigabytes'\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mNameError\u001b[0m: name 'percellT1bytes' is not defined" ] } ], "source": [ "#lets assume all cells are layed out in a latice matrix (i.e. they are all orthogonal to each other and they can thus be represented as a matrix.)\n", "print('Estimated number neurons')\n", "#citation\n", "neuronNum=100000000000\n", "print(neuronNum)\n", "print('')\n", "\n", "print('Estimated number of glia')\n", "gliaNum=neuronNum*10\n", "print(gliaNum)\n", "print('')\n", "\n", "\n", "\n", "\n", "#neuronBodySize=25*10^-6\n", "#gliaBodySize=15*10^-6\n", "\n", "#neuronVolume=[neuronBodySize^3]*neuronNum\n", "#gliaVolume=[gliaBodySize^3]*gliaNum\n", "\n", "totalCellNum=neuronNum+gliaNum\n", "\n", "print('Number of cells per voxel (estimate)')\n", "cellPerVox=totalCellNum/largeNum\n", "print(cellPerVox)\n", "\n", "\n", "print('Number of cells per cubic mm (estimate)')\n", "cellPerMM=cellPerVox/(voxelDims[0]*voxelDims[1]*voxelDims[2])\n", "print(cellPerMM)\n", "print('')\n", "\n", "axonNum=neuronNum\n", "\n", "print('Current data storage usage for T1')\n", "import os\n", "statinfo = os.stat(t1Path)\n", "T1bytes=statinfo.st_size\n", "print(f'{T1bytes} bytes' )\n", "T1gigabytes=T1bytes/1073741824\n", "print(f'{T1gigabytes} gigabytes' )\n", "print('')\n", "\n", "print('Storage for a ')\n", "perCellT1bytes=cellPerVox*largeNum*8\n", "print(f'{percellT1bytes} bytes' )\n", "perCellT1gigabytes=perCellT1bytes/1073741824\n", "print(f'{perCellT1gigabytes} gigabytes' )\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "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.7.5" } }, "nbformat": 4, "nbformat_minor": 2 }