Skip to content

Commit ced8dc7

Browse files
committed
FIX: separates the nilearn plotting of individual brains into separate cells
1 parent 9c646eb commit ced8dc7

File tree

4 files changed

+274
-96
lines changed

4 files changed

+274
-96
lines changed

notebooks/example_1stlevel.ipynb

Lines changed: 139 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,29 @@
431431
"outputs": [],
432432
"source": [
433433
"from nilearn.plotting import plot_stat_map\n",
434-
"anatimg = '/data/ds000114/sub-02/ses-test/anat/sub-02_ses-test_T1w.nii.gz'\n",
434+
"anatimg = '/data/ds000114/sub-02/ses-test/anat/sub-02_ses-test_T1w.nii.gz'"
435+
]
436+
},
437+
{
438+
"cell_type": "code",
439+
"execution_count": null,
440+
"metadata": {},
441+
"outputs": [],
442+
"source": [
435443
"plot_stat_map(\n",
436444
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0001.nii', title='average - fwhm=4',\n",
437-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)\n",
445+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
446+
]
447+
},
448+
{
449+
"cell_type": "code",
450+
"execution_count": null,
451+
"metadata": {},
452+
"outputs": [],
453+
"source": [
438454
"plot_stat_map(\n",
439455
" '/output/datasink/1stLevel/sub-02/fwhm-8/spmT_0001.nii', title='average - fwhm=8',\n",
440-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)"
456+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
441457
]
442458
},
443459
{
@@ -455,13 +471,29 @@
455471
"source": [
456472
"plot_stat_map(\n",
457473
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0002.nii', title='finger - fwhm=4',\n",
458-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)\n",
474+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
475+
]
476+
},
477+
{
478+
"cell_type": "code",
479+
"execution_count": null,
480+
"metadata": {},
481+
"outputs": [],
482+
"source": [
459483
"plot_stat_map(\n",
460484
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0003.nii', title='foot - fwhm=4',\n",
461-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)\n",
485+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
486+
]
487+
},
488+
{
489+
"cell_type": "code",
490+
"execution_count": null,
491+
"metadata": {},
492+
"outputs": [],
493+
"source": [
462494
"plot_stat_map(\n",
463495
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0004.nii', title='lips - fwhm=4',\n",
464-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)"
496+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
465497
]
466498
},
467499
{
@@ -479,13 +511,29 @@
479511
"source": [
480512
"plot_stat_map(\n",
481513
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0005.nii', title='finger - fwhm=4',\n",
482-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)\n",
514+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
515+
]
516+
},
517+
{
518+
"cell_type": "code",
519+
"execution_count": null,
520+
"metadata": {},
521+
"outputs": [],
522+
"source": [
483523
"plot_stat_map(\n",
484524
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0006.nii', title='foot - fwhm=4',\n",
485-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)\n",
525+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
526+
]
527+
},
528+
{
529+
"cell_type": "code",
530+
"execution_count": null,
531+
"metadata": {},
532+
"outputs": [],
533+
"source": [
486534
"plot_stat_map(\n",
487535
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0007.nii', title='lips - fwhm=4',\n",
488-
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1)"
536+
" bg_img=anatimg, threshold=3, display_mode='y', cut_coords=(-5, 0, 5, 10, 15), dim=-1);"
489537
]
490538
},
491539
{
@@ -506,43 +554,115 @@
506554
"plot_stat_map(\n",
507555
" '/output/datasink/1stLevel/sub-01/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-01',\n",
508556
" bg_img='/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz',\n",
509-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
557+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
558+
]
559+
},
560+
{
561+
"cell_type": "code",
562+
"execution_count": null,
563+
"metadata": {},
564+
"outputs": [],
565+
"source": [
510566
"plot_stat_map(\n",
511567
" '/output/datasink/1stLevel/sub-02/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-02',\n",
512568
" bg_img='/data/ds000114/sub-02/ses-test/anat/sub-02_ses-test_T1w.nii.gz',\n",
513-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
569+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
570+
]
571+
},
572+
{
573+
"cell_type": "code",
574+
"execution_count": null,
575+
"metadata": {},
576+
"outputs": [],
577+
"source": [
514578
"plot_stat_map(\n",
515579
" '/output/datasink/1stLevel/sub-03/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-03',\n",
516580
" bg_img='/data/ds000114/sub-03/ses-test/anat/sub-03_ses-test_T1w.nii.gz',\n",
517-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
581+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
582+
]
583+
},
584+
{
585+
"cell_type": "code",
586+
"execution_count": null,
587+
"metadata": {},
588+
"outputs": [],
589+
"source": [
518590
"plot_stat_map(\n",
519591
" '/output/datasink/1stLevel/sub-04/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-04',\n",
520592
" bg_img='/data/ds000114/sub-04/ses-test/anat/sub-04_ses-test_T1w.nii.gz',\n",
521-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
593+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
594+
]
595+
},
596+
{
597+
"cell_type": "code",
598+
"execution_count": null,
599+
"metadata": {},
600+
"outputs": [],
601+
"source": [
522602
"plot_stat_map(\n",
523603
" '/output/datasink/1stLevel/sub-05/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-05',\n",
524604
" bg_img='/data/ds000114/sub-05/ses-test/anat/sub-05_ses-test_T1w.nii.gz',\n",
525-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
605+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
606+
]
607+
},
608+
{
609+
"cell_type": "code",
610+
"execution_count": null,
611+
"metadata": {},
612+
"outputs": [],
613+
"source": [
526614
"plot_stat_map(\n",
527615
" '/output/datasink/1stLevel/sub-06/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-06',\n",
528616
" bg_img='/data/ds000114/sub-06/ses-test/anat/sub-06_ses-test_T1w.nii.gz',\n",
529-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
617+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
618+
]
619+
},
620+
{
621+
"cell_type": "code",
622+
"execution_count": null,
623+
"metadata": {},
624+
"outputs": [],
625+
"source": [
530626
"plot_stat_map(\n",
531627
" '/output/datasink/1stLevel/sub-07/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-07',\n",
532628
" bg_img='/data/ds000114/sub-07/ses-test/anat/sub-07_ses-test_T1w.nii.gz',\n",
533-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
629+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
630+
]
631+
},
632+
{
633+
"cell_type": "code",
634+
"execution_count": null,
635+
"metadata": {},
636+
"outputs": [],
637+
"source": [
534638
"plot_stat_map(\n",
535639
" '/output/datasink/1stLevel/sub-08/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-08',\n",
536640
" bg_img='/data/ds000114/sub-08/ses-test/anat/sub-08_ses-test_T1w.nii.gz',\n",
537-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
641+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
642+
]
643+
},
644+
{
645+
"cell_type": "code",
646+
"execution_count": null,
647+
"metadata": {},
648+
"outputs": [],
649+
"source": [
538650
"plot_stat_map(\n",
539651
" '/output/datasink/1stLevel/sub-09/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-09',\n",
540652
" bg_img='/data/ds000114/sub-09/ses-test/anat/sub-09_ses-test_T1w.nii.gz',\n",
541-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)\n",
653+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
654+
]
655+
},
656+
{
657+
"cell_type": "code",
658+
"execution_count": null,
659+
"metadata": {},
660+
"outputs": [],
661+
"source": [
542662
"plot_stat_map(\n",
543663
" '/output/datasink/1stLevel/sub-10/fwhm-4/spmT_0002.nii', title='finger - fwhm=4 - sub-10',\n",
544664
" bg_img='/data/ds000114/sub-10/ses-test/anat/sub-10_ses-test_T1w.nii.gz',\n",
545-
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1)"
665+
" threshold=3, display_mode='y', cut_coords=(5, 10, 15, 20), dim=-1);"
546666
]
547667
},
548668
{

0 commit comments

Comments
 (0)