bids-matlab
bids-matlab copied to clipboard
fmap issue
under demos/fmap_failexemple 3 subjects for which all files do not populate -- have figured why -- note my bad, this includes the 'old' suggested change about the trial type on the face rep data set
I only see the participants.tsv. Were by any chance the truncated files git ignored?
You may have to use git add --force given this gitignore
https://github.com/bids-standard/bids-matlab/blob/dev/demos/.gitignore
OMG - yes, forced add and push, it's finally there
Will try to documment the debugging in the PR.
dir 'entity' is unknown for several fmaps
>> BIDS = bids.layout(pwd, 'verbose', true, 'use_schema', true)
Indexing dataset:
/home/remi/github/bids/matlab/demos/fmap_failexemple
Indexing subject: sub-55809 [.]
Indexing subject: sub-57460 [.Warning:
Skipping file: sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_magnitude1.nii.gz.
Unknown entities: 'dir'
Try using the parameter: " 'use_schema', false "
> In bids.internal.error_handling (line 57)
In bids.internal.append_to_layout (line 112)
In bids.layout>parse_using_schema (line 410)
In bids.layout>parse_subject (line 351)
In bids.layout (line 188)
According to the spec only pepolar fmap support the dir entity
https://bids-specification.readthedocs.io/en/latest/modality-specific-files/magnetic-resonance-imaging-data.html#types-of-fieldmaps
https://bids-specification.readthedocs.io/en/latest/modality-specific-files/magnetic-resonance-imaging-data.html#case-4-multiple-phase-encoded-directions-pepolar
Quick work around for now is to ask bids-matlab to index without relying on the schema.
>> BIDS = bids.layout(pwd, 'verbose', true, 'use_schema', false)
Indexing dataset:
/home/remi/github/bids/matlab/demos/fmap_failexemple
Indexing subject: sub-55809 [.]
Indexing subject: sub-57460 [..]
Indexing subject: sub-57507 [.]
BIDS =
struct with fields:
pth: '/home/remi/github/bids/matlab/demos/fmap_failexemple'
description: [1×1 struct]
sessions: {}
participants: [1×1 struct]
subjects: [1×4 struct]
root: [0×0 struct]
is_datalad_ds: 0
>> bids.query(BIDS, 'data')
ans =
18×1 cell array
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-55809/ses-Baseline/fmap/sub-55809_ses-Baseline_acq-se_dir-AP_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-55809/ses-Baseline/fmap/sub-55809_ses-Baseline_acq-se_dir-PA_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_magnitude1.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_magnitude2.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_magnitude1.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_magnitude2.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-AP_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-AP_run-2_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-PA_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-PA_run-2_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_magnitude1.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_magnitude2.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_magnitude1.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_magnitude2.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_phasediff.nii.gz' }
other queries seem to work fine after that.
@CPernet can you cross check that if you do not use the schema, for indexing you can query the files you need?
>> BIDS = bids.layout(pwd, 'verbose', true, 'use_schema', false)
Indexing dataset:
/home/remi/github/bids/matlab/demos/fmap_failexemple
Indexing subject: sub-55809 [.]
Indexing subject: sub-57460 [..]
Indexing subject: sub-57507 [.]
BIDS =
struct with fields:
pth: '/home/remi/github/bids/matlab/demos/fmap_failexemple'
description: [1×1 struct]
sessions: {}
participants: [1×1 struct]
subjects: [1×4 struct]
root: [0×0 struct]
is_datalad_ds: 0
>> bids.query(BIDS, 'data')
ans =
18×1 cell array
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-55809/ses-Baseline/fmap/sub-55809_ses-Baseline_acq-se_dir-AP_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-55809/ses-Baseline/fmap/sub-55809_ses-Baseline_acq-se_dir-PA_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_magnitude1.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_magnitude2.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-AP_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_magnitude1.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_magnitude2.nii.gz'}
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-1wkfollowup/fmap/sub-57460_ses-1wkfollowup_acq-gre_dir-LR_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-AP_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-AP_run-2_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-PA_run-1_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57460/ses-Baseline/fmap/sub-57460_ses-Baseline_acq-se_dir-PA_run-2_epi.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_magnitude1.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_magnitude2.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-AP_run-1_phasediff.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_magnitude1.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_magnitude2.nii.gz' }
{'/home/remi/github/bids/matlab/demos/fmap_failexemple/sub-57507/ses-Baseline/fmap/sub-57507_ses-Baseline_acq-gre_dir-LR_run-1_phasediff.nii.gz' }
If you want to stick to the schema, then this would require updating the spec by adding the dir entity for all fieldmaps.
might relate to https://github.com/bids-standard/bids-specification/issues/1391
i see that, although dir- should really be allowed any where, donæt you think
Let's say I would not be shocked to have it added to many mri datatype instead of letting acq do the heavy lifting.
Will probably switch this PR to draft until we see things more clearly on this front, it that is ok with you?
tagged you in the bids validator issue -- the entitiy says you can, and it silly to have acq-se_dir-AP valid but acq-gre_dir-AP invalid
yes
not AP-PA field maps are in SPM dev (testing it) so we should add them @gllmflndn