|
42 | 42 | .remark-slide-content h3 { font-size: 1.2em; color: #324989; }
|
43 | 43 | .footnote {
|
44 | 44 | position: absolute;
|
45 |
| - bottom: 3em; |
| 45 | + bottom: 0.5em; |
46 | 46 | font-size: 0.7em;
|
| 47 | + left: 6em; |
47 | 48 | }
|
48 | 49 | li p { line-height: 1.25em; }
|
49 | 50 |
|
|
102 | 103 | .fa-solid {
|
103 | 104 | color: #324989;
|
104 | 105 | }
|
| 106 | + .fa-blank { |
| 107 | + color: #ffffff; |
| 108 | + } |
105 | 109 |
|
106 | 110 | em {
|
107 | 111 | color: #324989;
|
|
341 | 345 | .pad-left {
|
342 | 346 | padding-left: 2.0em;
|
343 | 347 | }
|
| 348 | + .install-cmd { |
| 349 | + top: 20px; |
| 350 | + position: absolute; |
| 351 | + right: 4em; |
| 352 | + } |
| 353 | + figure { |
| 354 | + display: block; |
| 355 | + margin-left: auto; |
| 356 | + margin-right: auto; |
| 357 | + font-size: 8pt; |
| 358 | + } |
| 359 | + figcaption { |
| 360 | + text-align: right; |
| 361 | + } |
344 | 362 |
|
345 | 363 | </style>
|
346 | 364 | </head>
|
|
437 | 455 | template: newsection
|
438 | 456 | name: BIDS
|
439 | 457 |
|
440 |
| ---- |
441 |
| - |
442 | 458 | # BIDS: Brain Imaging Data Structure
|
443 | 459 |
|
444 | 460 | .left-column2.small[
|
|
477 | 493 | ]
|
478 | 494 | ]
|
479 | 495 | .right-column2.larger[
|
| 496 | + |
480 | 497 | * BIDS is a directory structure, based on common practices
|
481 | 498 |
|
482 | 499 | * Builds on existing standards (NIfTI, JSON, TSV)
|
|
492 | 509 |
|
493 | 510 | ---
|
494 | 511 |
|
495 |
| -# BIDS: Brain Imaging Data Structure |
496 |
| - |
497 |
| -.left-column2.small[ |
498 |
| -.pad-left[ |
499 |
| -<i class="fa-solid fa-folder-open"></i> my_dataset/<br /> |
500 |
| -.pad-left[<i class="fa-solid fa-file-lines"></i> CHANGES]<br /> |
501 |
| -.pad-left[<i class="fa-solid fa-file-lines"></i> README]<br /> |
502 |
| -.pad-left[<i class="fa-solid fa-paperclip"></i> dataset_description.json]<br /> |
503 |
| -.pad-left[<i class="fa-solid fa-paperclip"></i> participants.json]<br /> |
504 |
| -.pad-left[<i class="fa-solid fa-table"></i> participants.tsv]<br /> |
505 |
| -.pad-left[<i class="fa-solid fa-paperclip"></i> scans.json]<br /> |
506 |
| -.pad-left[<i class="fa-solid fa-folder-open"></i> sub-11]<br /> |
507 |
| -.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> anat/]]<br /> |
508 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_T2w.json]]]<br /> |
509 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_T2w.nii.gz]]]<br /> |
510 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_acq-denoised_T1w.json]]]<br /> |
511 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_T1w.nii.gz]]]<br /> |
512 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_acq-mp2rage_T1w.json]]]<br /> |
513 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-mp2rage_T1w.nii.gz]]]<br /> |
514 |
| -.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> fmap/]]<br /> |
515 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_magnitude1.json]]]<br /> |
516 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_magnitude1.nii.gz]]]<br /> |
517 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_magnitude2.json]]]<br /> |
518 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_magnitude2.nii.gz]]]<br /> |
519 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_phasediff.json]]]<br /> |
520 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_phasediff.nii.gz]]]<br /> |
521 |
| -.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> func/]]<br /> |
522 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_task-mixed_bold.json]]]<br /> |
523 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_bold.nii.gz]]]<br /> |
524 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-table"></i> sub-11_task-mixed_events.tsv]]]<br /> |
525 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-paperclip"></i> sub-11_task-rest_bold.json]]]<br /> |
526 |
| -.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-rest_bold.nii.gz]]]<br /> |
527 |
| -.pad-left[.pad-left[<i class="fa-solid fa-table"></i> sub-11_scans.tsv]]<br /> |
528 |
| -.pad-left[<i class="fa-solid fa-folder"></i> sub-14]<br /> |
529 |
| -.pad-left[<i class="fa-solid fa-folder"></i> sub-15]<br /> |
530 |
| -] |
531 |
| -] |
532 | 512 | .right-column2[.no-bullet[* .larger[Basic metadata in the file names]
|
533 | 513 | * Subject, session, imaging modality, etc.
|
534 | 514 | * Generally just enough to assign unique names]]
|
|
545 | 525 | ]]
|
546 | 526 |
|
547 | 527 | ---
|
| 528 | +name: newsection |
| 529 | +layout: true |
548 | 530 |
|
549 |
| -# Converting from DICOM into BIDS |
| 531 | +.perma-sidebar[ |
| 532 | +<p class="rotate"> |
| 533 | +<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0; height: 20px; padding-top: 6px;" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a> |
| 534 | + <span style="padding-left: 10px; font-weight: 600;">Day 1 :: Brain Imaging Data Structure</span> |
| 535 | +</p> |
| 536 | +] |
| 537 | +--- |
550 | 538 |
|
| 539 | +# Converting from DICOM into BIDS |
551 | 540 |
|
552 | 541 | .left-column-mid.small[
|
553 | 542 | .pad-left[
|
|
847 | 836 | ]
|
848 | 837 |
|
849 | 838 | ---
|
| 839 | +template: newsection |
| 840 | +layout: true |
| 841 | +name: Derivatives |
| 842 | + |
| 843 | +# BIDS Derivatives |
| 844 | + |
| 845 | +--- |
| 846 | + |
| 847 | +BIDS Derivatives generally mirror the raw dataset. |
| 848 | + |
| 849 | +.small[ |
| 850 | +.pad-left[ |
| 851 | +<i class="fa-solid fa-folder-open"></i> fmriprep/<br /> |
| 852 | +.pad-left[<i class="fa-solid fa-file-lines"></i> README]<br /> |
| 853 | +.pad-left[<i class="fa-solid fa-circle-info"></i> dataset_description.json]<br /> |
| 854 | +.pad-left[<i class="fa-solid fa-folder-open"></i> sub-11]<br /> |
| 855 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> anat/]]<br /> |
| 856 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_desc-preproc_T2w.nii.gz]]]<br /> |
| 857 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_desc-preproc_T1w.nii.gz]]]<br /> |
| 858 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_desc-brain_mask.nii.gz]]]<br /> |
| 859 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5]]]<br /> |
| 860 | +.pad-left[.pad-left[.pad-left[<i class="fa-blank fa-brain"></i> ...]]]<br /> |
| 861 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> fmap/]]<br /> |
| 862 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-coeff_fieldmap.nii.gz]]]<br /> |
| 863 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-magnitude_fieldmap.nii.gz]]]<br /> |
| 864 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-preproc_fieldmap.nii.gz]]]<br /> |
| 865 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> func/]]<br /> |
| 866 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_desc-coreg_boldref.nii.gz]]]<br /> |
| 867 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_desc-hmc_boldref.nii.gz]]]<br /> |
| 868 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-file-lines"></i> sub-11_task-mixed_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt]]]<br /> |
| 869 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-file-lines"></i> sub-11_task-mixed_from-boldref_to-auto00000_mode-image_desc-fmapreg_xfm.txt]]]<br /> |
| 870 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt]]]<br /> |
| 871 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz]]]<br /> |
| 872 | +.pad-left[.pad-left[.pad-left[<i class="fa-blank fa-brain"></i> ...]]]<br /> |
| 873 | +.pad-left[<i class="fa-solid fa-folder"></i> sub-14]<br /> |
| 874 | +.pad-left[<i class="fa-solid fa-folder"></i> sub-15]<br /> |
| 875 | +] |
| 876 | +] |
| 877 | + |
| 878 | +-- |
| 879 | + |
| 880 | +New file suffixes, extensions and entities are possible. |
| 881 | + |
| 882 | +--- |
| 883 | +template: newsection |
| 884 | +layout: true |
| 885 | +name: PyBIDS |
| 886 | + |
| 887 | +.install-cmd[ |
| 888 | +```Bash |
| 889 | +pip install pybids |
| 890 | +``` |
| 891 | +] |
| 892 | + |
| 893 | +--- |
| 894 | + |
| 895 | +# PyBIDS |
| 896 | + |
| 897 | +A common specification of neuroimaging datasets affords queries for and |
| 898 | +adaptation to the available data. |
| 899 | + |
| 900 | +[PyBIDS](https://github.com/bids-standard/pybids/) is a Python library for |
| 901 | +querying and manipulating BIDS datasets. |
| 902 | + |
| 903 | + |
| 904 | +```Python |
| 905 | +>>> from bids import BIDSLayout |
| 906 | +>>> layout = BIDSLayout('/my_dataset') |
| 907 | +>>> bold = layout.get(subject='11', task='rest', suffix='bold', extension='.nii.gz') |
| 908 | +>>> bold |
| 909 | +[<BIDSImageFile filename='/my_dataset/sub-11/func/sub-11_task-rest_bold.nii.gz'>] |
| 910 | +>>> md = bold[0].get_metadata() |
| 911 | +>>> md['RepetitionTime'] |
| 912 | +1.5 |
| 913 | +>>> bold[0].get_entities() |
| 914 | +{'datatype': 'func', |
| 915 | + 'extension': '.nii.gz', |
| 916 | + 'subject': '11', |
| 917 | + 'suffix': 'bold', |
| 918 | + 'task': 'rest'} |
| 919 | +``` |
| 920 | + |
| 921 | +--- |
| 922 | + |
| 923 | +# PyBIDS - Derivatives |
| 924 | + |
| 925 | +PyBIDS layouts support BIDS derivatives: |
| 926 | + |
| 927 | +```Python |
| 928 | +>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep', config=['bids', 'derivatives'], validate=False) |
| 929 | +>>> spaces = fmri_derivs.get_spaces(desc='preproc', suffix='bold') |
| 930 | +>>> spaces |
| 931 | +['MNI152NLin2009cAsym'] |
| 932 | +``` |
| 933 | + |
| 934 | +-- |
| 935 | + |
| 936 | +It is also possible to provide your own config: |
| 937 | + |
| 938 | +```Python |
| 939 | +>>> import niworkflows |
| 940 | +>>> nipreps_config = niworkflows.data.load('nipreps.json') |
| 941 | +>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep, config=[nipreps_config], validate=False) |
| 942 | +``` |
| 943 | + |
| 944 | +--- |
| 945 | +template: newsection |
850 | 946 |
|
851 |
| -## Conclusion |
| 947 | +# Conclusion |
852 | 948 |
|
853 | 949 | .boxed-content[
|
854 | 950 | .distribute.large[
|
|
0 commit comments