{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"155622"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from freesurfer_surface import Surface\n",
"\n",
"surface = Surface.read_triangular('../tests/subjects/fabian/surf/lh.pial')\n",
"len(surface.vertices)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" anterior | \n",
" right | \n",
" superior | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" -93.136818 | \n",
" -2.126251 | \n",
" -8.335812 | \n",
"
\n",
" \n",
" 1 | \n",
" -93.194458 | \n",
" -2.696686 | \n",
" -8.206024 | \n",
"
\n",
" \n",
" 2 | \n",
" -93.369530 | \n",
" -3.738874 | \n",
" -8.548558 | \n",
"
\n",
" \n",
" 3 | \n",
" -93.183983 | \n",
" -4.594223 | \n",
" -8.173017 | \n",
"
\n",
" \n",
" 4 | \n",
" -93.190521 | \n",
" -2.160212 | \n",
" -8.865552 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" anterior right superior\n",
"0 -93.136818 -2.126251 -8.335812\n",
"1 -93.194458 -2.696686 -8.206024\n",
"2 -93.369530 -3.738874 -8.548558\n",
"3 -93.183983 -4.594223 -8.173017\n",
"4 -93.190521 -2.160212 -8.865552"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas\n",
"\n",
"vertex_frame = pandas.DataFrame(map(vars, surface.vertices))\n",
"vertex_frame.sort_index('columns', inplace=True)\n",
"vertex_frame.head()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" anterior | \n",
" right | \n",
" superior | \n",
"
\n",
" \n",
" \n",
" \n",
" count | \n",
" 155622.000000 | \n",
" 155622.000000 | \n",
" 155622.000000 | \n",
"
\n",
" \n",
" mean | \n",
" -20.509144 | \n",
" -26.856146 | \n",
" 24.335409 | \n",
"
\n",
" \n",
" std | \n",
" 39.092622 | \n",
" 18.796259 | \n",
" 28.195845 | \n",
"
\n",
" \n",
" min | \n",
" -93.548004 | \n",
" -68.530327 | \n",
" -39.114269 | \n",
"
\n",
" \n",
" 25% | \n",
" -53.572824 | \n",
" -41.877634 | \n",
" 1.600599 | \n",
"
\n",
" \n",
" 50% | \n",
" -23.102324 | \n",
" -26.917927 | \n",
" 24.000984 | \n",
"
\n",
" \n",
" 75% | \n",
" 10.147226 | \n",
" -9.776343 | \n",
" 47.299869 | \n",
"
\n",
" \n",
" max | \n",
" 70.085968 | \n",
" 7.291560 | \n",
" 86.737892 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" anterior right superior\n",
"count 155622.000000 155622.000000 155622.000000\n",
"mean -20.509144 -26.856146 24.335409\n",
"std 39.092622 18.796259 28.195845\n",
"min -93.548004 -68.530327 -39.114269\n",
"25% -53.572824 -41.877634 1.600599\n",
"50% -23.102324 -26.917927 24.000984\n",
"75% 10.147226 -9.776343 47.299869\n",
"max 70.085968 7.291560 86.737892"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"vertex_frame.describe()"
]
}
],
"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.5.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}