Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmap issue #514

Draft
wants to merge 454 commits into
base: main
Choose a base branch
from
Draft

fmap issue #514

wants to merge 454 commits into from

Conversation

CPernet
Copy link
Contributor

@CPernet CPernet commented Jan 30, 2023

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

[FIX & ENH] filter transformers apply to all inputs & basic transformer can act on specific rows
[FIX & ENH] coerce several elements of the bids stats models
[ENH] improve bids.Description constructor
[FIX] fix printing of windows path
@Remi-Gau
Copy link
Collaborator

I only see the participants.tsv.
Were by any chance the truncated files git ignored?

@Remi-Gau
Copy link
Collaborator

You may have to use git add --force given this gitignore

https://github.com/bids-standard/bids-matlab/blob/dev/demos/.gitignore

@CPernet
Copy link
Contributor Author

CPernet commented Jan 30, 2023

OMG - yes, forced add and push, it's finally there

@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Jan 30, 2023

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) 

@Remi-Gau
Copy link
Collaborator

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'       }

@Remi-Gau
Copy link
Collaborator

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'       }

@Remi-Gau
Copy link
Collaborator

If you want to stick to the schema, then this would require updating the spec by adding the dir entity for all fieldmaps.

@CPernet
Copy link
Contributor Author

CPernet commented Jan 30, 2023

might relate to bids-standard/bids-specification#1391

@CPernet
Copy link
Contributor Author

CPernet commented Jan 30, 2023

i see that, although dir- should really be allowed any where, donæt you think

@Remi-Gau
Copy link
Collaborator

Let's say I would not be shocked to have it added to many mri datatype instead of letting acq do the heavy lifting.

@Remi-Gau
Copy link
Collaborator

Will probably switch this PR to draft until we see things more clearly on this front, it that is ok with you?

@CPernet
Copy link
Contributor Author

CPernet commented Jan 30, 2023

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

@CPernet
Copy link
Contributor Author

CPernet commented Jan 30, 2023

yes

@Remi-Gau Remi-Gau marked this pull request as draft February 2, 2023 23:09
@CPernet
Copy link
Contributor Author

CPernet commented May 2, 2023

not AP-PA field maps are in SPM dev (testing it) so we should add them @gllmflndn

@Remi-Gau Remi-Gau changed the base branch from dev to main November 20, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants