From 8e90140e6a573acde4ecee4951a1cc38bac0be46 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 17 Jan 2024 09:13:30 -0500 Subject: [PATCH] Make CLI commands available as `cubids ` (#268) * Add linting job. * Run black and isort. * Keep working on formatting. * Forgot to install the linters... * Wrong code path. * Address style issues in cubids. * Address style issues in validator. * Update metadata_merge.py * Make cubids a command-line interface. * Add deprecation warnings. * Improve messages. * Fix help strings. * Further refactor the CLI workflows. * Work on failing test. * Update the CLIs. * Update config.yml * Move test data files. --- .circleci/config.yml | 2 +- BIDS_Dataset/README | 10 - BIDS_Dataset/dataset_description.json | 7 - .../anat/sub-01_ses-phdiff_T1w.json | 34 - .../anat/sub-01_ses-phdiff_T1w.nii.gz | Bin 123172 -> 0 bytes .../sub-01_ses-phdiff_acq-HASC55AP_dwi.bval | 1 - .../sub-01_ses-phdiff_acq-HASC55AP_dwi.bvec | 3 - .../sub-01_ses-phdiff_acq-HASC55AP_dwi.json | 75 -- .../sub-01_ses-phdiff_acq-HASC55AP_dwi.nii.gz | Bin 6084 -> 0 bytes .../sub-01_ses-phdiff_acq-v4_magnitude1.json | 67 -- ...sub-01_ses-phdiff_acq-v4_magnitude1.nii.gz | Bin 2107 -> 0 bytes .../sub-01_ses-phdiff_acq-v4_magnitude2.json | 68 -- ...sub-01_ses-phdiff_acq-v4_magnitude2.nii.gz | Bin 2107 -> 0 bytes .../sub-01_ses-phdiff_acq-v4_phasediff.json | 71 -- .../sub-01_ses-phdiff_acq-v4_phasediff.nii.gz | Bin 2106 -> 0 bytes .../fmap/sub-01_ses-phdiff_dir-PA_epi.json | 78 -- .../fmap/sub-01_ses-phdiff_dir-PA_epi.nii.gz | Bin 1502 -> 0 bytes .../sub-01_ses-phdiff_task-rest_bold.json | 77 -- .../sub-01_ses-phdiff_task-rest_bold.nii.gz | Bin 30889 -> 0 bytes .../anat/sub-02_ses-phdiff_T1w.json | 33 - .../anat/sub-02_ses-phdiff_T1w.nii.gz | Bin 123172 -> 0 bytes .../sub-02_ses-phdiff_acq-HASC55AP_dwi.bval | 1 - .../sub-02_ses-phdiff_acq-HASC55AP_dwi.bvec | 3 - .../sub-02_ses-phdiff_acq-HASC55AP_dwi.json | 76 -- .../sub-02_ses-phdiff_acq-HASC55AP_dwi.nii.gz | Bin 30889 -> 0 bytes .../sub-02_ses-phdiff_acq-v4_magnitude1.json | 67 -- ...sub-02_ses-phdiff_acq-v4_magnitude1.nii.gz | Bin 2107 -> 0 bytes .../sub-02_ses-phdiff_acq-v4_magnitude2.json | 68 -- ...sub-02_ses-phdiff_acq-v4_magnitude2.nii.gz | Bin 2107 -> 0 bytes .../sub-02_ses-phdiff_acq-v4_phasediff.json | 71 -- .../sub-02_ses-phdiff_acq-v4_phasediff.nii.gz | Bin 2106 -> 0 bytes .../fmap/sub-02_ses-phdiff_dir-PA_epi.json | 75 -- .../fmap/sub-02_ses-phdiff_dir-PA_epi.nii.gz | Bin 1502 -> 0 bytes .../sub-02_ses-phdiff_task-rest_bold.json | 75 -- .../sub-02_ses-phdiff_task-rest_bold.nii.gz | Bin 30889 -> 0 bytes .../anat/sub-03_ses-phdiff_T1w.json | 33 - .../anat/sub-03_ses-phdiff_T1w.nii.gz | Bin 123172 -> 0 bytes .../sub-03_ses-phdiff_acq-HASC55AP_dwi.bval | 1 - .../sub-03_ses-phdiff_acq-HASC55AP_dwi.bvec | 3 - .../sub-03_ses-phdiff_acq-HASC55AP_dwi.json | 74 -- .../sub-03_ses-phdiff_acq-HASC55AP_dwi.nii.gz | Bin 30889 -> 0 bytes .../sub-03_ses-phdiff_acq-v4_magnitude1.json | 67 -- ...sub-03_ses-phdiff_acq-v4_magnitude1.nii.gz | Bin 2107 -> 0 bytes .../sub-03_ses-phdiff_acq-v4_magnitude2.json | 68 -- ...sub-03_ses-phdiff_acq-v4_magnitude2.nii.gz | Bin 2107 -> 0 bytes .../sub-03_ses-phdiff_acq-v4_phasediff.json | 71 -- .../sub-03_ses-phdiff_acq-v4_phasediff.nii.gz | Bin 2106 -> 0 bytes .../fmap/sub-03_ses-phdiff_dir-PA_epi.json | 78 -- .../fmap/sub-03_ses-phdiff_dir-PA_epi.nii.gz | Bin 1502 -> 0 bytes .../sub-03_ses-phdiff_task-rest_bold.json | 76 -- .../sub-03_ses-phdiff_task-rest_bold.nii.gz | Bin 30889 -> 0 bytes .../anat/sub-04_ses-phdiff_T1w.json | 33 - .../anat/sub-04_ses-phdiff_T1w.nii.gz | Bin 123172 -> 0 bytes .../sub-04_ses-phdiff_acq-HASC55AP_dwi.bval | 1 - .../sub-04_ses-phdiff_acq-HASC55AP_dwi.bvec | 3 - .../sub-04_ses-phdiff_acq-HASC55AP_dwi.json | 75 -- .../sub-04_ses-phdiff_acq-HASC55AP_dwi.nii.gz | Bin 30889 -> 0 bytes .../sub-04_ses-phdiff_acq-v4_magnitude1.json | 67 -- ...sub-04_ses-phdiff_acq-v4_magnitude1.nii.gz | Bin 2107 -> 0 bytes .../sub-04_ses-phdiff_acq-v4_magnitude2.json | 68 -- ...sub-04_ses-phdiff_acq-v4_magnitude2.nii.gz | Bin 2107 -> 0 bytes .../sub-04_ses-phdiff_acq-v4_phasediff.json | 71 -- .../sub-04_ses-phdiff_acq-v4_phasediff.nii.gz | Bin 2106 -> 0 bytes .../fmap/sub-04_ses-phdiff_dir-PA_epi.json | 78 -- .../fmap/sub-04_ses-phdiff_dir-PA_epi.nii.gz | Bin 1502 -> 0 bytes .../sub-04_ses-phdiff_task-rest_bold.json | 76 -- .../sub-04_ses-phdiff_task-rest_bold.nii.gz | Bin 30889 -> 0 bytes cubids/cli.py | 939 ++++-------------- .../CuBIDS_Toy_Dataset_Curation}/no_ped.txt | 0 .../too_low_vols.txt | 0 .../v0_AcqGroupInfo.txt | 0 .../v0_AcqGrouping.csv | 0 .../CuBIDS_Toy_Dataset_Curation}/v0_files.csv | 0 .../v0_summary.csv | 0 .../v0_validation.csv | 0 .../v1_AcqGroupInfo.txt | 0 .../v1_AcqGrouping.csv | 0 .../CuBIDS_Toy_Dataset_Curation}/v1_files.csv | 0 .../v1_summary.csv | 0 .../v2_AcqGroupInfo.txt | 0 .../v2_AcqGrouping.csv | 0 .../CuBIDS_Toy_Dataset_Curation}/v2_files.csv | 0 .../v2_full_cmd.sh | 0 .../v2_summary.csv | 0 cubids/tests/test_bond.py | 5 +- cubids/utils.py | 16 + cubids/workflows.py | 900 +++++++++++++++++ docs/usage.rst | 132 +-- pyproject.toml | 23 +- 89 files changed, 1180 insertions(+), 2740 deletions(-) delete mode 100644 BIDS_Dataset/README delete mode 100644 BIDS_Dataset/dataset_description.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bval delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bvec delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_magnitude1.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_magnitude1.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_magnitude2.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_magnitude2.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_phasediff.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_acq-v4_phasediff.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.nii.gz delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/func/sub-01_ses-phdiff_task-rest_bold.json delete mode 100644 BIDS_Dataset/sub-01/ses-phdiff/func/sub-01_ses-phdiff_task-rest_bold.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/anat/sub-02_ses-phdiff_T1w.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/anat/sub-02_ses-phdiff_T1w.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bval delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bvec delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_magnitude1.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_magnitude1.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_magnitude2.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_magnitude2.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_phasediff.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_acq-v4_phasediff.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_dir-PA_epi.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_dir-PA_epi.nii.gz delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.json delete mode 100644 BIDS_Dataset/sub-02/ses-phdiff/func/sub-02_ses-phdiff_task-rest_bold.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/anat/sub-03_ses-phdiff_T1w.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/anat/sub-03_ses-phdiff_T1w.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bval delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bvec delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_magnitude1.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_magnitude1.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_magnitude2.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_magnitude2.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_phasediff.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_acq-v4_phasediff.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.nii.gz delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/func/sub-03_ses-phdiff_task-rest_bold.json delete mode 100644 BIDS_Dataset/sub-03/ses-phdiff/func/sub-03_ses-phdiff_task-rest_bold.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/anat/sub-04_ses-phdiff_T1w.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/anat/sub-04_ses-phdiff_T1w.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bval delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bvec delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_magnitude1.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_magnitude1.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_magnitude2.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_magnitude2.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_phasediff.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_acq-v4_phasediff.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.nii.gz delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/func/sub-04_ses-phdiff_task-rest_bold.json delete mode 100644 BIDS_Dataset/sub-04/ses-phdiff/func/sub-04_ses-phdiff_task-rest_bold.nii.gz rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/no_ped.txt (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/too_low_vols.txt (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v0_AcqGroupInfo.txt (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v0_AcqGrouping.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v0_files.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v0_summary.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v0_validation.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v1_AcqGroupInfo.txt (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v1_AcqGrouping.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v1_files.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v1_summary.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v2_AcqGroupInfo.txt (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v2_AcqGrouping.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v2_files.csv (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v2_full_cmd.sh (100%) rename {CuBIDS_Toy_Dataset_Curation => cubids/tests/data/CuBIDS_Toy_Dataset_Curation}/v2_summary.csv (100%) create mode 100644 cubids/utils.py create mode 100644 cubids/workflows.py diff --git a/.circleci/config.yml b/.circleci/config.yml index bde4a4bb3..b51a9a08b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,7 @@ jobs: deploy_pypi: machine: - image: circleci/classic:201711-01 + image: ubuntu-2004:202201-02 working_directory: /tmp/src/CuBIDS steps: - checkout: diff --git a/BIDS_Dataset/README b/BIDS_Dataset/README deleted file mode 100644 index f96d811a8..000000000 --- a/BIDS_Dataset/README +++ /dev/null @@ -1,10 +0,0 @@ -Heavily downsampled CS-DSI testing datasets - -This data has had some parameters changed so that there are different -parameter groups in the same key groups. - -## Changes - - - sub-01_ses-phdiff_acq-HASC55AP_dwi: EchoTime set to 0.04 from 0.089 - - sub-02_ses-phdiff_task-rest_bold: Fieldmap has been removed - - sub-03_ses-phdiff_task-rest_bold: FlipAngle set to 70 from 90 diff --git a/BIDS_Dataset/dataset_description.json b/BIDS_Dataset/dataset_description.json deleted file mode 100644 index 9ee88dbcc..000000000 --- a/BIDS_Dataset/dataset_description.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "BIDSVersion": "1.0.0", - "License": "BSD 3-clause", - "Name": "Heavily downsampled CS-DSI simulated data", - "ReferencesAndLinks": [], - "Authors": ["PennLINC", "PennBBL"] -} diff --git a/BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.json b/BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.json deleted file mode 100644 index b8005d8af..000000000 --- a/BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Manufacturer": "Siemens", - "ManufacturersModelName": "Prisma_fit", - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "DeviceSerialNumber": "167024", - "SoftwareVersions": "syngo_MR_E11", - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "ScanningSequence": "GR_IR", - "SequenceVariant": "SK_SP_MP", - "SeriesDescription": "ABCD_T1w_MPR_vNav", - "BodyPartExamined": "BRAIN", - "ProtocolName": "ABCD_T1w_MPR_vNav", - "PatientName": "John Doe", - "SequenceName": "tfl3d1_16ns", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "M", - "ND", - "NORM" - ], - "AcquisitionTime": "16:15:31.770000", - "MagneticFieldStrength": 3, - "FlipAngle": 8, - "EchoTime": 0.0029, - "RepetitionTime": 2.5, - "InversionTime": 1.07, - "PhaseEncodingLines": 256, - "PhaseEncodingDirection": "i-", - "ConversionSoftware": "dcm2niix", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0" -} diff --git a/BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.nii.gz b/BIDS_Dataset/sub-01/ses-phdiff/anat/sub-01_ses-phdiff_T1w.nii.gz deleted file mode 100644 index 5dd2f5e700903dca2315324c96b97e7dde443f0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123172 zcmeI)Z&b~99Ki83)FGAmlRvAN#6W7Z-Fs_MXw$f(&DCm} z#==Z0RxM>$l1iEuN#Q2eT;kSrtJzh$J3QI*J+QO0_wUj7+3%e1_w)KZe49)4^>>=2 z2Iy+zMZxoyu6ldbvVeGD{Ja=pO!UT}xB&0BBvw)3;X0~o9V@4=enscDw|u9)%Q-_6 zpU558o7BHt*|)u^@DsOXp%V*=i`~w8Ej?#(Pd{}b5&Bma?6c!#dqbEaoR(J1-&D@|BNzKa&<-6kB$3dCO+-^u&21cG0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fu*Gz-@v|0? zjyg5+rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo z6rcbFC_n)U{+9|ysG7DuZvlO--7w3-fgBAHq^+!i|K%#+-PwL@KNO$<1t>rP3Q&Lo z6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)U zP=Epypa2CZKmiI+fC3bt00k&O0SZunf`3!N`t;qSp2dJhYy2{T17?Pt-7?~((FRj& z0y%IAOacl}fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+ hfC3bt00k&O0SZun0u=mL6a-Gyx1R2#A2>gM#9vW>2$KK+ diff --git a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bval b/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bval deleted file mode 100644 index b0e700029..000000000 --- a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bval +++ /dev/null @@ -1 +0,0 @@ -0 0 2000 3780 3800 4380 2195 2205 4200 3570 diff --git a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bvec b/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bvec deleted file mode 100644 index 14ebd3001..000000000 --- a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.bvec +++ /dev/null @@ -1,3 +0,0 @@ -0 0 0.947306 -0.689491 -0.687391 -0.640236 0.904801 0.301134 0.218033 0.236237 -0 0 -0.320301 -0.233031 0.690471 -0.429664 -0.305819 -0.906545 0.874886 0.239537 -0 0 -0.00426696 -0.685783 -0.225265 -0.636779 -0.296327 -0.295796 -0.432477 -0.941708 \ No newline at end of file diff --git a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.json b/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.json deleted file mode 100644 index f6cf3ab19..000000000 --- a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "SeriesDescription": "ABCD_dMRI", - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j", - "SoftwareVersions": "syngo_MR_E11" -} diff --git a/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.nii.gz b/BIDS_Dataset/sub-01/ses-phdiff/dwi/sub-01_ses-phdiff_acq-HASC55AP_dwi.nii.gz deleted file mode 100644 index 78b43ef68f096cd1ce601a4c15b5cf31398ed044..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6084 zcmeIx|5MTj0LF2*>Z+TSHJ7b6@iKKM0Zl6m338>RElgXe5Pnz0P(%WfK-)@mGjknU z+Cob+wPc)Hrh=L+bV}+l$^3#wOqrsfC@Lth{T;i{Z_m%~dtRWtEnB)-#Mq5CIwKZx z=-ViI0v(c;6i-e}jEae)K~DRfKY8Sc-?^xG78#mKCfm&o&0+Tqe`yyjDvUZ^#NO)K zGGKl0fQ)%OfphgJevLmAF-kd|IT^Z)y>~`iN8-Ky6?)h|AII)o zzNyhl^cj66YIPRpLUV`Llkpl3(R7rv+cT;+auKeqS*I~SC@X>{hx91U<26tgub0yv zYC7-cXw1G#K8rf|7CB)9&$jQ-laIe@G(c@{Zsq8my2f+VQZJ!?$!tnkO+kV!N|0xf zuWIl*M&r>XhgsxT(hy_o?rmWfclJ`6%Fo=S>|yh}ljdhB10dKbc~cgraNG8>GUsKu z(;w5deD~47JJ$L732Q=qBOI9|8H=>ZVw;{R5i^bTs^RV{^twhStC9(?9r`F&3 zt6Y2$UkfNu9t;*xMH20<*s&91+Qf&8zAMJ&qB$XBbRVDT9dIZ0bSl-Whu6wa>*nLC z#H{(acjMZlRgyXF4r-NYImoPISeH zsv4~mNDw;AnH&vuJm6`=&_J}0F1Xx-TvgX{&*A_Bm9_O@u^xU&rlk2=Gy-wFKY4|B zy`$BMT2UERVU>SC;!Cp$Y%an~ZvHbm1LJGiWZcRfC32(%xDQ-Ut755Q+?k;^Y6zSkAB#p6UwLda)}H6ytrB$poQtHqcwy zGr$~at#lCzJI8U}Yd(Ec;~hdx_)a<)vi4GOG&nIOlaJWW*yw{q#u28lGCPk^zK2g%F^W(xuN8~m&}Xy4$} zXte%;g2HO(%WROd$C3-Tg%EOasVCAeb4J92onf+x)aN8==L(JlK`J9fT&|qZD=638 zNGIw0J&$0g{P9_t_ZTbnLR=h`b%*s0;&RV?=>-?c;)aZb06XQUnqQXYBYNm*tE92=6*+t>qG(EU^x&0*1;O3 z3>D@;dnN?AqH1G@7M3{<(lU{OxG5PCtS+Mck}lIi4W2qezxK8xP5a!d-z%~dQxY5s zQ9GH23~YBPH}K+Em`p~DfEjMe%u^bzKPphQhw2z6U65u~()txul>4$Gsm$oD`J zm2M7>=|F2TC7`;k&>B~7N3}0s9Rm2M7>=|F2TC7`;k&>B~7N3}0s9Rm2M7>=|F2TC7`;k&>B~7N3}0s9RDUQBq?@L!gABw94X#E=vqVy&N0oy`B80SbgsO8&A3m z&s*m15;|Lb&DFW>?W2q8=QrJ5e9miG_NHe!kH7r<^}6`)*RAVQ^=x%g-`dLMy}TC7 ycU?=xp@D&siG@QzVU#f%2%{-sG#8BKg3(+snhORt7yR>n!1~whnC^pfYzzP;q$FJc diff --git a/BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.json b/BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.json deleted file mode 100644 index 6fd8eefc8..000000000 --- a/BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "SeriesDescription": "ABCD_dMRI", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j-", - "SoftwareVersions": "syngo_MR_E11", - "IntendedFor": [ - "ses-phdiff/func/sub-01_ses-phdiff_task-rest_bold.nii.gz" - ] -} diff --git a/BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.nii.gz b/BIDS_Dataset/sub-01/ses-phdiff/fmap/sub-01_ses-phdiff_dir-PA_epi.nii.gz deleted file mode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sicrP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+fC3bt z00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=JEJ6`WYAr~51hvIxJ)Q|{~ zp#TLaKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+ zfC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZK*0-Fu*Gz-@v|0? zjyg5+rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo z6rcbFC_n)U{+9|ysG7DuZvlO--7w3-fgBAHq^+!i|K%#+-PwL@KNO$<1t>rP3Q&Lo z6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)U zP=Epypa2CZKmiI+fC3bt00k&O0SZunf`3!N`t;qSp2dJhYy2{T17?Pt-7?~((FRj& z0y%IAOacl}fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+ hfC3bt00k&O0SZun0u=mL6a-Gyx1R2#A2>gM#9vW>2$KK+ diff --git a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bval b/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bval deleted file mode 100644 index 551603c53..000000000 --- a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bval +++ /dev/null @@ -1 +0,0 @@ -0 0 2000 3780 3800 4380 2195 2205 4200 3570 1005 2800 3790 3390 0 3605 3980 2575 3605 4195 3570 4175 3385 3395 4185 2395 4985 0 1800 1800 3780 1610 4000 4170 1190 2785 3215 200 1985 3980 0 3385 4385 4955 395 3975 3390 3965 3395 205 3385 4385 5015 990 1800 1010 1190 2605 2195 4380 0 \ No newline at end of file diff --git a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bvec b/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bvec deleted file mode 100644 index d31e09213..000000000 --- a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.bvec +++ /dev/null @@ -1,3 +0,0 @@ -0 0 0.947306 -0.689491 -0.687391 -0.640236 0.904801 0.301134 0.218033 0.236237 -0.00045876 -0.267232 -0.229644 0.727918 0 -0.235344 -0.895859 0.556585 -0.235344 -0.872345 0.236237 0.218536 -0.485657 -0.969313 0.873651 0.577663 0.999993 0 -0.665829 0.665829 -0.689491 0.704677 -0.00022427 -0.437403 0.409502 0.26769 -0.00031134 0.999772 -0.00016233 0.895859 0 0.971029 0.426584 0 -0.712479 -0.00011346 -0.727918 -0.448521 -0.484877 -0.00487633 -0.485657 -0.426584 -0.00019956 -0.00045946 0.665829 -0.445079 0.409502 -0.830354 -0.904801 0.640236 0 -0 0 -0.320301 -0.233031 0.690471 -0.429664 -0.305819 -0.906545 0.874886 0.239537 0.898412 0.804939 0.691594 0.488404 0 -0.943991 -0.00303821 -0.00388069 0.943991 -0.439269 -0.239537 0.439998 0.488955 -0.245811 0.221429 -0.581525 -0.00280889 0 0.670455 -0.670455 0.233031 -0.709514 -0.896432 0.221712 -0.414997 -0.538836 -0.999995 -0.0151408 0.32154 -0.00303821 0 -0.00329842 0.642719 -0.00262411 -0.0090312 -0.450857 0.488404 -0.00293403 -0.730564 -0.999882 -0.488955 -0.642719 -0.999997 -0.454441 0.670455 -0.895473 0.414997 -0.557225 -0.305819 -0.429664 0 -0 0 -0.00426696 -0.685783 -0.225265 -0.636779 -0.296327 -0.295796 -0.432477 -0.941708 -0.439154 -0.529773 -0.684807 -0.481245 0 -0.231289 -0.444328 -0.830781 -0.231289 -0.214611 -0.941708 -0.871001 -0.724611 -0.00307126 -0.433248 -0.57283 -0.00260781 0 -0.327355 -0.327355 -0.685783 -0.00439859 -0.443181 -0.871506 -0.812457 -0.798748 -0.00311231 -0.0150655 -0.946896 -0.444328 0 -0.238939 -0.636348 -0.999997 -0.701635 -0.892596 -0.481245 -0.893768 -0.480802 -0.014558 -0.724611 -0.636348 -0.00259323 -0.890777 -0.327355 -0.00576167 -0.812457 -0.00362001 -0.296327 -0.636779 0 diff --git a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.json b/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.json deleted file mode 100644 index 93b5ceb5f..000000000 --- a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "FlipAngle": 90, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "PatientName": "Jane Doe", - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "SeriesDescription": "ABCD_dMRI", - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.07, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j", - "SoftwareVersions": "syngo_MR_E11" -} diff --git a/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.nii.gz b/BIDS_Dataset/sub-02/ses-phdiff/dwi/sub-02_ses-phdiff_acq-HASC55AP_dwi.nii.gz deleted file mode 100644 index af8d3e5ac63c7935741be9a94f6df8164219aaec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30889 zcmeIx_fr!F90hQ!iXh7lKt!Ml#VQwqwGa%!$VR}#jjRNbDHxUn0+M)o2b`>mqC_xw zPy{7m$Oto1bFy~?WD7A+BVmOdNZS9PKlkqYetJK@dmp`I1%-#2G~#!%$S5C#&1Kum z=ZKMhk%+KB-ynZ~;*Fc(2uG{SHm0Ul7l^*mLB^z@Ai23A5l(wpOU}FW3DGe#R#D$Q zh!IO&~a{g%K#fb#y8?CMoD(5h%yuHiChrkz2oeKK(_GRTslcK?W1;KMriuUez0 z7^Py)?CF5CbeZ(3K%=83wsg6r9W_oC$(V>{C<8J0q;(^$oZAMwVBTX$52~b7)$! zw39jfwa>&7t&6%xR^>0SO{T@2KJ1bv!BQm=W4R5~gR6vGyZW8*CrpR%)hS^!*B#;X zW~mvQH!>At@-?^Nw63jl;_SkNL-BBMkoj}vSA7-s?Ap5LR6V3#F6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--- a/BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_dir-PA_epi.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "SeriesDescription": "ABCD_dMRI", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j-", - "SoftwareVersions": "syngo_MR_E11" -} diff --git a/BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_dir-PA_epi.nii.gz b/BIDS_Dataset/sub-02/ses-phdiff/fmap/sub-02_ses-phdiff_dir-PA_epi.nii.gz deleted file mode 100644 index b60186d5ad8b1173eaee849a5a828e70f4aedc66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1502 zcmeIu`8V4K004094on?mM&s%_gx1lPHE|_qSIa8P=qpl38VwpzN7Ap5XtJlz8I z%L|5xBd%JT)|EQKP*%J~%`%coQjMU9FeJ@V?El!?Z=at(E({ZsQad{4=phM6_P%iC z;uQpjltS{(PRY*7z!EVyJkk5dFic7|-X{}}H&XwVNCI88H@f~%{(=q1f|aX9(I@=H z&zk`=USf4wWT;aF$Ehkb25hq+6OQ{_CDvo^wQG^|_}QllG~&e#2h zf)Fd_I~EMROcJ+f?wYTy z*-!L%ed@c}Rk`c~C$IehPrVIY4}l#gU($Pkfct%T&DQn2c}aq4#cWtXjO0+O&B7GW z4_o8&{%|~IW~_iGnj#$#0ygh1>)kT zqZ~g|{f#}>so3MC6>ST5z!^;%@|#caL|MF6dO39&>L*5d5~=L)t6LjAYb;s=+r^T? znTayY@hv;Fs}=WJ_ofhCv!VvEZzB zYUSc;dvQ)@Ur#wL)+hCM&hE|kU2sQZPO?Dvj0F_8K#Ya*m*8od*M2a;#nu8fUHdIz zHewOFew*47l>-{wx?Q<{t%lhOUE4$5mnubA%Dl6H(Vg0jCb*ByOen+8IFmb)1qv8V z1r6CqDH1}}j=JSAI%ohk)Y%$cI@#{fGe2Fc}_OiY;K@@?Fjl*E*N<;TjuaknG)uNJYgaied zeU<-^Q}V5Ibu3CF`@C*Vj62=tliKhzGc&P}NA=I( zRxdI3;opH~Gp8VPf6t^>s-DmV+W!8>V!=w2%|9F%|4%|bfOgd{M@gkf0sB-9tU+(5^qfF{8wDBb$Db_iBTk|-3Yhs==%8$lK0+WX|ab2~u&E0Iji zu$D6&n9U)@*4462z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un0u-PC1t>rP3Q&Lo6rcbFC_n)U zP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZ zKmiI+fC3bt00k&O0SZunf)}JfM||Jyc?;-*wsicrP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+fC3bt z00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=JEJ6`WYAr~51hvIxJ)Q|{~ zp#TLaKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+ zfC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZK*0-Fu*Gz-@v|0? zjyg5+rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo z6rcbFC_n)U{+9|ysG7DuZvlO--7w3-fgBAHq^+!i|K%#+-PwL@KNO$<1t>rP3Q&Lo z6rcbFC_n)UP=Epypa2CZKmiI+fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)U zP=Epypa2CZKmiI+fC3bt00k&O0SZunf`3!N`t;qSp2dJhYy2{T17?Pt-7?~((FRj& z0y%IAOacl}fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rcbFC_n)UP=Epypa2CZKmiI+ hfC3bt00k&O0SZun0u=mL6a-Gyx1R2#A2>gM#9vW>2$KK+ diff --git a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bval b/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bval deleted file mode 100644 index 551603c53..000000000 --- a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bval +++ /dev/null @@ -1 +0,0 @@ -0 0 2000 3780 3800 4380 2195 2205 4200 3570 1005 2800 3790 3390 0 3605 3980 2575 3605 4195 3570 4175 3385 3395 4185 2395 4985 0 1800 1800 3780 1610 4000 4170 1190 2785 3215 200 1985 3980 0 3385 4385 4955 395 3975 3390 3965 3395 205 3385 4385 5015 990 1800 1010 1190 2605 2195 4380 0 \ No newline at end of file diff --git a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bvec b/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bvec deleted file mode 100644 index d31e09213..000000000 --- a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.bvec +++ /dev/null @@ -1,3 +0,0 @@ -0 0 0.947306 -0.689491 -0.687391 -0.640236 0.904801 0.301134 0.218033 0.236237 -0.00045876 -0.267232 -0.229644 0.727918 0 -0.235344 -0.895859 0.556585 -0.235344 -0.872345 0.236237 0.218536 -0.485657 -0.969313 0.873651 0.577663 0.999993 0 -0.665829 0.665829 -0.689491 0.704677 -0.00022427 -0.437403 0.409502 0.26769 -0.00031134 0.999772 -0.00016233 0.895859 0 0.971029 0.426584 0 -0.712479 -0.00011346 -0.727918 -0.448521 -0.484877 -0.00487633 -0.485657 -0.426584 -0.00019956 -0.00045946 0.665829 -0.445079 0.409502 -0.830354 -0.904801 0.640236 0 -0 0 -0.320301 -0.233031 0.690471 -0.429664 -0.305819 -0.906545 0.874886 0.239537 0.898412 0.804939 0.691594 0.488404 0 -0.943991 -0.00303821 -0.00388069 0.943991 -0.439269 -0.239537 0.439998 0.488955 -0.245811 0.221429 -0.581525 -0.00280889 0 0.670455 -0.670455 0.233031 -0.709514 -0.896432 0.221712 -0.414997 -0.538836 -0.999995 -0.0151408 0.32154 -0.00303821 0 -0.00329842 0.642719 -0.00262411 -0.0090312 -0.450857 0.488404 -0.00293403 -0.730564 -0.999882 -0.488955 -0.642719 -0.999997 -0.454441 0.670455 -0.895473 0.414997 -0.557225 -0.305819 -0.429664 0 -0 0 -0.00426696 -0.685783 -0.225265 -0.636779 -0.296327 -0.295796 -0.432477 -0.941708 -0.439154 -0.529773 -0.684807 -0.481245 0 -0.231289 -0.444328 -0.830781 -0.231289 -0.214611 -0.941708 -0.871001 -0.724611 -0.00307126 -0.433248 -0.57283 -0.00260781 0 -0.327355 -0.327355 -0.685783 -0.00439859 -0.443181 -0.871506 -0.812457 -0.798748 -0.00311231 -0.0150655 -0.946896 -0.444328 0 -0.238939 -0.636348 -0.999997 -0.701635 -0.892596 -0.481245 -0.893768 -0.480802 -0.014558 -0.724611 -0.636348 -0.00259323 -0.890777 -0.327355 -0.00576167 -0.812457 -0.00362001 -0.296327 -0.636779 0 diff --git a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.json b/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.json deleted file mode 100644 index a80710114..000000000 --- a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "SeriesDescription": "ABCD_dMRI", - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j", - "SoftwareVersions": "syngo_MR_E11" -} \ No newline at end of file diff --git a/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.nii.gz b/BIDS_Dataset/sub-03/ses-phdiff/dwi/sub-03_ses-phdiff_acq-HASC55AP_dwi.nii.gz deleted file mode 100644 index af8d3e5ac63c7935741be9a94f6df8164219aaec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30889 zcmeIx_fr!F90hQ!iXh7lKt!Ml#VQwqwGa%!$VR}#jjRNbDHxUn0+M)o2b`>mqC_xw zPy{7m$Oto1bFy~?WD7A+BVmOdNZS9PKlkqYetJK@dmp`I1%-#2G~#!%$S5C#&1Kum z=ZKMhk%+KB-ynZ~;*Fc(2uG{SHm0Ul7l^*mLB^z@Ai23A5l(wpOU}FW3DGe#R#D$Q zh!IO&~a{g%K#fb#y8?CMoD(5h%yuHiChrkz2oeKK(_GRTslcK?W1;KMriuUez0 z7^Py)?CF5CbeZ(3K%=83wsg6r9W_oC$(V>{C<8J0q;(^$oZAMwVBTX$52~b7)$! zw39jfwa>&7t&6%xR^>0SO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-03_ses-phdiff_dir-PA_epi.json b/BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.json deleted file mode 100644 index c000ebb6c..000000000 --- a/BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "SeriesDescription": "ABCD_dMRI", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j-", - "SoftwareVersions": "syngo_MR_E11", - "IntendedFor": [ - "ses-phdiff/func/sub-03_ses-phdiff_task-rest_bold.nii.gz" - ] -} diff --git a/BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.nii.gz b/BIDS_Dataset/sub-03/ses-phdiff/fmap/sub-03_ses-phdiff_dir-PA_epi.nii.gz deleted file mode 100644 index b60186d5ad8b1173eaee849a5a828e70f4aedc66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1502 zcmeIu`8V4K004094on?mM&s%_gx1lPHE|_qSIa8P=qpl38VwpzN7Ap5XtJlz8I z%L|5xBd%JT)|EQKP*%J~%`%coQjMU9FeJ@V?El!?Z=at(E({ZsQad{4=phM6_P%iC z;uQpjltS{(PRY*7z!EVyJkk5dFic7|-X{}}H&XwVNCI88H@f~%{(=q1f|aX9(I@=H z&zk`=USf4wWT;aF$Ehkb25hq+6OQ{_CDvo^wQG^|_}QllG~&e#2h zf)Fd_I~EMROcJ+f?wYTy z*-!L%ed@c}Rk`c~C$IehPrVIY4}l#gU($Pkfct%T&DQn2c}aq4#cWtXjO0+O&B7GW z4_o8&{%|~IW~_iGnj#$#0ygh1>)kT zqZ~g|{f#}>so3MC6>ST5z!^;%@|#caL|MF6dO39&>L*5d5~=L)t6LjAYb;s=+r^T? znTayY@hv;Fs}=WJ_ofhCv!VvEZzB zYUSc;dvQ)@Ur#wL)+hCM&hE|kU2sQZPO?Dvj0F_8K#Ya*m*8od*M2a;#nu8fUHdIz zHewOFew*47l>-{wx?Q<{t%lhOUE4$5mnubA%Dl6H(Vg0jCb*ByOen+8IFmb)1qv8V z1r6CqDH1}}j=JSAI%ohk)Y%$cI@#{fGe2Fc}_OiY;K@@?Fjl*E*N<;TjuaknG)uNJYgaied zeU<-^Q}V5Ibu3CF`@C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000000000 --- a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bval +++ /dev/null @@ -1 +0,0 @@ -0 0 2000 3780 3800 4380 2195 2205 4200 3570 1005 2800 3790 3390 0 3605 3980 2575 3605 4195 3570 4175 3385 3395 4185 2395 4985 0 1800 1800 3780 1610 4000 4170 1190 2785 3215 200 1985 3980 0 3385 4385 4955 395 3975 3390 3965 3395 205 3385 4385 5015 990 1800 1010 1190 2605 2195 4380 0 \ No newline at end of file diff --git a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bvec b/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bvec deleted file mode 100644 index d31e09213..000000000 --- a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.bvec +++ /dev/null @@ -1,3 +0,0 @@ -0 0 0.947306 -0.689491 -0.687391 -0.640236 0.904801 0.301134 0.218033 0.236237 -0.00045876 -0.267232 -0.229644 0.727918 0 -0.235344 -0.895859 0.556585 -0.235344 -0.872345 0.236237 0.218536 -0.485657 -0.969313 0.873651 0.577663 0.999993 0 -0.665829 0.665829 -0.689491 0.704677 -0.00022427 -0.437403 0.409502 0.26769 -0.00031134 0.999772 -0.00016233 0.895859 0 0.971029 0.426584 0 -0.712479 -0.00011346 -0.727918 -0.448521 -0.484877 -0.00487633 -0.485657 -0.426584 -0.00019956 -0.00045946 0.665829 -0.445079 0.409502 -0.830354 -0.904801 0.640236 0 -0 0 -0.320301 -0.233031 0.690471 -0.429664 -0.305819 -0.906545 0.874886 0.239537 0.898412 0.804939 0.691594 0.488404 0 -0.943991 -0.00303821 -0.00388069 0.943991 -0.439269 -0.239537 0.439998 0.488955 -0.245811 0.221429 -0.581525 -0.00280889 0 0.670455 -0.670455 0.233031 -0.709514 -0.896432 0.221712 -0.414997 -0.538836 -0.999995 -0.0151408 0.32154 -0.00303821 0 -0.00329842 0.642719 -0.00262411 -0.0090312 -0.450857 0.488404 -0.00293403 -0.730564 -0.999882 -0.488955 -0.642719 -0.999997 -0.454441 0.670455 -0.895473 0.414997 -0.557225 -0.305819 -0.429664 0 -0 0 -0.00426696 -0.685783 -0.225265 -0.636779 -0.296327 -0.295796 -0.432477 -0.941708 -0.439154 -0.529773 -0.684807 -0.481245 0 -0.231289 -0.444328 -0.830781 -0.231289 -0.214611 -0.941708 -0.871001 -0.724611 -0.00307126 -0.433248 -0.57283 -0.00260781 0 -0.327355 -0.327355 -0.685783 -0.00439859 -0.443181 -0.871506 -0.812457 -0.798748 -0.00311231 -0.0150655 -0.946896 -0.444328 0 -0.238939 -0.636348 -0.999997 -0.701635 -0.892596 -0.481245 -0.893768 -0.480802 -0.014558 -0.724611 -0.636348 -0.00259323 -0.890777 -0.327355 -0.00576167 -0.812457 -0.00362001 -0.296327 -0.636779 0 diff --git a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.json b/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.json deleted file mode 100644 index ab24e0601..000000000 --- a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.072, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "SeriesDescription": "ABCD_dMRI", - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j", - "SoftwareVersions": "syngo_MR_E11" -} diff --git a/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.nii.gz b/BIDS_Dataset/sub-04/ses-phdiff/dwi/sub-04_ses-phdiff_acq-HASC55AP_dwi.nii.gz deleted file mode 100644 index af8d3e5ac63c7935741be9a94f6df8164219aaec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30889 zcmeIx_fr!F90hQ!iXh7lKt!Ml#VQwqwGa%!$VR}#jjRNbDHxUn0+M)o2b`>mqC_xw zPy{7m$Oto1bFy~?WD7A+BVmOdNZS9PKlkqYetJK@dmp`I1%-#2G~#!%$S5C#&1Kum z=ZKMhk%+KB-ynZ~;*Fc(2uG{SHm0Ul7l^*mLB^z@Ai23A5l(wpO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;|Lb&DFW>?W2q8=QrJ5e9miG_NHe!kH7r<^}6`)*RAVQ^=x%g-`dLMy}TC7 ycU?=xp@D&siG@QzVU#f%2%{-sG#8BKg3(+snhORt7yR>n!1~whnC^pfYzzP;q$FJc diff --git a/BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.json b/BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.json deleted file mode 100644 index 908819a88..000000000 --- a/BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "ProcedureStepDescription": "MR_HEAD_WO_IV_CONTRAST", - "DeviceSerialNumber": "167024", - "EffectiveEchoSpacing": 0.000689998, - "TotalReadoutTime": 0.0717598, - "ManufacturersModelName": "Prisma_fit", - "ProtocolName": "ABCD_dMRI", - "BandwidthPerPixelPhaseEncode": 10.352, - "PhaseEncodingLines": 140, - "RepetitionTime": 4.2, - "EchoTrainLength": 105, - "MagneticFieldStrength": 3, - "AcquisitionNumber": 1, - "InstitutionName": "HUP", - "BodyPartExamined": "BRAIN", - "ConversionSoftware": "dcm2niix", - "ScanningSequence": "EP", - "Manufacturer": "Siemens", - "FlipAngle": 90, - "InstitutionAddress": "Spruce_Street_3400_Philadelphia_Pennsylvania_US_19104", - "SeriesDescription": "ABCD_dMRI", - "ConversionSoftwareVersion": "v1.0.20170724 (OpenJPEG build) GCC6.1.0", - "AcquisitionTime": "16:31:6.145000", - "SequenceName": "ep_b0", - "ImageType": [ - "ORIGINAL", - "PRIMARY", - "DIFFUSION", - "NONE", - "ND", - "MOSAIC" - ], - "EchoTime": 0.089, - "SequenceVariant": "SK_SP", - "SliceTiming": [ - 0.0, - 0.11666666666666667, - 0.23333333333333334, - 0.35, - 0.4666666666666667, - 0.5833333333333334, - 0.7, - 0.8166666666666667, - 0.9333333333333333, - 1.05, - 1.1666666666666667, - 1.2833333333333334, - 1.4, - 1.5166666666666666, - 1.6333333333333333, - 1.75, - 1.8666666666666667, - 1.9833333333333334, - 2.1, - 2.216666666666667, - 2.3333333333333335, - 2.45, - 2.566666666666667, - 2.6833333333333336, - 2.8, - 2.9166666666666665, - 3.033333333333333, - 3.15, - 3.2666666666666666, - 3.3833333333333333, - 3.5, - 3.6166666666666667, - 3.7333333333333334, - 3.85, - 3.966666666666667, - 4.083333333333333 - ], - "PhaseEncodingDirection": "j-", - "SoftwareVersions": "syngo_MR_E11", - "IntendedFor": [ - "ses-phdiff/func/sub-04_ses-phdiff_task-rest_bold.nii.gz" - ] -} diff --git a/BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.nii.gz b/BIDS_Dataset/sub-04/ses-phdiff/fmap/sub-04_ses-phdiff_dir-PA_epi.nii.gz deleted file mode 100644 index b60186d5ad8b1173eaee849a5a828e70f4aedc66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1502 zcmeIu`8V4K004094on?mM&s%_gx1lPHE|_qSIa8P=qpl38VwpzN7Ap5XtJlz8I z%L|5xBd%JT)|EQKP*%J~%`%coQjMU9FeJ@V?El!?Z=at(E({ZsQad{4=phM6_P%iC z;uQpjltS{(PRY*7z!EVyJkk5dFic7|-X{}}H&XwVNCI88H@f~%{(=q1f|aX9(I@=H z&zk`=USf4wWT;aF$Ehkb25hq+6OQ{_CDvo^wQG^|_}QllG~&e#2h zf)Fd_I~EMROcJ+f?wYTy z*-!L%ed@c}Rk`c~C$IehPrVIY4}l#gU($Pkfct%T&DQn2c}aq4#cWtXjO0+O&B7GW z4_o8&{%|~IW~_iGnj#$#0ygh1>)kT zqZ~g|{f#}>so3MC6>ST5z!^;%@|#caL|MF6dO39&>L*5d5~=L)t6LjAYb;s=+r^T? znTayY@hv;Fs}=WJ_ofhCv!VvEZzB zYUSc;dvQ)@Ur#wL)+hCM&hE|kU2sQZPO?Dvj0F_8K#Ya*m*8od*M2a;#nu8fUHdIz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=Rw6IFHs zy7}4^0JAS{=9Lq2;5(`Q)m)gzkY6Vf66!mr1 z?5g9#npJmtfEKbRzw_AZr%TD(!4%8K(;Nfi`C@^fgsDks_KO#bSC8iY8J2?DUm8pG z5*o^uEs(eYx{!Ka6%I{Tqd_Lc7wJ3g{dDkpu|)4-=QKQ{73#`_vXiqi^%4EE_vChcw@2Z?&ro0l zcmgN@1)u;FfC5ke3P1rU00p1`6o3Ly017|>C;$bZ02F`%Pyh-*0Vn_kpa2wr0#E=7 zKmjNK1)u;FfC5ke3P1rU00p1`6o3Ly017|>C;$bZ02F`%Pyh-*0Vn_kpa2wr0#E=7 zK*9e}fplC|M@jDAC@-^hn;F)v_jc`;S3YRs-2??jfG2C;$bZ02F`%Pyh-*0Vn_kpa2wr0#E=7 UK*4`0_ put in code/CuBIDS dir - abs_path_output = False - # check if code/CuBIDS dir exists - if not Path(str(opts.bids_dir) + "/code/CuBIDS").is_dir(): - # if not, create it - subprocess.run(["mkdir", str(opts.bids_dir) + "/code"]) - subprocess.run(["mkdir", str(opts.bids_dir) + "/code/CuBIDS/"]) - - # Run directly from python using subprocess - if opts.container is None: - if not opts.sequential: - # run on full dataset - call = build_validator_call( - str(opts.bids_dir), - opts.ignore_nifti_headers, - opts.ignore_subject_consistency, - ) - ret = run_validator(call) - - # parse the string output - parsed = parse_validator_output(ret.stdout.decode("UTF-8")) - if parsed.shape[1] < 1: - logger.info("No issues/warnings parsed, your dataset is BIDS valid.") - sys.exit(0) - else: - logger.info("BIDS issues/warnings found in the dataset") - - if opts.output_prefix: - # check if absolute or relative path - if abs_path_output: - # normally, write dataframe to file in CLI - val_tsv = str(opts.output_prefix) + "_validation.tsv" - - else: - val_tsv = ( - str(opts.bids_dir) - + "/code/CuBIDS/" - + str(opts.output_prefix) - + "_validation.tsv" - ) - - parsed.to_csv(val_tsv, sep="\t", index=False) - - # build validation data dictionary json sidecar - val_dict = get_val_dictionary() - val_json = val_tsv.replace("tsv", "json") - with open(val_json, "w") as outfile: - json.dump(val_dict, outfile, indent=4) - - logger.info("Writing issues out to %s", val_tsv) - sys.exit(0) - else: - # user may be in python session, return dataframe - return parsed - else: - # logger.info("Prepping sequential validator run...") - - # build a dictionary with {SubjectLabel: [List of files]} - subjects_dict = build_subject_paths(opts.bids_dir) - - # logger.info("Running validator sequentially...") - # iterate over the dictionary - - parsed = [] - - if opts.sequential_subjects: - subjects_dict = { - k: v for k, v in subjects_dict.items() if k in opts.sequential_subjects - } - assert len(list(subjects_dict.keys())) > 1, "No subjects found in filter" - for subject, files_list in tqdm.tqdm(subjects_dict.items()): - # logger.info(" ".join(["Processing subject:", subject])) - # create a temporary directory and symlink the data - with tempfile.TemporaryDirectory() as tmpdirname: - for fi in files_list: - # cut the path down to the subject label - bids_start = fi.find(subject) - - # maybe it's a single file - if bids_start < 1: - bids_folder = tmpdirname - fi_tmpdir = tmpdirname - - else: - bids_folder = Path(fi[bids_start:]).parent - fi_tmpdir = tmpdirname + "/" + str(bids_folder) - - if not os.path.exists(fi_tmpdir): - os.makedirs(fi_tmpdir) - output = fi_tmpdir + "/" + str(Path(fi).name) - shutil.copy2(fi, output) - - # run the validator - nifti_head = opts.ignore_nifti_headers - subj_consist = opts.ignore_subject_consistency - call = build_validator_call(tmpdirname, nifti_head, subj_consist) - ret = run_validator(call) - # parse output - if ret.returncode != 0: - logger.error("Errors returned from validator run, parsing now") + return parser - # parse the output and add to list if it returns a df - decoded = ret.stdout.decode("UTF-8") - tmp_parse = parse_validator_output(decoded) - if tmp_parse.shape[1] > 1: - tmp_parse["subject"] = subject - parsed.append(tmp_parse) - # concatenate the parsed data and exit - if len(parsed) < 1: - logger.info("No issues/warnings parsed, your dataset is BIDS valid.") - sys.exit(0) - - else: - parsed = pd.concat(parsed, axis=0) - subset = parsed.columns.difference(["subject"]) - parsed = parsed.drop_duplicates(subset=subset) - - logger.info("BIDS issues/warnings found in the dataset") - - if opts.output_prefix: - # normally, write dataframe to file in CLI - if abs_path_output: - val_tsv = str(opts.output_prefix) + "_validation.tsv" - else: - val_tsv = ( - str(opts.bids_dir) - + "/code/CuBIDS/" - + str(opts.output_prefix) - + "_validation.tsv" - ) - - parsed.to_csv(val_tsv, sep="\t", index=False) - - # build validation data dictionary json sidecar - val_dict = get_val_dictionary() - val_json = val_tsv.replace("tsv", "json") - with open(val_json, "w") as outfile: - json.dump(val_dict, outfile, indent=4) - - logger.info("Writing issues out to file %s", val_tsv) - sys.exit(0) - else: - # user may be in python session, return dataframe - return parsed - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids:ro" - output_dir_link_t = str(opts.output_prefix.parent.absolute()) + ":/tsv:rw" - output_dir_link_j = str(opts.output_prefix.parent.absolute()) + ":/json:rw" - linked_output_prefix_t = "/tsv/" + opts.output_prefix.name - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "-v", - output_dir_link_t, - "-v", - output_dir_link_j, - "--entrypoint", - "cubids-validate", - opts.container, - "/bids", - linked_output_prefix_t, - ] - if opts.ignore_nifti_headers: - cmd.append("--ignore_nifti_headers") - if opts.ignore_subject_consistency: - cmd.append("--ignore_subject_consistency") - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - "-B", - output_dir_link_t, - "-B", - output_dir_link_j, - opts.container, - "cubids-validate", - "/bids", - linked_output_prefix_t, - ] - if opts.ignore_nifti_headers: - cmd.append("--ignore_nifti_headers") - if opts.ignore_subject_consistency: - cmd.append("--ignore_subject_consistency") - if opts.sequential: - cmd.append("--sequential") - - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_validate(argv=None): + warnings.warn( + "cubids-validate is deprecated and will be removed in the future. " + "Please use cubids validate.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_validate().parse_args(argv) + args = vars(options).copy() + workflows.validate(**args) -def bids_sidecar_merge(): - """Merge critical keys from one sidecar to another.""" +def _parse_bids_sidecar_merge(): parser = argparse.ArgumentParser( description=("bids-sidecar-merge: merge critical keys from one sidecar to another"), formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -322,13 +110,22 @@ def bids_sidecar_merge(): action="store", help=("destination json. This file will have data from `from_json` copied into it."), ) - opts = parser.parse_args() - merge_status = merge_json_into_json(opts.from_json, opts.to_json, raise_on_error=False) - sys.exit(merge_status) + return parser + + +def _enter_bids_sidecar_merge(argv=None): + warnings.warn( + "bids-sidecar-merge is deprecated and will be removed in the future. " + "Please use cubids bids-sidecar-merge.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_bids_sidecar_merge().parse_args(argv) + args = vars(options).copy() + workflows.bids_sidecar_merge(**args) -def cubids_group(): - """Find key and param groups.""" +def _parse_group(): parser = argparse.ArgumentParser( description="cubids-group: find key and parameter groups in BIDS", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -364,89 +161,28 @@ def cubids_group(): parser.add_argument( "--acq-group-level", default="subject", + choices=["subject", "session"], action="store", - help=("Level at which acquisition groups are created " 'options: "subject" or "session"'), + help=("Level at which acquisition groups are created options: 'subject' or 'session'"), ) parser.add_argument( "--config", action="store", type=Path, help="path to a config file for grouping" ) - opts = parser.parse_args() - - # Run directly from python using - if opts.container is None: - bod = CuBIDS( - data_root=str(opts.bids_dir), - acq_group_level=opts.acq_group_level, - grouping_config=opts.config, - ) - bod.get_tsvs( - str(opts.output_prefix), - ) - sys.exit(0) - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids" - output_dir_link = str(opts.output_prefix.parent.absolute()) + ":/tsv:rw" + return parser - apply_config = opts.config is not None - if apply_config: - input_config_dir_link = str(opts.config.parent.absolute()) + ":/in_config:ro" - linked_input_config = "/in_config/" + opts.config.name - linked_output_prefix = "/tsv/" + opts.output_prefix.name - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "-v", - output_dir_link, - "--entrypoint", - "cubids-group", - opts.container, - "/bids", - linked_output_prefix, - ] - if apply_config: - cmd.insert(3, "-v") - cmd.insert(4, input_config_dir_link) - cmd += ["--config", linked_input_config] - - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - "-B", - output_dir_link, - opts.container, - "cubids-group", - "/bids", - linked_output_prefix, - ] - if apply_config: - cmd.insert(3, "-B") - cmd.insert(4, input_config_dir_link) - cmd += ["--config", linked_input_config] - - if opts.acq_group_level: - cmd.append("--acq-group-level") - cmd.append(str(opts.acq_group_level)) - - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_group(argv=None): + warnings.warn( + "cubids-group is deprecated and will be removed in the future. Please use cubids group.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_group().parse_args(argv) + args = vars(options).copy() + workflows.group(**args) -def cubids_apply(): - """Apply the tsv changes.""" +def _parse_apply(): parser = argparse.ArgumentParser( description=("cubids-apply: apply the changes specified in a tsv to a BIDS directory"), formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -510,121 +246,29 @@ def cubids_apply(): parser.add_argument( "--acq-group-level", default="subject", + choices=["subject", "session"], action="store", - help=("Level at which acquisition groups are created " 'options: "subject" or "session"'), + help=("Level at which acquisition groups are created options: 'subject' or 'session'"), ) parser.add_argument( "--config", action="store", type=Path, help="path to a config file for grouping" ) - opts = parser.parse_args() - - # Run directly from python using - if opts.container is None: - bod = CuBIDS( - data_root=str(opts.bids_dir), - use_datalad=opts.use_datalad, - acq_group_level=opts.acq_group_level, - grouping_config=opts.config, - ) - if opts.use_datalad: - if not bod.is_datalad_clean(): - raise Exception("Untracked change in " + str(opts.bids_dir)) - bod.apply_tsv_changes( - str(opts.edited_summary_tsv), - str(opts.files_tsv), - str(opts.new_tsv_prefix), - raise_on_error=False, - ) - sys.exit(0) - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids" - input_summary_tsv_dir_link = ( - str(opts.edited_tsv_prefix.parent.absolute()) + ":/in_summary_tsv:ro" - ) - input_files_tsv_dir_link = str(opts.edited_tsv_prefix.parent.absolute()) + ":/in_files_tsv:ro" - output_tsv_dir_link = str(opts.new_tsv_prefix.parent.absolute()) + ":/out_tsv:rw" - # FROM BOND-GROUP - apply_config = opts.config is not None - if apply_config: - input_config_dir_link = str(opts.config.parent.absolute()) + ":/in_config:ro" - linked_input_config = "/in_config/" + opts.config.name + return parser - linked_output_prefix = "/tsv/" + opts.output_prefix.name - #### - linked_input_summary_tsv = "/in_summary_tsv/" + opts.edited_summary_tsv.name - linked_input_files_tsv = "/in_files_tsv/" + opts.files_tsv.name - linked_output_prefix = "/out_tsv/" + opts.new_tsv_prefix.name - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "-v", - input_summary_tsv_dir_link, - "-v", - input_files_tsv_dir_link, - "-v", - output_tsv_dir_link, - "--entrypoint", - "cubids-apply", - opts.container, - "/bids", - linked_input_summary_tsv, - linked_input_files_tsv, - linked_output_prefix, - ] - if apply_config: - cmd.insert(3, "-v") - cmd.insert(4, input_config_dir_link) - cmd += ["--config", linked_input_config] - - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - "-B", - input_summary_tsv_dir_link, - "-B", - input_files_tsv_dir_link, - "-B", - output_tsv_dir_link, - opts.container, - "cubids-apply", - "/bids", - linked_input_summary_tsv, - linked_input_files_tsv, - linked_output_prefix, - ] - if apply_config: - cmd.insert(3, "-B") - cmd.insert(4, input_config_dir_link) - cmd += ["--config", linked_input_config] - - if opts.use_datalad: - cmd.append("--use-datalad") - - if opts.acq_group_level: - cmd.append("--acq-group-level") - cmd.append(str(opts.acq_group_level)) - - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_apply(argv=None): + warnings.warn( + "cubids-apply is deprecated and will be removed in the future. Please use cubids apply.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_apply().parse_args(argv) + args = vars(options).copy() + workflows.apply(**args) -def cubids_datalad_save(): - """Perform datalad save.""" +def _parse_datalad_save(): parser = argparse.ArgumentParser( description=("cubids-datalad-save: perform a DataLad save on a BIDS directory"), formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -644,53 +288,23 @@ def cubids_datalad_save(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - # Run directly from python using - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=True) - bod.datalad_save(message=opts.m) - sys.exit(0) + return parser + - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "--entrypoint", - "cubids-datalad-save", - opts.container, - "/bids", - "-m", - opts.m, - ] - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - opts.container, - "cubids-datalad-save", - "/bids", - "-m", - opts.m, - ] - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_datalad_save(argv=None): + warnings.warn( + "cubids-datalad-save is deprecated and will be removed in the future. " + "Please use cubids datalad-save.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_datalad_save().parse_args(argv) + args = vars(options).copy() + workflows.datalad_save(**args) -def cubids_undo(): - """Revert the most recent commit.""" +def _parse_undo(): parser = argparse.ArgumentParser( description="cubids-undo: revert most recent commit", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -709,49 +323,22 @@ def cubids_undo(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - # Run directly from python using - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=True) - bod.datalad_undo_last_commit() - sys.exit(0) + return parser + - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "--entrypoint", - "cubids-undo", - opts.container, - "/bids", - ] - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - opts.container, - "cubids-undo", - "/bids", - ] - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_undo(argv=None): + warnings.warn( + "cubids-undo is deprecated and will be removed in the future. Please use cubids undo.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_undo().parse_args(argv) + args = vars(options).copy() + workflows.undo(**args) -def cubids_copy_exemplars(): - """Create and save a directory with one subject from each acquisition group.""" +def _parse_copy_exemplars(): parser = argparse.ArgumentParser( description=( "cubids-copy-exemplars: create and save a directory with " @@ -808,84 +395,22 @@ def cubids_copy_exemplars(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - - # Run directly from python using - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=opts.use_datalad) - if opts.use_datalad: - if not bod.is_datalad_clean(): - raise Exception( - "Untracked changes. Need to save " - + str(opts.bids_dir) - + " before coyping exemplars" - ) - bod.copy_exemplars( - str(opts.exemplars_dir), - str(opts.exemplars_tsv), - min_group_size=opts.min_group_size, - ) - sys.exit(0) - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids:ro" - exemplars_dir_link = str(opts.exemplars_dir.absolute()) + ":/exemplars:ro" - exemplars_tsv_link = str(opts.exemplars_tsv.absolute()) + ":/in_tsv:ro" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - exemplars_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "-v", - exemplars_tsv_link, - "--entrypoint", - "cubids-copy-exemplars", - opts.container, - "/bids", - "/exemplars", - "/in_tsv", - ] + return parser - if opts.force_unlock: - cmd.append("--force-unlock") - if opts.min_group_size: - cmd.append("--min-group-size") - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - "-B", - exemplars_dir_link, - "-B", - exemplars_tsv_link, - opts.container, - "cubids-copy-exemplars", - "/bids", - "/exemplars", - "/in_tsv", - ] - if opts.force_unlock: - cmd.append("--force-unlock") - if opts.min_group_size: - cmd.append("--min-group-size") - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_copy_exemplars(argv=None): + warnings.warn( + "cubids-copy-exemplars is deprecated and will be removed in the future. " + "Please use cubids copy-exemplars.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_copy_exemplars().parse_args(argv) + args = vars(options).copy() + workflows.copy_exemplars(**args) -def cubids_add_nifti_info(): - """Add information from nifti files to the dataset's sidecars.""" +def _parse_add_nifti_info(): parser = argparse.ArgumentParser( description=( "cubids-add-nifti-info: Add information from nifti" @@ -918,64 +443,22 @@ def cubids_add_nifti_info(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - - # Run directly from python using - if opts.container is None: - bod = CuBIDS( - data_root=str(opts.bids_dir), - use_datalad=opts.use_datalad, - force_unlock=opts.force_unlock, - ) - if opts.use_datalad: - if not bod.is_datalad_clean(): - raise Exception("Untracked change in " + str(opts.bids_dir)) - # if bod.is_datalad_clean() and not opts.force_unlock: - # raise Exception("Need to unlock " + str(opts.bids_dir)) - bod.add_nifti_info() - sys.exit(0) - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids:ro" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "--entrypoint", - "cubids-add-nifti-info", - opts.container, - "/bids", - ] + return parser - if opts.force_unlock: - cmd.append("--force-unlock") - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - opts.container, - "cubids-add-nifti-info", - "/bids", - ] - if opts.force_unlock: - cmd.append("--force-unlock") - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_add_nifti_info(argv=None): + warnings.warn( + "cubids-add-nifti-info is deprecated and will be removed in the future. " + "Please use cubids add-nifti-info.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_add_nifti_info().parse_args(argv) + args = vars(options).copy() + workflows.add_nifti_info(**args) -def cubids_purge(): - """Purge scan associations.""" +def _parse_purge(): parser = argparse.ArgumentParser( description="cubids-purge: purge associations from the dataset", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -1006,62 +489,21 @@ def cubids_purge(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - - # Run directly from python using - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=opts.use_datalad) - if opts.use_datalad: - if not bod.is_datalad_clean(): - raise Exception("Untracked change in " + str(opts.bids_dir)) - bod.purge(str(opts.scans)) - sys.exit(0) + return parser - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids" - input_scans_link = str(opts.scans.parent.absolute()) + ":/in_scans:ro" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "-v", - GIT_CONFIG + ":/root/.gitconfig", - "-v", - input_scans_link, - "--entrypoint", - "cubids-purge", - opts.container, - "/bids", - input_scans_link, - ] - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - "-B", - input_scans_link, - opts.container, - "cubids-purge", - "/bids", - input_scans_link, - ] - print("RUNNING: " + " ".join(cmd)) - if opts.use_datalad: - cmd.append("--use-datalad") - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_purge(argv=None): + warnings.warn( + "cubids-purge is deprecated and will be removed in the future. Please use cubids purge.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_purge().parse_args(argv) + args = vars(options).copy() + workflows.purge(**args) -def cubids_remove_metadata_fields(): - """Delete fields from metadata.""" +def _parse_remove_metadata_fields(): parser = argparse.ArgumentParser( description="cubids-remove-metadata-fields: delete fields from metadata", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -1087,49 +529,23 @@ def cubids_remove_metadata_fields(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - # Run directly from python - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=False) - bod.remove_metadata_fields(opts.fields) - sys.exit(0) + return parser + - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids:rw" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "--entrypoint", - "cubids-remove-metadata-fields", - opts.container, - "/bids", - "--fields", - ] + opts.fields - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - opts.container, - "cubids-remove-metadata-fields", - "/bids", - "--fields", - ] + opts.fields - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) +def _enter_remove_metadata_fields(argv=None): + warnings.warn( + "cubids-remove-metadata-fields is deprecated and will be removed in the future. " + "Please use cubids remove-metadata-fields.", + DeprecationWarning, + stacklevel=2, + ) + options = _parse_remove_metadata_fields().parse_args(argv) + args = vars(options).copy() + workflows.remove_metadata_fields(**args) -def cubids_print_metadata_fields(): - """Print unique metadata fields.""" +def _parse_print_metadata_fields(): parser = argparse.ArgumentParser( description="cubids-print-metadata-fields: print all unique metadata fields", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -1148,54 +564,61 @@ def cubids_print_metadata_fields(): action="store", help="Docker image tag or Singularity image file.", ) - opts = parser.parse_args() - - # Run directly from python - if opts.container is None: - bod = CuBIDS(data_root=str(opts.bids_dir), use_datalad=False) - fields = bod.get_all_metadata_fields() - print("\n".join(fields)) - sys.exit(0) - - # Run it through a container - container_type = _get_container_type(opts.container) - bids_dir_link = str(opts.bids_dir.absolute()) + ":/bids:ro" - if container_type == "docker": - cmd = [ - "docker", - "run", - "--rm", - "-v", - bids_dir_link, - "--entrypoint", - "cubids-print-metadata-fields", - opts.container, - "/bids", - ] - elif container_type == "singularity": - cmd = [ - "singularity", - "exec", - "--cleanenv", - "-B", - bids_dir_link, - opts.container, - "cubids-print-metadata-fields", - "/bids", - ] - print("RUNNING: " + " ".join(cmd)) - proc = subprocess.run(cmd) - sys.exit(proc.returncode) + return parser + + +def _enter_print_metadata_fields(argv=None): + options = _parse_print_metadata_fields().parse_args(argv) + args = vars(options).copy() + warnings.warn( + "cubids-print-metadata-fields is deprecated and will be removed in the future. " + "Please use cubids print-metadata-fields.", + DeprecationWarning, + stacklevel=2, + ) + workflows.print_metadata_fields(**args) + + +COMMANDS = [ + ("validate", _parse_validate, workflows.validate), + ("sidecar-merge", _parse_bids_sidecar_merge, workflows.bids_sidecar_merge), + ("group", _parse_group, workflows.group), + ("apply", _parse_apply, workflows.apply), + ("purge", _parse_purge, workflows.purge), + ("add-nifti-info", _parse_add_nifti_info, workflows.add_nifti_info), + ("copy-exemplars", _parse_copy_exemplars, workflows.copy_exemplars), + ("undo", _parse_undo, workflows.undo), + ("datalad-save", _parse_datalad_save, workflows.datalad_save), + ("print-metadata-fields", _parse_print_metadata_fields, workflows.print_metadata_fields), + ("remove-metadata-fields", _parse_remove_metadata_fields, workflows.remove_metadata_fields), +] + + +def _get_parser(): + """Create the general "cubids" parser object.""" + from cubids import __version__ + + parser = argparse.ArgumentParser(prog="cubids") + parser.add_argument("-v", "--version", action="version", version=__version__) + subparsers = parser.add_subparsers(help="CuBIDS commands") + + for command, parser_func, run_func in COMMANDS: + subparser = parser_func() + subparser.set_defaults(func=run_func) + subparsers.add_parser( + command, + parents=[subparser], + help=subparser.description, + add_help=False, + ) -def _get_container_type(image_name): - """Get and return the container type.""" - # If it's a file on disk, it must be a singularity image - if Path(image_name).exists(): - return "singularity" + return parser - # It needs to match a docker tag pattern to be docker - if re.match(r"(?:.+\/)?([^:]+)(?::.+)?", image_name): - return "docker" - raise Exception("Unable to determine the container type of " + image_name) +def _main(argv=None): + """Set entrypoint for "cubids" CLI.""" + options = _get_parser().parse_args(argv) + args = vars(options).copy() + args.pop("func") + options.func(**args) diff --git a/CuBIDS_Toy_Dataset_Curation/no_ped.txt b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/no_ped.txt similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/no_ped.txt rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/no_ped.txt diff --git a/CuBIDS_Toy_Dataset_Curation/too_low_vols.txt b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/too_low_vols.txt similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/too_low_vols.txt rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/too_low_vols.txt diff --git a/CuBIDS_Toy_Dataset_Curation/v0_AcqGroupInfo.txt b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_AcqGroupInfo.txt similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v0_AcqGroupInfo.txt rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_AcqGroupInfo.txt diff --git a/CuBIDS_Toy_Dataset_Curation/v0_AcqGrouping.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_AcqGrouping.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v0_AcqGrouping.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_AcqGrouping.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v0_files.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_files.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v0_files.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_files.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v0_summary.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_summary.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v0_summary.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_summary.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v0_validation.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_validation.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v0_validation.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v0_validation.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v1_AcqGroupInfo.txt b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_AcqGroupInfo.txt similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v1_AcqGroupInfo.txt rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_AcqGroupInfo.txt diff --git a/CuBIDS_Toy_Dataset_Curation/v1_AcqGrouping.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_AcqGrouping.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v1_AcqGrouping.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_AcqGrouping.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v1_files.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_files.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v1_files.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_files.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v1_summary.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_summary.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v1_summary.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v1_summary.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v2_AcqGroupInfo.txt b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_AcqGroupInfo.txt similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v2_AcqGroupInfo.txt rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_AcqGroupInfo.txt diff --git a/CuBIDS_Toy_Dataset_Curation/v2_AcqGrouping.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_AcqGrouping.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v2_AcqGrouping.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_AcqGrouping.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v2_files.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_files.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v2_files.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_files.csv diff --git a/CuBIDS_Toy_Dataset_Curation/v2_full_cmd.sh b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_full_cmd.sh similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v2_full_cmd.sh rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_full_cmd.sh diff --git a/CuBIDS_Toy_Dataset_Curation/v2_summary.csv b/cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_summary.csv similarity index 100% rename from CuBIDS_Toy_Dataset_Curation/v2_summary.csv rename to cubids/tests/data/CuBIDS_Toy_Dataset_Curation/v2_summary.csv diff --git a/cubids/tests/test_bond.py b/cubids/tests/test_bond.py index 5e5b863ca..5a0c3aac1 100644 --- a/cubids/tests/test_bond.py +++ b/cubids/tests/test_bond.py @@ -1,5 +1,6 @@ """Tests for `cubids` package.""" import json +import os import subprocess from copy import deepcopy from pathlib import Path @@ -84,6 +85,8 @@ def test_ok_json_merge_cli(tmp_path): / "sub-03_ses-phdiff_acq-HASC55AP_dwi.json" ) + assert os.path.isfile(source_json) + assert os.path.isfile(dest_json) merge_proc = subprocess.run(["bids-sidecar-merge", str(source_json), str(dest_json)]) assert merge_proc.returncode == 0 assert not _get_json_string(dest_json) == orig_dest_json_content @@ -1021,7 +1024,7 @@ def test_validator(tmp_path): parsed = parse_validator_output(ret.stdout.decode("UTF-8")) - assert type(parsed) == pd.core.frame.DataFrame + assert isinstance(parsed, pd.DataFrame) def test_docker(): diff --git a/cubids/utils.py b/cubids/utils.py new file mode 100644 index 000000000..56704d8c6 --- /dev/null +++ b/cubids/utils.py @@ -0,0 +1,16 @@ +"""Miscellaneous utility functions for CuBIDS.""" +import re +from pathlib import Path + + +def _get_container_type(image_name): + """Get and return the container type.""" + # If it's a file on disk, it must be a singularity image + if Path(image_name).exists(): + return "singularity" + + # It needs to match a docker tag pattern to be docker + if re.match(r"(?:.+\/)?([^:]+)(?::.+)?", image_name): + return "docker" + + raise Exception("Unable to determine the container type of " + image_name) diff --git a/cubids/workflows.py b/cubids/workflows.py new file mode 100644 index 000000000..eea9bfa50 --- /dev/null +++ b/cubids/workflows.py @@ -0,0 +1,900 @@ +"""First order workflows in CuBIDS.""" +import json +import logging +import os +import shutil +import subprocess +import sys +import tempfile +import warnings +from pathlib import Path + +import pandas as pd +import tqdm + +from cubids import CuBIDS +from cubids.metadata_merge import merge_json_into_json +from cubids.utils import _get_container_type +from cubids.validator import ( + build_subject_paths, + build_validator_call, + get_val_dictionary, + parse_validator_output, + run_validator, +) + +warnings.simplefilter(action="ignore", category=FutureWarning) +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger("cubids-cli") +GIT_CONFIG = os.path.join(os.path.expanduser("~"), ".gitconfig") +logging.getLogger("datalad").setLevel(logging.ERROR) + + +def validate( + bids_dir, + output_prefix, + container, + sequential, + sequential_subjects, + ignore_nifti_headers, + ignore_subject_consistency, +): + """Run the bids validator. + + Parameters + ---------- + bids_dir + output_prefix + container + sequential + sequential_subjects + ignore_nifti_headers + ignore_subject_consistency + """ + # check status of output_prefix, absolute or relative? + abs_path_output = True + if "/" not in str(output_prefix): + # not an absolute path --> put in code/CuBIDS dir + abs_path_output = False + # check if code/CuBIDS dir exists + if not Path(str(bids_dir) + "/code/CuBIDS").is_dir(): + # if not, create it + subprocess.run(["mkdir", str(bids_dir) + "/code"]) + subprocess.run(["mkdir", str(bids_dir) + "/code/CuBIDS/"]) + + # Run directly from python using subprocess + if container is None: + if not sequential: + # run on full dataset + call = build_validator_call( + str(bids_dir), + ignore_nifti_headers, + ignore_subject_consistency, + ) + ret = run_validator(call) + + # parse the string output + parsed = parse_validator_output(ret.stdout.decode("UTF-8")) + if parsed.shape[1] < 1: + logger.info("No issues/warnings parsed, your dataset is BIDS valid.") + sys.exit(0) + else: + logger.info("BIDS issues/warnings found in the dataset") + + if output_prefix: + # check if absolute or relative path + if abs_path_output: + # normally, write dataframe to file in CLI + val_tsv = str(output_prefix) + "_validation.tsv" + + else: + val_tsv = ( + str(bids_dir) + + "/code/CuBIDS/" + + str(output_prefix) + + "_validation.tsv" + ) + + parsed.to_csv(val_tsv, sep="\t", index=False) + + # build validation data dictionary json sidecar + val_dict = get_val_dictionary() + val_json = val_tsv.replace("tsv", "json") + with open(val_json, "w") as outfile: + json.dump(val_dict, outfile, indent=4) + + logger.info("Writing issues out to %s", val_tsv) + sys.exit(0) + else: + # user may be in python session, return dataframe + return parsed + else: + # logger.info("Prepping sequential validator run...") + + # build a dictionary with {SubjectLabel: [List of files]} + subjects_dict = build_subject_paths(bids_dir) + + # logger.info("Running validator sequentially...") + # iterate over the dictionary + + parsed = [] + + if sequential_subjects: + subjects_dict = { + k: v for k, v in subjects_dict.items() if k in sequential_subjects + } + assert len(list(subjects_dict.keys())) > 1, "No subjects found in filter" + for subject, files_list in tqdm.tqdm(subjects_dict.items()): + # logger.info(" ".join(["Processing subject:", subject])) + # create a temporary directory and symlink the data + with tempfile.TemporaryDirectory() as tmpdirname: + for fi in files_list: + # cut the path down to the subject label + bids_start = fi.find(subject) + + # maybe it's a single file + if bids_start < 1: + bids_folder = tmpdirname + fi_tmpdir = tmpdirname + + else: + bids_folder = Path(fi[bids_start:]).parent + fi_tmpdir = tmpdirname + "/" + str(bids_folder) + + if not os.path.exists(fi_tmpdir): + os.makedirs(fi_tmpdir) + output = fi_tmpdir + "/" + str(Path(fi).name) + shutil.copy2(fi, output) + + # run the validator + nifti_head = ignore_nifti_headers + subj_consist = ignore_subject_consistency + call = build_validator_call(tmpdirname, nifti_head, subj_consist) + ret = run_validator(call) + # parse output + if ret.returncode != 0: + logger.error("Errors returned from validator run, parsing now") + + # parse the output and add to list if it returns a df + decoded = ret.stdout.decode("UTF-8") + tmp_parse = parse_validator_output(decoded) + if tmp_parse.shape[1] > 1: + tmp_parse["subject"] = subject + parsed.append(tmp_parse) + + # concatenate the parsed data and exit + if len(parsed) < 1: + logger.info("No issues/warnings parsed, your dataset is BIDS valid.") + sys.exit(0) + + else: + parsed = pd.concat(parsed, axis=0) + subset = parsed.columns.difference(["subject"]) + parsed = parsed.drop_duplicates(subset=subset) + + logger.info("BIDS issues/warnings found in the dataset") + + if output_prefix: + # normally, write dataframe to file in CLI + if abs_path_output: + val_tsv = str(output_prefix) + "_validation.tsv" + else: + val_tsv = ( + str(bids_dir) + + "/code/CuBIDS/" + + str(output_prefix) + + "_validation.tsv" + ) + + parsed.to_csv(val_tsv, sep="\t", index=False) + + # build validation data dictionary json sidecar + val_dict = get_val_dictionary() + val_json = val_tsv.replace("tsv", "json") + with open(val_json, "w") as outfile: + json.dump(val_dict, outfile, indent=4) + + logger.info("Writing issues out to file %s", val_tsv) + sys.exit(0) + else: + # user may be in python session, return dataframe + return parsed + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids:ro" + output_dir_link_t = str(output_prefix.parent.absolute()) + ":/tsv:rw" + output_dir_link_j = str(output_prefix.parent.absolute()) + ":/json:rw" + linked_output_prefix_t = "/tsv/" + output_prefix.name + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "-v", + output_dir_link_t, + "-v", + output_dir_link_j, + "--entrypoint", + "cubids-validate", + container, + "/bids", + linked_output_prefix_t, + ] + if ignore_nifti_headers: + cmd.append("--ignore_nifti_headers") + + if ignore_subject_consistency: + cmd.append("--ignore_subject_consistency") + + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + "-B", + output_dir_link_t, + "-B", + output_dir_link_j, + container, + "cubids-validate", + "/bids", + linked_output_prefix_t, + ] + if ignore_nifti_headers: + cmd.append("--ignore_nifti_headers") + + if ignore_subject_consistency: + cmd.append("--ignore_subject_consistency") + + if sequential: + cmd.append("--sequential") + + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def bids_sidecar_merge(from_json, to_json): + """Merge critical keys from one sidecar to another.""" + merge_status = merge_json_into_json(from_json, to_json, raise_on_error=False) + sys.exit(merge_status) + + +def group(bids_dir, container, acq_group_level, config, output_prefix): + """Find key and param groups. + + Parameters + ---------- + bids_dir + container + acq_group_level + config + output_prefix + """ + # Run directly from python using + if container is None: + bod = CuBIDS( + data_root=str(bids_dir), + acq_group_level=acq_group_level, + grouping_config=config, + ) + bod.get_tsvs( + str(output_prefix), + ) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids" + output_dir_link = str(output_prefix.parent.absolute()) + ":/tsv:rw" + + apply_config = config is not None + if apply_config: + input_config_dir_link = str(config.parent.absolute()) + ":/in_config:ro" + linked_input_config = "/in_config/" + config.name + + linked_output_prefix = "/tsv/" + output_prefix.name + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "-v", + output_dir_link, + "--entrypoint", + "cubids-group", + container, + "/bids", + linked_output_prefix, + ] + if apply_config: + cmd.insert(3, "-v") + cmd.insert(4, input_config_dir_link) + cmd += ["--config", linked_input_config] + + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + "-B", + output_dir_link, + container, + "cubids-group", + "/bids", + linked_output_prefix, + ] + if apply_config: + cmd.insert(3, "-B") + cmd.insert(4, input_config_dir_link) + cmd += ["--config", linked_input_config] + + if acq_group_level: + cmd.append("--acq-group-level") + cmd.append(str(acq_group_level)) + + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def apply( + bids_dir, + use_datalad, + acq_group_level, + config, + edited_summary_tsv, + edited_tsv_prefix, + files_tsv, + new_tsv_prefix, + output_prefix, + container, +): + """Apply the tsv changes. + + Parameters + ---------- + bids_dir + use_datalad + acq_group_level + config + edited_summary_tsv + edited_tsv_prefix + files_tsv + new_tsv_prefix + output_prefix + container + """ + # Run directly from python using + if container is None: + bod = CuBIDS( + data_root=str(bids_dir), + use_datalad=use_datalad, + acq_group_level=acq_group_level, + grouping_config=config, + ) + if use_datalad: + if not bod.is_datalad_clean(): + raise Exception("Untracked change in " + str(bids_dir)) + bod.apply_tsv_changes( + str(edited_summary_tsv), + str(files_tsv), + str(new_tsv_prefix), + raise_on_error=False, + ) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids" + input_summary_tsv_dir_link = str(edited_tsv_prefix.parent.absolute()) + ":/in_summary_tsv:ro" + input_files_tsv_dir_link = str(edited_tsv_prefix.parent.absolute()) + ":/in_files_tsv:ro" + output_tsv_dir_link = str(new_tsv_prefix.parent.absolute()) + ":/out_tsv:rw" + + # FROM BOND-GROUP + apply_config = config is not None + if apply_config: + input_config_dir_link = str(config.parent.absolute()) + ":/in_config:ro" + linked_input_config = "/in_config/" + config.name + + linked_output_prefix = "/tsv/" + output_prefix.name + + #### + linked_input_summary_tsv = "/in_summary_tsv/" + edited_summary_tsv.name + linked_input_files_tsv = "/in_files_tsv/" + files_tsv.name + linked_output_prefix = "/out_tsv/" + new_tsv_prefix.name + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "-v", + input_summary_tsv_dir_link, + "-v", + input_files_tsv_dir_link, + "-v", + output_tsv_dir_link, + "--entrypoint", + "cubids-apply", + container, + "/bids", + linked_input_summary_tsv, + linked_input_files_tsv, + linked_output_prefix, + ] + if apply_config: + cmd.insert(3, "-v") + cmd.insert(4, input_config_dir_link) + cmd += ["--config", linked_input_config] + + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + "-B", + input_summary_tsv_dir_link, + "-B", + input_files_tsv_dir_link, + "-B", + output_tsv_dir_link, + container, + "cubids-apply", + "/bids", + linked_input_summary_tsv, + linked_input_files_tsv, + linked_output_prefix, + ] + if apply_config: + cmd.insert(3, "-B") + cmd.insert(4, input_config_dir_link) + cmd += ["--config", linked_input_config] + + if use_datalad: + cmd.append("--use-datalad") + + if acq_group_level: + cmd.append("--acq-group-level") + cmd.append(str(acq_group_level)) + + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def datalad_save( + bids_dir, + container, + m, +): + """Perform datalad save. + + Parameters + ---------- + bids_dir + container + m + """ + # Run directly from python using + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=True) + bod.datalad_save(message=m) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "--entrypoint", + "cubids-datalad-save", + container, + "/bids", + "-m", + m, + ] + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + container, + "cubids-datalad-save", + "/bids", + "-m", + m, + ] + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def undo(bids_dir, container): + """Revert the most recent commit. + + Parameters + ---------- + bids_dir + container + """ + # Run directly from python using + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=True) + bod.datalad_undo_last_commit() + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "--entrypoint", + "cubids-undo", + container, + "/bids", + ] + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + container, + "cubids-undo", + "/bids", + ] + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def copy_exemplars( + bids_dir, + container, + use_datalad, + exemplars_dir, + exemplars_tsv, + min_group_size, + force_unlock, +): + """Create and save a directory with one subject from each acquisition group. + + Parameters + ---------- + bids_dir + container + use_datalad + exemplars_dir + exemplars_tsv + min_group_size + force_unlock + """ + # Run directly from python using + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=use_datalad) + if use_datalad: + if not bod.is_datalad_clean(): + raise Exception( + "Untracked changes. Need to save " + + str(bids_dir) + + " before coyping exemplars" + ) + bod.copy_exemplars( + str(exemplars_dir), + str(exemplars_tsv), + min_group_size=min_group_size, + ) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids:ro" + exemplars_dir_link = str(exemplars_dir.absolute()) + ":/exemplars:ro" + exemplars_tsv_link = str(exemplars_tsv.absolute()) + ":/in_tsv:ro" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + exemplars_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "-v", + exemplars_tsv_link, + "--entrypoint", + "cubids-copy-exemplars", + container, + "/bids", + "/exemplars", + "/in_tsv", + ] + + if force_unlock: + cmd.append("--force-unlock") + if min_group_size: + cmd.append("--min-group-size") + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + "-B", + exemplars_dir_link, + "-B", + exemplars_tsv_link, + container, + "cubids-copy-exemplars", + "/bids", + "/exemplars", + "/in_tsv", + ] + if force_unlock: + cmd.append("--force-unlock") + + if min_group_size: + cmd.append("--min-group-size") + + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def add_nifti_info(bids_dir, container, use_datalad, force_unlock): + """Add information from nifti files to the dataset's sidecars. + + Parameters + ---------- + bids_dir + container + use_datalad + force_unlock + """ + # Run directly from python using + if container is None: + bod = CuBIDS( + data_root=str(bids_dir), + use_datalad=use_datalad, + force_unlock=force_unlock, + ) + if use_datalad: + if not bod.is_datalad_clean(): + raise Exception("Untracked change in " + str(bids_dir)) + # if bod.is_datalad_clean() and not force_unlock: + # raise Exception("Need to unlock " + str(bids_dir)) + bod.add_nifti_info() + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids:ro" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "--entrypoint", + "cubids-add-nifti-info", + container, + "/bids", + ] + + if force_unlock: + cmd.append("--force-unlock") + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + container, + "cubids-add-nifti-info", + "/bids", + ] + if force_unlock: + cmd.append("--force-unlock") + + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def purge(bids_dir, container, use_datalad, scans): + """Purge scan associations. + + Parameters + ---------- + bids_dir + container + use_datalad + scans + """ + # Run directly from python using + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=use_datalad) + if use_datalad: + if not bod.is_datalad_clean(): + raise Exception("Untracked change in " + str(bids_dir)) + bod.purge(str(scans)) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids" + input_scans_link = str(scans.parent.absolute()) + ":/in_scans:ro" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "-v", + GIT_CONFIG + ":/root/.gitconfig", + "-v", + input_scans_link, + "--entrypoint", + "cubids-purge", + container, + "/bids", + input_scans_link, + ] + + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + "-B", + input_scans_link, + container, + "cubids-purge", + "/bids", + input_scans_link, + ] + logger.info("RUNNING: " + " ".join(cmd)) + if use_datalad: + cmd.append("--use-datalad") + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def remove_metadata_fields(bids_dir, container, fields): + """Delete fields from metadata. + + Parameters + ---------- + bids_dir + container + fields + """ + # Run directly from python + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=False) + bod.remove_metadata_fields(fields) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids:rw" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "--entrypoint", + "cubids-remove-metadata-fields", + container, + "/bids", + "--fields", + ] + fields + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + container, + "cubids-remove-metadata-fields", + "/bids", + "--fields", + ] + fields + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) + + +def print_metadata_fields(bids_dir, container): + """Print unique metadata fields. + + Parameters + ---------- + bids_dir + container + """ + # Run directly from python + if container is None: + bod = CuBIDS(data_root=str(bids_dir), use_datalad=False) + fields = bod.get_all_metadata_fields() + logger.info("\n".join(fields)) + sys.exit(0) + + # Run it through a container + container_type = _get_container_type(container) + bids_dir_link = str(bids_dir.absolute()) + ":/bids:ro" + if container_type == "docker": + cmd = [ + "docker", + "run", + "--rm", + "-v", + bids_dir_link, + "--entrypoint", + "cubids-print-metadata-fields", + container, + "/bids", + ] + elif container_type == "singularity": + cmd = [ + "singularity", + "exec", + "--cleanenv", + "-B", + bids_dir_link, + container, + "cubids-print-metadata-fields", + "/bids", + ] + logger.info("RUNNING: " + " ".join(cmd)) + proc = subprocess.run(cmd) + sys.exit(proc.returncode) diff --git a/docs/usage.rst b/docs/usage.rst index 1932b683d..e9277781d 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -56,15 +56,15 @@ Acquisition Groups are sets of subjects who's images belong to all the same Key Acquisition Group ~~~~~~~~~~~~~~~~~~ -We define an “Acquisition Group” as a collection of sessions across participants that contain the exact -same set of Key and Parameter Groups. Since Key Groups are based on the BIDS filenames—and therefore both -MRI image type and acquisition specific—each BIDS session directory contains images that belong to a set of -Parameter Groups. CuBIDS assigns each session––or set of Parameter Groups––to an Acquisition Group -such that all sessions in an Acquisition Group possesses an identical set of scan acquisitions and -metadata parameters across all image modalities present in the dataset. We find Acquisition Groups to be -a particularly useful categorization of BIDS data, as they identify homogeneous sets of sessions (not -individual scans) in a large dataset. They are also useful for expediting the testing of pipelines; if a -BIDS App runs successfully on a single subject from each Acquisition Group, one can be confident that it +We define an “Acquisition Group” as a collection of sessions across participants that contain the exact +same set of Key and Parameter Groups. Since Key Groups are based on the BIDS filenames—and therefore both +MRI image type and acquisition specific—each BIDS session directory contains images that belong to a set of +Parameter Groups. CuBIDS assigns each session––or set of Parameter Groups––to an Acquisition Group +such that all sessions in an Acquisition Group possesses an identical set of scan acquisitions and +metadata parameters across all image modalities present in the dataset. We find Acquisition Groups to be +a particularly useful categorization of BIDS data, as they identify homogeneous sets of sessions (not +individual scans) in a large dataset. They are also useful for expediting the testing of pipelines; if a +BIDS App runs successfully on a single subject from each Acquisition Group, one can be confident that it will handle all combinations of scanning parameters in the entire dataset. .. _summaryfile: @@ -112,7 +112,7 @@ Once the columns have been edited you can apply the changes to BIDS data using The changes in ``keyparam_edited_summary.csv`` will be applied to the BIDS data in ``/bids/dir`` and the new Key and Parameter groups will be saved to csv files starting with ``new_keyparam_prefix``. Note: -fieldmaps keygroups with variant parameters will be identified but not renamed. +fieldmaps keygroups with variant parameters will be identified but not renamed. @@ -139,31 +139,31 @@ Use ``cubids-group`` to generate your dataset's Key Groups and Parameter Groups: $ cubids-group FULL/PATH/TO/BIDS/DIR FULL/PATH/TO/v0 -This will output four files, including the summary and files tsvs described above, +This will output four files, including the summary and files tsvs described above, prefixed by the second argument ``v0``. -Applying changes +Applying changes ------------------ -The ``cubids-apply`` program provides an easy way for users to manipulate their datasets. -Specifically, ``cubids-apply`` can rename files according to the users’ specification in a tracked -and organized way. Here, the summary.tsv functions as an interface modifications; users can mark -``Parameter Groups`` they want to rename (or delete) in a dedicated column of the summary.tsv and +The ``cubids-apply`` program provides an easy way for users to manipulate their datasets. +Specifically, ``cubids-apply`` can rename files according to the users’ specification in a tracked +and organized way. Here, the summary.tsv functions as an interface modifications; users can mark +``Parameter Groups`` they want to rename (or delete) in a dedicated column of the summary.tsv and pass that edited tsv as an argument to ``cubids-apply``. Detecting Variant Groups ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Additionally, cubids-apply can automatically rename files in ``Variant Groups`` based on their -scanning parameters that vary from those in their Key Groups’ Dominant Parameter Groups. Renaming -is automatically suggested when the summary.tsv is generated from a cubids-group run, with the suggested -new name listed in the tsv’s “Rename Key Group” column. CuBIDS populates this column for all Variant -Groups—e.g., every Parameter Group except the Dominant one. Specifically, CuBIDS will suggest renaming -all non-dominant Parameter Group to include VARIANT* in their acquisition field where * is the reason -the Parameter Group varies from the Dominant Group. For example, when CuBIDS encounters a Parameter -Group with a repetition time that varies from the one present in the Dominant Group, it will automatically -suggest renaming all scans in that Variant Group to include ``acquisition-VARIANTRepetitionTime`` in their -filenames. When the user runs ``cubids-apply``, filenames will get renamed according to the auto-generated +Additionally, cubids-apply can automatically rename files in ``Variant Groups`` based on their +scanning parameters that vary from those in their Key Groups’ Dominant Parameter Groups. Renaming +is automatically suggested when the summary.tsv is generated from a cubids-group run, with the suggested +new name listed in the tsv’s “Rename Key Group” column. CuBIDS populates this column for all Variant +Groups—e.g., every Parameter Group except the Dominant one. Specifically, CuBIDS will suggest renaming +all non-dominant Parameter Group to include VARIANT* in their acquisition field where * is the reason +the Parameter Group varies from the Dominant Group. For example, when CuBIDS encounters a Parameter +Group with a repetition time that varies from the one present in the Dominant Group, it will automatically +suggest renaming all scans in that Variant Group to include ``acquisition-VARIANTRepetitionTime`` in their +filenames. When the user runs ``cubids-apply``, filenames will get renamed according to the auto-generated names in the “Rename Key Group” column in the summary.tsv Deleting a mistake @@ -171,7 +171,7 @@ Deleting a mistake To remove files in a Parameter Group from your BIDS data, you simply set the ``MergeInto`` value to ``0``. We see in our data that there is a strange scan that has a ``RepetitionTime`` of 12.3 -seconds and is also variant with respect to EffectiveEchoSpacing and EchoTime. We elect to remove this scan from +seconds and is also variant with respect to EffectiveEchoSpacing and EchoTime. We elect to remove this scan from our dataset because we do not want these parameters to affect our analyses. To remove these files from your BIDS data, add a ``0`` to ``MergeInto`` and save the new tsv as ``v0_edited_summary.tsv`` @@ -195,60 +195,60 @@ Applying these changes we would see: :file: _static/PNC_post_apply_summary.csv :widths: 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3 :header-rows: 1 - - + + Command line tools ------------------- With that brief introduction done, we can introduce the full gamut of ``CuBIDS`` command line tools: -.. autofunction:: cubids.cli.cubids_add_nifti_info -.. autofunction:: cubids.cli.cubids_apply -.. autofunction:: cubids.cli.cubids_copy_exemplars -.. autofunction:: cubids.cli.cubids_datalad_save -.. autofunction:: cubids.cli.cubids_group -.. autofunction:: cubids.cli.cubids_print_metadata_fields -.. autofunction:: cubids.cli.cubids_purge -.. autofunction:: cubids.cli.cubids_remove_metadata_fields -.. autofunction:: cubids.cli.cubids_undo -.. autofunction:: cubids.cli.cubids_validate +.. code-block:: bash + + cubids --help + +This will print the instructions for using the command line interface in your command line. + +.. argparse:: + :ref: cubids.cli._get_parser + :prog: cubids + :func: _get_parser Customizable configuration --------------------------- -``CuBIDS`` also features an optional, customizable, MRI image type-specific configuration file. -This file can be passed as an argument to cubids-group and cubids-apply using the ``–-config`` flag -and allows users to customize grouping settings based on MRI image type and parameter. Each ``Key Group`` -is associated with one (and only one) MRI image type, as BIDS filenames include MRI image type-specific values -as their suffixes. This easy-to-modify configuration file provides several benefits to curation. -First, it allows users to add and remove metadata parameters from the set that determines groupings. -This can be very useful if a user deems a specific metadata parameter irrelevant and wishes to collapse -variation based on that parameter into a single Parameter Group. Second, the configuration file allows -users to apply tolerances for parameters with numerical values. This functionality allows users to avoid -very small differences in scanning parameters (i.e., a TR of 3.0s vs 3.0001s) being split into different -``Parameter Groups``. Third, the configuration file allows users to determine which scanning parameters +``CuBIDS`` also features an optional, customizable, MRI image type-specific configuration file. +This file can be passed as an argument to cubids-group and cubids-apply using the ``–-config`` flag +and allows users to customize grouping settings based on MRI image type and parameter. Each ``Key Group`` +is associated with one (and only one) MRI image type, as BIDS filenames include MRI image type-specific values +as their suffixes. This easy-to-modify configuration file provides several benefits to curation. +First, it allows users to add and remove metadata parameters from the set that determines groupings. +This can be very useful if a user deems a specific metadata parameter irrelevant and wishes to collapse +variation based on that parameter into a single Parameter Group. Second, the configuration file allows +users to apply tolerances for parameters with numerical values. This functionality allows users to avoid +very small differences in scanning parameters (i.e., a TR of 3.0s vs 3.0001s) being split into different +``Parameter Groups``. Third, the configuration file allows users to determine which scanning parameters are listed in the acquisition field when auto-renaming is applied to ``Variant Groups``. Exemplar testing ----------------- -In addition to facilitating curation of large, heterogeneous BIDS datasets, ``CuBIDS`` also prepares -datasets for testing BIDS Apps. This portion of the ``CuBIDS`` workflow relies on the concept of the -Acquisition Group: a set of sessions that have identical scan types and metadata across all imaging -modalities present in the session set. Specifically, ``cubids-copy-exemplars`` copies one subject from each -Acquisition Group into a separate directory, which we call an ``Exemplar Dataset``. Since the ``Exemplar Dataset`` -contains one randomly selected subject from each unique Acquisition Group in the dataset, it will be a -valid BIDS dataset that spans the entire metadata parameter space of the full study. If users run -``cubids-copy-exemplars`` with the ``–-use-datalad`` flag, the program will ensure that the ``Exemplar Dataset`` -is tracked and saved in ``DataLad``. If the user chooses to forgo this flag, the ``Exemplar Dataset`` -will be a standard directory located on the filesystem. Once the ``Exemplar Dataset`` has been created, -a user can test it with a BIDS App (e.g., fMRIPrep or QSIPrep) to ensure that each unique set of scanning -parameters will pass through the pipelines successfully. Because BIDS Apps auto-configure workflows based -on the metadata encountered, they will process all scans in each ``Acquisition Group`` in the same way. By -first verifying that BIDS Apps perform as intended on the small sub-sample of participants present in the -``Exemplar Dataset`` (that spans the full variation of the metadata), users can confidently move forward -processing the data of the complete BIDS dataset. +In addition to facilitating curation of large, heterogeneous BIDS datasets, ``CuBIDS`` also prepares +datasets for testing BIDS Apps. This portion of the ``CuBIDS`` workflow relies on the concept of the +Acquisition Group: a set of sessions that have identical scan types and metadata across all imaging +modalities present in the session set. Specifically, ``cubids-copy-exemplars`` copies one subject from each +Acquisition Group into a separate directory, which we call an ``Exemplar Dataset``. Since the ``Exemplar Dataset`` +contains one randomly selected subject from each unique Acquisition Group in the dataset, it will be a +valid BIDS dataset that spans the entire metadata parameter space of the full study. If users run +``cubids-copy-exemplars`` with the ``–-use-datalad`` flag, the program will ensure that the ``Exemplar Dataset`` +is tracked and saved in ``DataLad``. If the user chooses to forgo this flag, the ``Exemplar Dataset`` +will be a standard directory located on the filesystem. Once the ``Exemplar Dataset`` has been created, +a user can test it with a BIDS App (e.g., fMRIPrep or QSIPrep) to ensure that each unique set of scanning +parameters will pass through the pipelines successfully. Because BIDS Apps auto-configure workflows based +on the metadata encountered, they will process all scans in each ``Acquisition Group`` in the same way. By +first verifying that BIDS Apps perform as intended on the small sub-sample of participants present in the +``Exemplar Dataset`` (that spans the full variation of the metadata), users can confidently move forward +processing the data of the complete BIDS dataset. In the next section, we'll introduce ``DataLad`` and walk through a real example. diff --git a/pyproject.toml b/pyproject.toml index 4378b5538..0c25e9bf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,17 +76,18 @@ maint = [ all = ["cubids[doc,maint,tests]"] [project.scripts] -cubids-group = "cubids.cli:cubids_group" -cubids-apply = "cubids.cli:cubids_apply" -cubids-purge = "cubids.cli:cubids_purge" -cubids-add-nifti-info = "cubids.cli:cubids_add_nifti_info" -cubids-copy-exemplars = "cubids.cli:cubids_copy_exemplars" -cubids-undo = "cubids.cli:cubids_undo" -bids-sidecar-merge = "cubids.cli:bids_sidecar_merge" -cubids-validate = "cubids.cli:cubids_validate" -cubids-datalad-save = "cubids.cli:cubids_datalad_save" -cubids-print-metadata-fields = "cubids.cli:cubids_print_metadata_fields" -cubids-remove-metadata-fields = "cubids.cli:cubids_remove_metadata_fields" +cubids = "cubids.cli:_main" +cubids-group = "cubids.cli:_enter_group" +cubids-apply = "cubids.cli:_enter_apply" +cubids-purge = "cubids.cli:_enter_purge" +cubids-add-nifti-info = "cubids.cli:_enter_add_nifti_info" +cubids-copy-exemplars = "cubids.cli:_enter_copy_exemplars" +cubids-undo = "cubids.cli:_enter_undo" +bids-sidecar-merge = "cubids.cli:_enter_bids_sidecar_merge" +cubids-validate = "cubids.cli:_enter_validate" +cubids-datalad-save = "cubids.cli:_enter_datalad_save" +cubids-print-metadata-fields = "cubids.cli:_enter_print_metadata_fields" +cubids-remove-metadata-fields = "cubids.cli:_enter_remove_metadata_fields" # # Hatch configurations