Skip to content

Commit dde13d7

Browse files
committed
Update jupyter notebook tutorial.
1 parent 54c516e commit dde13d7

File tree

1 file changed

+48
-43
lines changed

1 file changed

+48
-43
lines changed

docs/mindboggle_tutorial.ipynb

+48-43
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"source": [
77
"<img align=\"left\" style=\"padding-right:10px; width:150px;\" src=\"https://mfr.osf.io/export?url=https://osf.io/q7ym9/?action=download%26direct%26mode=render&initialWidth=673&childId=mfrIframe&format=1200x1200.jpeg\">\n",
88
"<font size=\"1\">\n",
9-
"This jupyter notebook provides a tutorial for [Mindboggle](http://mindboggle.info), and assumes that you have ``[1]`` entered the bash shell of a docker container from your $HOST (e.g., /Users/arno) and ``[2]`` that the notebook is running within the container:\n",
9+
"This jupyter notebook provides a tutorial for [Mindboggle](http://mindboggle.info), and assumes that you have [1] entered the bash shell of a docker container from your \\$HOST (e.g., /Users/arno) and [2] that the notebook is running within the container:\n",
1010
"<br>\n",
11-
"&nbsp;&nbsp;[1] ``docker run --rm -ti -v $HOST:/home/jovyan/work -p 8888:8888 --entrypoint /bin/bash nipy/mindboggle``<br>\n",
12-
"&nbsp;&nbsp;[2] ``jupyter notebook /opt/mindboggle/docs/mindboggle_tutorial.ipynb``\n",
11+
"[1] docker run --rm -ti -v \\$HOST:/home/jovyan/work -p 8888:8888 --entrypoint /bin/bash nipy/mindboggle\n",
1312
"<br>\n",
14-
"&nbsp;&nbsp;-- <a href=\"http://binarybottle.com\">Arno Klein</a> and Anisha Keshavan (please refer to the [Mindboggle reference](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005350#sec007))\n",
13+
"[2] jupyter notebook /opt/mindboggle/docs/mindboggle_tutorial.ipynb\n",
14+
"<br>\n",
15+
"-- <a href=\"http://binarybottle.com\">Arno Klein</a> and Anisha Keshavan (please refer to the [Mindboggle reference](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005350#sec007))\n",
1516
"</font>"
1617
]
1718
},
@@ -179,7 +180,6 @@
179180
"cell_type": "code",
180181
"execution_count": null,
181182
"metadata": {
182-
"collapsed": true,
183183
"scrolled": false
184184
},
185185
"outputs": [],
@@ -366,26 +366,12 @@
366366
{
367367
"cell_type": "code",
368368
"execution_count": null,
369-
"metadata": {
370-
"collapsed": true
371-
},
369+
"metadata": {},
372370
"outputs": [],
373371
"source": [
374372
"ls /opt/conda/lib/python3.5/site-packages/nbpapaya/Papaya/release/current/standard/papaya.js"
375373
]
376374
},
377-
{
378-
"cell_type": "code",
379-
"execution_count": null,
380-
"metadata": {
381-
"collapsed": true
382-
},
383-
"outputs": [],
384-
"source": [
385-
"from nbpapaya import Overlay\n",
386-
"Overlay"
387-
]
388-
},
389375
{
390376
"cell_type": "markdown",
391377
"metadata": {},
@@ -397,9 +383,7 @@
397383
{
398384
"cell_type": "code",
399385
"execution_count": null,
400-
"metadata": {
401-
"collapsed": true
402-
},
386+
"metadata": {},
403387
"outputs": [],
404388
"source": [
405389
"from mindboggle.mio.plots import histograms_of_lists\n",
@@ -421,9 +405,7 @@
421405
{
422406
"cell_type": "code",
423407
"execution_count": null,
424-
"metadata": {
425-
"collapsed": true
426-
},
408+
"metadata": {},
427409
"outputs": [],
428410
"source": [
429411
"from mindboggle.features.folds import find_depth_threshold\n",
@@ -443,9 +425,7 @@
443425
{
444426
"cell_type": "code",
445427
"execution_count": null,
446-
"metadata": {
447-
"collapsed": true
448-
},
428+
"metadata": {},
449429
"outputs": [],
450430
"source": [
451431
"from mindboggle.features.folds import extract_folds\n",
@@ -493,11 +473,11 @@
493473
"cell_type": "code",
494474
"execution_count": null,
495475
"metadata": {
496-
"collapsed": true,
497476
"scrolled": false
498477
},
499478
"outputs": [],
500479
"source": [
480+
"import numpy as np\n",
501481
"just_folds = np.ones(len(folds))\n",
502482
"df = pd.DataFrame(just_folds, columns=[\"folds\"])\n",
503483
"df.to_csv('folds.csv', index=False)\n",
@@ -573,7 +553,6 @@
573553
"cell_type": "code",
574554
"execution_count": null,
575555
"metadata": {
576-
"collapsed": true,
577556
"scrolled": true
578557
},
579558
"outputs": [],
@@ -591,6 +570,37 @@
591570
"n_sulci"
592571
]
593572
},
573+
{
574+
"cell_type": "markdown",
575+
"metadata": {},
576+
"source": [
577+
"Remove all vertices but the sulci:"
578+
]
579+
},
580+
{
581+
"cell_type": "code",
582+
"execution_count": null,
583+
"metadata": {},
584+
"outputs": [],
585+
"source": [
586+
"#from mindboggle.mio.vtks import rewrite_scalars\n",
587+
"#rewrite_scalars(input_vtk=depth_file,\n",
588+
"# output_vtk='sulci_depth.vtk',\n",
589+
"# new_scalars=[depths, sulci],\n",
590+
"# new_scalar_names=['depth', 'sulci'],\n",
591+
"# filter_scalars=sulci,\n",
592+
"# background_value=1)"
593+
]
594+
},
595+
{
596+
"cell_type": "code",
597+
"execution_count": null,
598+
"metadata": {},
599+
"outputs": [],
600+
"source": [
601+
"#sulci_depths = [depths[i] for i,x in enumerate(depths) if sulci[i] != -1]"
602+
]
603+
},
594604
{
595605
"cell_type": "markdown",
596606
"metadata": {},
@@ -602,14 +612,13 @@
602612
"cell_type": "code",
603613
"execution_count": null,
604614
"metadata": {
605-
"collapsed": true,
606615
"scrolled": false
607616
},
608617
"outputs": [],
609618
"source": [
610-
"df = pd.DataFrame(sulci, columns=[\"sulci\"])\n",
619+
"df = pd.DataFrame(depths, columns=[\"sulci\"])\n",
611620
"df.to_csv('sulci.csv', index=False)\n",
612-
"MeshOpts = getMeshOpts('sulci.vtk', \"sulci.csv\" , 1,10,1)\n",
621+
"MeshOpts = getMeshOpts(sulci_file, \"sulci.csv\" , 1,10,1)\n",
613622
"Overlay(MeshOpts)"
614623
]
615624
},
@@ -623,9 +632,7 @@
623632
{
624633
"cell_type": "code",
625634
"execution_count": null,
626-
"metadata": {
627-
"collapsed": true
628-
},
635+
"metadata": {},
629636
"outputs": [],
630637
"source": [
631638
"from mindboggle.mio.tables import write_shape_stats\n",
@@ -653,9 +660,7 @@
653660
{
654661
"cell_type": "code",
655662
"execution_count": null,
656-
"metadata": {
657-
"collapsed": true
658-
},
663+
"metadata": {},
659664
"outputs": [],
660665
"source": [
661666
"pd.read_csv(sulcus_table)"
@@ -673,7 +678,7 @@
673678
"language_info": {
674679
"codemirror_mode": {
675680
"name": "ipython",
676-
"version": 3.0
681+
"version": 3
677682
},
678683
"file_extension": ".py",
679684
"mimetype": "text/x-python",
@@ -684,5 +689,5 @@
684689
}
685690
},
686691
"nbformat": 4,
687-
"nbformat_minor": 0
688-
}
692+
"nbformat_minor": 1
693+
}

0 commit comments

Comments
 (0)