|
103 | 103 | .fa-solid {
|
104 | 104 | color: #324989;
|
105 | 105 | }
|
| 106 | + .fa-blank { |
| 107 | + color: #ffffff; |
| 108 | + } |
106 | 109 |
|
107 | 110 | em {
|
108 | 111 | color: #324989;
|
|
342 | 345 | .pad-left {
|
343 | 346 | padding-left: 2.0em;
|
344 | 347 | }
|
| 348 | + .install-cmd { |
| 349 | + top: 20px; |
| 350 | + position: absolute; |
| 351 | + right: 4em; |
| 352 | + } |
345 | 353 | figure {
|
346 | 354 | display: block;
|
347 | 355 | margin-left: auto;
|
|
732 | 740 | ]
|
733 | 741 |
|
734 | 742 | ---
|
| 743 | +template: newsection |
| 744 | +layout: true |
| 745 | +name: Derivatives |
| 746 | + |
| 747 | +# BIDS Derivatives |
| 748 | + |
| 749 | +--- |
| 750 | + |
| 751 | +BIDS Derivatives generally mirror the raw dataset. |
| 752 | + |
| 753 | +.small[ |
| 754 | +.pad-left[ |
| 755 | +<i class="fa-solid fa-folder-open"></i> fmriprep/<br /> |
| 756 | +.pad-left[<i class="fa-solid fa-file-lines"></i> README]<br /> |
| 757 | +.pad-left[<i class="fa-solid fa-circle-info"></i> dataset_description.json]<br /> |
| 758 | +.pad-left[<i class="fa-solid fa-folder-open"></i> sub-11]<br /> |
| 759 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> anat/]]<br /> |
| 760 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_desc-preproc_T2w.nii.gz]]]<br /> |
| 761 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_desc-preproc_T1w.nii.gz]]]<br /> |
| 762 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_acq-denoised_desc-brain_mask.nii.gz]]]<br /> |
| 763 | +.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 /> |
| 764 | +.pad-left[.pad-left[.pad-left[<i class="fa-blank fa-brain"></i> ...]]]<br /> |
| 765 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> fmap/]]<br /> |
| 766 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-coeff_fieldmap.nii.gz]]]<br /> |
| 767 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-magnitude_fieldmap.nii.gz]]]<br /> |
| 768 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_fmapid-auto00000_desc-preproc_fieldmap.nii.gz]]]<br /> |
| 769 | +.pad-left[.pad-left[<i class="fa-solid fa-folder-open"></i> func/]]<br /> |
| 770 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_desc-coreg_boldref.nii.gz]]]<br /> |
| 771 | +.pad-left[.pad-left[.pad-left[<i class="fa-solid fa-brain"></i> sub-11_task-mixed_desc-hmc_boldref.nii.gz]]]<br /> |
| 772 | +.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 /> |
| 773 | +.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 /> |
| 774 | +.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 /> |
| 775 | +.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 /> |
| 776 | +.pad-left[.pad-left[.pad-left[<i class="fa-blank fa-brain"></i> ...]]]<br /> |
| 777 | +.pad-left[<i class="fa-solid fa-folder"></i> sub-14]<br /> |
| 778 | +.pad-left[<i class="fa-solid fa-folder"></i> sub-15]<br /> |
| 779 | +] |
| 780 | +] |
| 781 | + |
| 782 | +-- |
| 783 | + |
| 784 | +New file suffixes, extensions and entities are possible. |
| 785 | + |
| 786 | +--- |
| 787 | +template: newsection |
| 788 | +layout: true |
| 789 | +name: PyBIDS |
| 790 | + |
| 791 | +.install-cmd[ |
| 792 | +```Bash |
| 793 | +pip install pybids |
| 794 | +``` |
| 795 | +] |
| 796 | + |
| 797 | +--- |
| 798 | + |
| 799 | +# PyBIDS |
| 800 | + |
| 801 | +A common specification of neuroimaging datasets affords queries for and |
| 802 | +adaptation to the available data. |
| 803 | + |
| 804 | +[PyBIDS](https://github.com/bids-standard/pybids/) is a Python library for |
| 805 | +querying and manipulating BIDS datasets. |
| 806 | + |
| 807 | + |
| 808 | +```Python |
| 809 | +>>> from bids import BIDSLayout |
| 810 | +>>> layout = BIDSLayout('/my_dataset') |
| 811 | +>>> bold = layout.get(subject='11', task='rest', suffix='bold', extension='.nii.gz') |
| 812 | +>>> bold |
| 813 | +[<BIDSImageFile filename='/my_dataset/sub-11/func/sub-11_task-rest_bold.nii.gz'>] |
| 814 | +>>> md = bold[0].get_metadata() |
| 815 | +>>> md['RepetitionTime'] |
| 816 | +1.5 |
| 817 | +>>> bold[0].get_entities() |
| 818 | +{'datatype': 'func', |
| 819 | + 'extension': '.nii.gz', |
| 820 | + 'subject': '11', |
| 821 | + 'suffix': 'bold', |
| 822 | + 'task': 'rest'} |
| 823 | +``` |
| 824 | + |
| 825 | +--- |
| 826 | + |
| 827 | +# PyBIDS - Derivatives |
| 828 | + |
| 829 | +PyBIDS layouts support BIDS derivatives: |
| 830 | + |
| 831 | +```Python |
| 832 | +>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep', config=['bids', 'derivatives'], validate=False) |
| 833 | +>>> spaces = fmri_derivs.get_spaces(desc='preproc', suffix='bold') |
| 834 | +>>> spaces |
| 835 | +['MNI152NLin2009cAsym'] |
| 836 | +``` |
| 837 | + |
| 838 | +-- |
| 839 | + |
| 840 | +It is also possible to provide your own config: |
| 841 | + |
| 842 | +```Python |
| 843 | +>>> import niworkflows |
| 844 | +>>> nipreps_config = niworkflows.data.load('nipreps.json') |
| 845 | +>>> fmri_derivs = BIDSLayout('/my_dataset-fmriprep, config=[nipreps_config], validate=False) |
| 846 | +``` |
| 847 | + |
| 848 | +--- |
| 849 | +template: newsection |
735 | 850 |
|
736 |
| -## Conclusion |
| 851 | +# Conclusion |
737 | 852 |
|
738 | 853 | .boxed-content[
|
739 | 854 | .distribute.large[
|
|
0 commit comments