Skip to content

Commit 52d6340

Browse files
committed
ENH: rerun notebooks with new output for newest docker image
1 parent 6225c79 commit 52d6340

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7364
-1589
lines changed

notebooks/basic_configuration.ipynb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": null,
49-
"metadata": {
50-
"collapsed": true
51-
},
48+
"execution_count": 1,
49+
"metadata": {},
5250
"outputs": [],
5351
"source": [
5452
"from nipype import config, logging\n",
@@ -84,10 +82,8 @@
8482
},
8583
{
8684
"cell_type": "code",
87-
"execution_count": null,
88-
"metadata": {
89-
"collapsed": true
90-
},
85+
"execution_count": 2,
86+
"metadata": {},
9187
"outputs": [],
9288
"source": [
9389
"from nipype import Workflow\n",
@@ -113,10 +109,8 @@
113109
},
114110
{
115111
"cell_type": "code",
116-
"execution_count": null,
117-
"metadata": {
118-
"collapsed": true
119-
},
112+
"execution_count": 3,
113+
"metadata": {},
120114
"outputs": [],
121115
"source": [
122116
"from nipype import Node\n",
@@ -145,7 +139,7 @@
145139
"name": "python",
146140
"nbconvert_exporter": "python",
147141
"pygments_lexer": "ipython3",
148-
"version": "3.5.2"
142+
"version": "3.6.2"
149143
}
150144
},
151145
"nbformat": 4,

notebooks/basic_data_input.ipynb

Lines changed: 159 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@
9393
},
9494
{
9595
"cell_type": "code",
96-
"execution_count": null,
97-
"metadata": {
98-
"collapsed": true
99-
},
96+
"execution_count": 1,
97+
"metadata": {},
10098
"outputs": [],
10199
"source": [
102100
"from nipype import DataGrabber, Node\n",
@@ -139,10 +137,8 @@
139137
},
140138
{
141139
"cell_type": "code",
142-
"execution_count": null,
143-
"metadata": {
144-
"collapsed": true
145-
},
140+
"execution_count": 2,
141+
"metadata": {},
146142
"outputs": [],
147143
"source": [
148144
"dg.inputs.template_args = {'anat': [['subject_id', 'ses_name']],\n",
@@ -158,10 +154,8 @@
158154
},
159155
{
160156
"cell_type": "code",
161-
"execution_count": null,
162-
"metadata": {
163-
"collapsed": true
164-
},
157+
"execution_count": 3,
158+
"metadata": {},
165159
"outputs": [],
166160
"source": [
167161
"dg.inputs.field_template = {'anat': 'sub-%02d/ses-%s/anat/*_T1w.nii.gz',\n",
@@ -184,10 +178,8 @@
184178
},
185179
{
186180
"cell_type": "code",
187-
"execution_count": null,
188-
"metadata": {
189-
"collapsed": true
190-
},
181+
"execution_count": 4,
182+
"metadata": {},
191183
"outputs": [],
192184
"source": [
193185
"# Using the IdentityInterface\n",
@@ -216,10 +208,8 @@
216208
},
217209
{
218210
"cell_type": "code",
219-
"execution_count": null,
220-
"metadata": {
221-
"collapsed": true
222-
},
211+
"execution_count": 5,
212+
"metadata": {},
223213
"outputs": [],
224214
"source": [
225215
"# Specifying the input fields of DataGrabber directly\n",
@@ -237,9 +227,30 @@
237227
},
238228
{
239229
"cell_type": "code",
240-
"execution_count": null,
230+
"execution_count": 6,
241231
"metadata": {},
242-
"outputs": [],
232+
"outputs": [
233+
{
234+
"name": "stdout",
235+
"output_type": "stream",
236+
"text": [
237+
"170904-06:02:02,387 workflow INFO:\n",
238+
"\t Executing node datagrabber in dir: /tmp/tmpiwew6ysu/datagrabber\n"
239+
]
240+
},
241+
{
242+
"data": {
243+
"text/plain": [
244+
"\n",
245+
"anat = /data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz\n",
246+
"func = /data/ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz"
247+
]
248+
},
249+
"execution_count": 6,
250+
"metadata": {},
251+
"output_type": "execute_result"
252+
}
253+
],
243254
"source": [
244255
"dg.run().outputs"
245256
]
@@ -268,10 +279,8 @@
268279
},
269280
{
270281
"cell_type": "code",
271-
"execution_count": null,
272-
"metadata": {
273-
"collapsed": true
274-
},
282+
"execution_count": 7,
283+
"metadata": {},
275284
"outputs": [],
276285
"source": [
277286
"from nipype import SelectFiles, Node\n",
@@ -302,9 +311,30 @@
302311
},
303312
{
304313
"cell_type": "code",
305-
"execution_count": null,
314+
"execution_count": 8,
306315
"metadata": {},
307-
"outputs": [],
316+
"outputs": [
317+
{
318+
"name": "stdout",
319+
"output_type": "stream",
320+
"text": [
321+
"170904-06:02:02,435 workflow INFO:\n",
322+
"\t Executing node selectfiles in dir: /tmp/tmpd3odxyze/selectfiles\n"
323+
]
324+
},
325+
{
326+
"data": {
327+
"text/plain": [
328+
"\n",
329+
"anat = /data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz\n",
330+
"func = /data/ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz"
331+
]
332+
},
333+
"execution_count": 8,
334+
"metadata": {},
335+
"output_type": "execute_result"
336+
}
337+
],
308338
"source": [
309339
"sf.run().outputs"
310340
]
@@ -324,9 +354,29 @@
324354
},
325355
{
326356
"cell_type": "code",
327-
"execution_count": null,
357+
"execution_count": 9,
328358
"metadata": {},
329-
"outputs": [],
359+
"outputs": [
360+
{
361+
"name": "stdout",
362+
"output_type": "stream",
363+
"text": [
364+
"170904-06:02:02,458 workflow INFO:\n",
365+
"\t Executing node selectfiles in dir: /tmp/tmp53bxb6rj/selectfiles\n"
366+
]
367+
},
368+
{
369+
"data": {
370+
"text/plain": [
371+
"\n",
372+
"anat = ['/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz', '/data/ds000114/sub-02/ses-test/anat/sub-02_ses-test_T1w.nii.gz']"
373+
]
374+
},
375+
"execution_count": 9,
376+
"metadata": {},
377+
"output_type": "execute_result"
378+
}
379+
],
330380
"source": [
331381
"from nipype import SelectFiles, Node\n",
332382
"from os.path import abspath as opap\n",
@@ -364,24 +414,43 @@
364414
"source": [
365415
"## FreeSurferSource\n",
366416
"\n",
367-
"`FreeSurferSource` is a specific case of a file grabber that felicitates the data import of outputs from the FreeSurfer recon-all algorithm. This of course requires that you've already run `recon-all` on your subject.\n",
368-
"\n",
369-
"Before you can run `FreeSurferSource`, you first have to specify the path to the FreeSurfer output folder, i.e. you have to specify the SUBJECTS_DIR variable. This can be done as follows:"
417+
"`FreeSurferSource` is a specific case of a file grabber that felicitates the data import of outputs from the FreeSurfer recon-all algorithm. This of course requires that you've already run `recon-all` on your subject."
418+
]
419+
},
420+
{
421+
"cell_type": "markdown",
422+
"metadata": {},
423+
"source": [
424+
"For the tutorial dataset ``ds000114``, `recon-all` was already run. So, let's make sure that you have the anatomy output of one subject on your system:"
370425
]
371426
},
372427
{
373428
"cell_type": "code",
374429
"execution_count": null,
375-
"metadata": {
376-
"collapsed": true
377-
},
430+
"metadata": {},
431+
"outputs": [],
432+
"source": [
433+
"!datalad get -r -J4 /data/ds000114/derivatives/freesurfer/sub-01/"
434+
]
435+
},
436+
{
437+
"cell_type": "markdown",
438+
"metadata": {},
439+
"source": [
440+
"Now, before you can run `FreeSurferSource`, you first have to specify the path to the FreeSurfer output folder, i.e. you have to specify the SUBJECTS_DIR variable. This can be done as follows:"
441+
]
442+
},
443+
{
444+
"cell_type": "code",
445+
"execution_count": 21,
446+
"metadata": {},
378447
"outputs": [],
379448
"source": [
380449
"from nipype.interfaces.freesurfer import FSCommand\n",
381450
"from os.path import abspath as opap\n",
382451
"\n",
383452
"# Path to your freesurfer output folder\n",
384-
"fs_dir = opap('/data/ds000114/derivatives/freesurfer')\n",
453+
"fs_dir = opap('/data/ds000114/derivatives/freesurfer/')\n",
385454
"\n",
386455
"# Set SUBJECTS_DIR\n",
387456
"FSCommand.set_default_subjects_dir(fs_dir)"
@@ -396,10 +465,8 @@
396465
},
397466
{
398467
"cell_type": "code",
399-
"execution_count": null,
400-
"metadata": {
401-
"collapsed": true
402-
},
468+
"execution_count": 22,
469+
"metadata": {},
403470
"outputs": [],
404471
"source": [
405472
"from nipype import Node\n",
@@ -419,9 +486,18 @@
419486
},
420487
{
421488
"cell_type": "code",
422-
"execution_count": null,
489+
"execution_count": 23,
423490
"metadata": {},
424-
"outputs": [],
491+
"outputs": [
492+
{
493+
"name": "stdout",
494+
"output_type": "stream",
495+
"text": [
496+
"170904-06:04:52,28 workflow INFO:\n",
497+
"\t Executing node fssource in dir: /tmp/tmpisu77m7r/fssource\n"
498+
]
499+
}
500+
],
425501
"source": [
426502
"fssource.inputs.subject_id = 'sub-01'\n",
427503
"result = fssource.run() "
@@ -436,9 +512,22 @@
436512
},
437513
{
438514
"cell_type": "code",
439-
"execution_count": null,
515+
"execution_count": 24,
440516
"metadata": {},
441-
"outputs": [],
517+
"outputs": [
518+
{
519+
"name": "stdout",
520+
"output_type": "stream",
521+
"text": [
522+
"aparc_aseg: ['/data/ds000114/derivatives/freesurfer/sub-01/mri/aparc+aseg.mgz', '/data/ds000114/derivatives/freesurfer/sub-01/mri/aparc.a2009s+aseg.mgz', '/data/ds000114/derivatives/freesurfer/sub-01/mri/aparc.dktatlas+aseg.mgz']\n",
523+
"\n",
524+
"brainmask: /data/ds000114/derivatives/freesurfer/sub-01/mri/brainmask.mgz\n",
525+
"\n",
526+
"inflated: ['/data/ds000114/derivatives/freesurfer/sub-01/surf/rh.inflated', '/data/ds000114/derivatives/freesurfer/sub-01/surf/lh.inflated']\n",
527+
"\n"
528+
]
529+
}
530+
],
442531
"source": [
443532
"print('aparc_aseg: %s\\n' % result.outputs.aparc_aseg)\n",
444533
"print('brainmask: %s\\n' % result.outputs.brainmask)\n",
@@ -454,9 +543,18 @@
454543
},
455544
{
456545
"cell_type": "code",
457-
"execution_count": null,
546+
"execution_count": 25,
458547
"metadata": {},
459-
"outputs": [],
548+
"outputs": [
549+
{
550+
"name": "stdout",
551+
"output_type": "stream",
552+
"text": [
553+
"170904-06:04:54,346 workflow INFO:\n",
554+
"\t Executing node fssource in dir: /tmp/tmpisu77m7r/fssource\n"
555+
]
556+
}
557+
],
460558
"source": [
461559
"fssource.inputs.hemi = 'lh'\n",
462560
"result = fssource.run()"
@@ -471,9 +569,20 @@
471569
},
472570
{
473571
"cell_type": "code",
474-
"execution_count": null,
572+
"execution_count": 26,
475573
"metadata": {},
476-
"outputs": [],
574+
"outputs": [
575+
{
576+
"data": {
577+
"text/plain": [
578+
"'/data/ds000114/derivatives/freesurfer/sub-01/surf/lh.inflated'"
579+
]
580+
},
581+
"execution_count": 26,
582+
"metadata": {},
583+
"output_type": "execute_result"
584+
}
585+
],
477586
"source": [
478587
"result.outputs.inflated"
479588
]
@@ -503,7 +612,7 @@
503612
"name": "python",
504613
"nbconvert_exporter": "python",
505614
"pygments_lexer": "ipython3",
506-
"version": "3.5.2"
615+
"version": "3.6.2"
507616
}
508617
},
509618
"nbformat": 4,

0 commit comments

Comments
 (0)