Skip to content

Commit e2a29fb

Browse files
committed
ENH: delets ANTs example and resizes short example graph
1 parent c728750 commit e2a29fb

File tree

4 files changed

+55
-95
lines changed

4 files changed

+55
-95
lines changed

index.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@
239239
"</p>\n",
240240
"To inspect the html code of this page, click: <form action=\"javascript:code_toggle()\"><input type=\"submit\" value=\"Show HTML code\"></form>"
241241
]
242+
},
243+
{
244+
"cell_type": "code",
245+
"execution_count": null,
246+
"metadata": {
247+
"collapsed": true
248+
},
249+
"outputs": [],
250+
"source": []
242251
}
243252
],
244253
"metadata": {

notebooks/introduction_nipype.ipynb

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"deletable": true,
7878
"editable": true,
7979
"slideshow": {
80-
"slide_type": "slide"
80+
"slide_type": "subslide"
8181
}
8282
},
8383
"source": [
@@ -131,7 +131,9 @@
131131
"\n",
132132
"You and your problems with fMRI data. I'm perfectly happy with FreeSurfer's command line interface. It gives me all I need to do surface based analyses.\n",
133133
"\n",
134-
"<img src=\"../static/images/example_Freesurfer.png\" width=\"600\">"
134+
"<img src=\"../static/images/example_Freesurfer.png\" width=\"600\">\n",
135+
"\n",
136+
"Of course, you can run your sequential FreeSurfer scripts as you want. But wouldn't it be nice to optimize computation time by using parallel computation?"
135137
]
136138
},
137139
{
@@ -144,8 +146,6 @@
144146
}
145147
},
146148
"source": [
147-
"Of course, you can run your sequential FreeSurfer scripts as you want. But wouldn't it be nice to optimize computation time by using parallel computation?\n",
148-
"\n",
149149
"Let's imagine you want to do smoothing on the surface, with **two different FWHM** values, on **both hemispheres** and this on **six subjects**, all in **parallel**? With Nipype this is as simple as that:\n",
150150
"\n",
151151
"```python\n",
@@ -161,47 +161,6 @@
161161
"```"
162162
]
163163
},
164-
{
165-
"cell_type": "markdown",
166-
"metadata": {
167-
"deletable": true,
168-
"editable": true,
169-
"slideshow": {
170-
"slide_type": "subslide"
171-
}
172-
},
173-
"source": [
174-
"# If you want to have good normalization, you need ANTs!\n",
175-
"\n",
176-
"I agree, but there's just a difference between this:\n",
177-
"\n",
178-
"<img src=\"../static/images/example_ANTs.png\" width=\"600\">"
179-
]
180-
},
181-
{
182-
"cell_type": "markdown",
183-
"metadata": {
184-
"deletable": true,
185-
"editable": true,
186-
"slideshow": {
187-
"slide_type": "fragment"
188-
}
189-
},
190-
"source": [
191-
"and this:\n",
192-
"\n",
193-
"```python\n",
194-
"from nipype.interfaces.ants import Registration\n",
195-
"regist = Registration(fixed_image='MNI152_T1_2mm.nii.gz', \n",
196-
" moving_image='functional.nii', \n",
197-
" transforms=['Rigid', 'Affine', 'SyN'], \n",
198-
" metric=['MI', 'MI', 'CC'], \n",
199-
" metric_weight=[1.0] * 3, \n",
200-
" shrink_factors=[[8, 4, 2, 1]] * 3, \n",
201-
" smoothing_sigmas=[[3, 2, 1, 0]] * 3)\n",
202-
"```"
203-
]
204-
},
205164
{
206165
"cell_type": "markdown",
207166
"metadata": {
@@ -231,11 +190,9 @@
231190
"source": [
232191
"# A short Example\n",
233192
"\n",
234-
"Let's assume we want to do preprocessing that uses **SPM** for *motion correction*, **FreeSurfer** for *coregistration*, **ANTS** for *normalization* and **FSL** for *smoothing*. Normally this would be a hell of a mess. It would mean switching between multiple scripts in different programming languages with a lot of manual intervention.\n",
235-
"\n",
236-
"**Nipype does all that for you! In parallel and in a very intuitive way!**\n",
193+
"Let's assume we want to do preprocessing that uses **SPM** for *motion correction*, **FreeSurfer** for *coregistration*, **ANTS** for *normalization* and **FSL** for *smoothing*. Normally this would be a hell of a mess. It would mean switching between multiple scripts in different programming languages with a lot of manual intervention. **Nipype comes to the rescue!**\n",
237194
"\n",
238-
"<img src=\"../static/images/nipype_example_graph.png\" width=\"750\">"
195+
"<img src=\"../static/images/nipype_example_graph.png\" width=\"650\">"
239196
]
240197
},
241198
{

notebooks/introduction_nipype.slides.html

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
*
6868
*/
6969
/*!
70-
* Bootstrap v3.3.6 (http://getbootstrap.com)
71-
* Copyright 2011-2015 Twitter, Inc.
70+
* Bootstrap v3.3.7 (http://getbootstrap.com)
71+
* Copyright 2011-2016 Twitter, Inc.
7272
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7373
*/
7474
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
@@ -1163,7 +1163,6 @@
11631163
text-decoration: underline;
11641164
}
11651165
a:focus {
1166-
outline: thin dotted;
11671166
outline: 5px auto -webkit-focus-ring-color;
11681167
outline-offset: -2px;
11691168
}
@@ -2592,7 +2591,6 @@
25922591
input[type="file"]:focus,
25932592
input[type="radio"]:focus,
25942593
input[type="checkbox"]:focus {
2595-
outline: thin dotted;
25962594
outline: 5px auto -webkit-focus-ring-color;
25972595
outline-offset: -2px;
25982596
}
@@ -3083,7 +3081,6 @@
30833081
.btn.focus,
30843082
.btn:active.focus,
30853083
.btn.active.focus {
3086-
outline: thin dotted;
30873084
outline: 5px auto -webkit-focus-ring-color;
30883085
outline-offset: -2px;
30893086
}
@@ -8814,6 +8811,9 @@
88148811
margin-left: 10px;
88158812
}
88168813
}
8814+
[dir="rtl"] #ipython_notebook {
8815+
float: right !important;
8816+
}
88178817
#noscript {
88188818
width: auto;
88198819
padding-top: 16px;
@@ -9016,9 +9016,15 @@
90169016
*
90179017
* Author: Jupyter Development Team
90189018
*/
9019+
[dir="rtl"] #tabs li {
9020+
float: right;
9021+
}
90199022
ul#tabs {
90209023
margin-bottom: 4px;
90219024
}
9025+
[dir="rtl"] ul#tabs {
9026+
margin-right: 0px;
9027+
}
90229028
ul#tabs a {
90239029
padding-top: 6px;
90249030
padding-bottom: 4px;
@@ -9041,6 +9047,16 @@
90419047
.list_toolbar .tree-buttons {
90429048
padding-top: 1px;
90439049
}
9050+
[dir="rtl"] .list_toolbar .tree-buttons {
9051+
float: left !important;
9052+
}
9053+
[dir="rtl"] .list_toolbar .pull-right {
9054+
padding-top: 1px;
9055+
float: left !important;
9056+
}
9057+
[dir="rtl"] .list_toolbar .pull-left {
9058+
float: right !important;
9059+
}
90449060
.dynamic-buttons {
90459061
padding-top: 3px;
90469062
display: inline-block;
@@ -9176,6 +9192,9 @@
91769192
#tree-selector {
91779193
padding-right: 0px;
91789194
}
9195+
[dir="rtl"] #tree-selector a {
9196+
float: right;
9197+
}
91799198
#button-select-all {
91809199
min-width: 50px;
91819200
}
@@ -9265,6 +9284,9 @@
92659284
left: auto;
92669285
right: 0;
92679286
}
9287+
[dir="rtl"] #new-menu {
9288+
text-align: right;
9289+
}
92689290
.kernel-menu-icon {
92699291
padding-right: 12px;
92709292
width: 24px;
@@ -9310,6 +9332,9 @@
93109332
#running .panel-group .panel .panel-body .list_container .list_item:last-child {
93119333
border-bottom: 0px;
93129334
}
9335+
[dir="rtl"] #running .col-sm-8 {
9336+
float: right !important;
9337+
}
93139338
.delete-button {
93149339
display: none;
93159340
}
@@ -9605,6 +9630,7 @@
96059630
}
96069631
}
96079632
div.inner_cell {
9633+
min-width: 0;
96089634
/* Old browsers */
96099635
display: -webkit-box;
96109636
-webkit-box-orient: vertical;
@@ -9626,11 +9652,6 @@
96269652
/* Modern browsers */
96279653
flex: 1;
96289654
}
9629-
@-moz-document url-prefix() {
9630-
div.inner_cell {
9631-
overflow-x: hidden;
9632-
}
9633-
}
96349655
/* input_area and input_prompt must match in top border and margin for alignment */
96359656
div.input_area {
96369657
border: 1px solid #cfcfcf;
@@ -11300,7 +11321,7 @@
1130011321
}
1130111322
.shortcut_key {
1130211323
display: inline-block;
11303-
width: 20ex;
11324+
width: 21ex;
1130411325
text-align: right;
1130511326
font-family: monospace;
1130611327
}
@@ -11612,6 +11633,7 @@
1161211633
box-shadow: 0px 0px 12px 1px rgba(87, 87, 87, 0.2);
1161311634
}
1161411635
.terminal-app .terminal {
11636+
width: 100%;
1161511637
float: left;
1161611638
font-family: monospace;
1161711639
color: white;
@@ -11626,6 +11648,9 @@
1162611648
line-height: 1em;
1162711649
font-size: 14px;
1162811650
}
11651+
.terminal-app .terminal .xterm-rows {
11652+
padding: 10px;
11653+
}
1162911654
.terminal-app .terminal-cursor {
1163011655
color: black;
1163111656
background: white;
@@ -11877,7 +11902,7 @@ <h1 id="I-don't-need-that,-I'm-happy-with-SPM12!">I don't need that, I'm happy w
1187711902

1187811903
</div>
1187911904
</div>
11880-
</div></section></section><section><section>
11905+
</div></section><section>
1188111906
<div class="cell border-box-sizing text_cell rendered">
1188211907
<div class="prompt input_prompt">
1188311908
</div>
@@ -11916,6 +11941,7 @@ <h1 id="I-don't-need-that,-I'm-happy-with-FSL!">I don't need that, I'm happy wit
1191611941
<div class="text_cell_render border-box-sizing rendered_html">
1191711942
<h1 id="I-don't-need-that,-I'm-happy-with-FreeSurfer!">I don't need that, I'm happy with FreeSurfer!<a class="anchor-link" href="#I-don't-need-that,-I'm-happy-with-FreeSurfer!">&#182;</a></h1><p>You and your problems with fMRI data. I'm perfectly happy with FreeSurfer's command line interface. It gives me all I need to do surface based analyses.</p>
1191811943
<p><img src="../static/images/example_Freesurfer.png" width="600"></p>
11944+
<p>Of course, you can run your sequential FreeSurfer scripts as you want. But wouldn't it be nice to optimize computation time by using parallel computation?</p>
1191911945

1192011946
</div>
1192111947
</div>
@@ -11925,7 +11951,6 @@ <h1 id="I-don't-need-that,-I'm-happy-with-FreeSurfer!">I don't need that, I'm ha
1192511951
</div>
1192611952
<div class="inner_cell">
1192711953
<div class="text_cell_render border-box-sizing rendered_html">
11928-
<p>Of course, you can run your sequential FreeSurfer scripts as you want. But wouldn't it be nice to optimize computation time by using parallel computation?</p>
1192911954
<p>Let's imagine you want to do smoothing on the surface, with <strong>two different FWHM</strong> values, on <strong>both hemispheres</strong> and this on <strong>six subjects</strong>, all in <strong>parallel</strong>? With Nipype this is as simple as that:</p>
1193011955
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">nipype.interfaces.freesurfer</span> <span class="kn">import</span> <span class="n">SurfaceSmooth</span>
1193111956
<span class="n">smoother</span> <span class="o">=</span> <span class="n">SurfaceSmooth</span><span class="p">()</span>
@@ -11946,36 +11971,6 @@ <h1 id="I-don't-need-that,-I'm-happy-with-FreeSurfer!">I don't need that, I'm ha
1194611971
</div>
1194711972
<div class="inner_cell">
1194811973
<div class="text_cell_render border-box-sizing rendered_html">
11949-
<h1 id="If-you-want-to-have-good-normalization,-you-need-ANTs!">If you want to have good normalization, you need ANTs!<a class="anchor-link" href="#If-you-want-to-have-good-normalization,-you-need-ANTs!">&#182;</a></h1><p>I agree, but there's just a difference between this:</p>
11950-
<p><img src="../static/images/example_ANTs.png" width="600"></p>
11951-
11952-
</div>
11953-
</div>
11954-
</div><div class="fragment">
11955-
<div class="cell border-box-sizing text_cell rendered">
11956-
<div class="prompt input_prompt">
11957-
</div>
11958-
<div class="inner_cell">
11959-
<div class="text_cell_render border-box-sizing rendered_html">
11960-
<p>and this:</p>
11961-
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">nipype.interfaces.ants</span> <span class="kn">import</span> <span class="n">Registration</span>
11962-
<span class="n">regist</span> <span class="o">=</span> <span class="n">Registration</span><span class="p">(</span><span class="n">fixed_image</span><span class="o">=</span><span class="s1">&#39;MNI152_T1_2mm.nii.gz&#39;</span><span class="p">,</span>
11963-
<span class="n">moving_image</span><span class="o">=</span><span class="s1">&#39;functional.nii&#39;</span><span class="p">,</span>
11964-
<span class="n">transforms</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;Rigid&#39;</span><span class="p">,</span> <span class="s1">&#39;Affine&#39;</span><span class="p">,</span> <span class="s1">&#39;SyN&#39;</span><span class="p">],</span>
11965-
<span class="n">metric</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;MI&#39;</span><span class="p">,</span> <span class="s1">&#39;MI&#39;</span><span class="p">,</span> <span class="s1">&#39;CC&#39;</span><span class="p">],</span>
11966-
<span class="n">metric_weight</span><span class="o">=</span><span class="p">[</span><span class="mf">1.0</span><span class="p">]</span> <span class="o">*</span> <span class="mi">3</span><span class="p">,</span>
11967-
<span class="n">shrink_factors</span><span class="o">=</span><span class="p">[[</span><span class="mi">8</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">]]</span> <span class="o">*</span> <span class="mi">3</span><span class="p">,</span>
11968-
<span class="n">smoothing_sigmas</span><span class="o">=</span><span class="p">[[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]]</span> <span class="o">*</span> <span class="mi">3</span><span class="p">)</span>
11969-
</pre></div>
11970-
11971-
</div>
11972-
</div>
11973-
</div></div></section><section>
11974-
<div class="cell border-box-sizing text_cell rendered">
11975-
<div class="prompt input_prompt">
11976-
</div>
11977-
<div class="inner_cell">
11978-
<div class="text_cell_render border-box-sizing rendered_html">
1197911974
<h1 id="But-I-like-my-neuorimaging-toolbox">But I like my neuorimaging toolbox<a class="anchor-link" href="#But-I-like-my-neuorimaging-toolbox">&#182;</a></h1><ul>
1198011975
<li>You can keep it! But instead of being stuck in MATLAB with SPM, or having scripting issues with FreeSurfer, ANTs or FSL,..</li>
1198111976
<li><strong>Nipype</strong> gives you the possibility to cherry-pick the algorithms that you prefer from many different sofware packages.</li>
@@ -11990,9 +11985,8 @@ <h1 id="But-I-like-my-neuorimaging-toolbox">But I like my neuorimaging toolbox<a
1199011985
</div>
1199111986
<div class="inner_cell">
1199211987
<div class="text_cell_render border-box-sizing rendered_html">
11993-
<h1 id="A-short-Example">A short Example<a class="anchor-link" href="#A-short-Example">&#182;</a></h1><p>Let's assume we want to do preprocessing that uses <strong>SPM</strong> for <em>motion correction</em>, <strong>FreeSurfer</strong> for <em>coregistration</em>, <strong>ANTS</strong> for <em>normalization</em> and <strong>FSL</strong> for <em>smoothing</em>. Normally this would be a hell of a mess. It would mean switching between multiple scripts in different programming languages with a lot of manual intervention.</p>
11994-
<p><strong>Nipype does all that for you! In parallel and in a very intuitive way!</strong></p>
11995-
<p><img src="../static/images/nipype_example_graph.png" width="750"></p>
11988+
<h1 id="A-short-Example">A short Example<a class="anchor-link" href="#A-short-Example">&#182;</a></h1><p>Let's assume we want to do preprocessing that uses <strong>SPM</strong> for <em>motion correction</em>, <strong>FreeSurfer</strong> for <em>coregistration</em>, <strong>ANTS</strong> for <em>normalization</em> and <strong>FSL</strong> for <em>smoothing</em>. Normally this would be a hell of a mess. It would mean switching between multiple scripts in different programming languages with a lot of manual intervention. <strong>Nipype comes to the rescue!</strong></p>
11989+
<p><img src="../static/images/nipype_example_graph.png" width="650"></p>
1199611990

1199711991
</div>
1199811992
</div>

static/images/example_ANTs.png

-121 KB
Binary file not shown.

0 commit comments

Comments
 (0)