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

IntendedFor references fields that do not exist on dataset with multiple runs #138

Closed
aketchum15 opened this issue Aug 9, 2021 · 5 comments

Comments

@aketchum15
Copy link

aketchum15 commented Aug 9, 2021

as mentioned in this issue using the intendedFor field does not result in references to real files in the final sidecars.
when running on a dataset with multiple runs the intendedfor parsing will result in list of file names that do not include any run tags. For example I have 2 different functional datatypes each with 2 runs. The expected intended for list would be something similar to:
IntendedFor: ["func/sub-SUB_task-MID_run-01_bold.nii.gz", "func/sub-SUB_task-MID_run-02_bold.nii.gz", "func/sub-SUB_task-SSI_run-01_bold.nii.gz", "func/sub-SUB_task-SSI_run-02_bold.nii.gz" ]
but instead it results in:
IntendedFor: ["func/sub-SUB_task-SSI_bold.nii.gz", "func/sub-SUB_task-SSI_bold.nii.gz", "func/sub-SUB_task-MID_bold.nii.gz", "func/sub-SUB_task-MID_bold.nii.gz" ]

@aketchum15 aketchum15 changed the title IntendedFor references fiels that do not exist on dataset with multiple runs IntendedFor references fields that do not exist on dataset with multiple runs Sep 30, 2021
@Lestropie
Copy link

Bumping as my lab has encountered the same issue in our data.

@walkerped
Copy link

walkerped commented Dec 2, 2021

I'm also having issues with this. dcm2bids automatically adds the run tag if it finds that there are two runs for the same subject-session-task, but only adds a single entry to the intendedFor field, with no run label. Similarly, if a task is missing for a given subject-session dcm2bids is still adding an entry to the intendedFor field for the task to the fieldmap, resulting in the subject failing bids validator.

@arnaudbore
Copy link
Contributor

@Lestropie , @walkerped @aketchum15
This has been fixed 🎉 . Please check the master. A new release will come.

@bkossows
Copy link

hi @arnaudbore,
I think I've faced the same problem using the newest 3.1.1. My config file is as follows:

{
  "descriptions": [
    {
      "datatype": "anat",
      "suffix": "T1w",
      "criteria": {
        "SeriesDescription": "anat_t1w"
      }
    },
    {
      "id": "fmri",
      "datatype": "func",
      "suffix": "bold",
      "criteria": {
        "SeriesDescription": "task-fmri*"
      },
      "sidecar_changes": {
        "TaskName": "test"
      }
    },
    {
      "datatype": "fmap",
      "suffix": "epi",
      "criteria": {
        "SeriesDescription": "SpinEchoFieldMap*"
      },
      "sidecar_changes": {
        "intendedFor": ["fmri"]
      }
    }
  ]
}

I've got to runs of the same task:

sub-B352/
├── anat
│   ├── sub-B352_T1w.json
│   └── sub-B352_T1w.nii.gz
├── fmap
│   ├── sub-B352_dir-AP_epi.json
│   ├── sub-B352_dir-AP_epi.nii.gz
│   ├── sub-B352_dir-PA_epi.json
│   └── sub-B352_dir-PA_epi.nii.gz
└── func
    ├── sub-B352_task-fmri_run-01_bold.json
    ├── sub-B352_task-fmri_run-01_bold.nii.gz
    ├── sub-B352_task-fmri_run-02_bold.json
    └── sub-B352_task-fmri_run-02_bold.nii.gz

but my field map would not be applied to the 2nd session: "intendedFor": "bids::sub-B352/func/sub-B352_task-fmri_run-01_bold.nii.gz"}. I'd need to provide separate configs and ids for each run, then it works fine.

@arnaudbore
Copy link
Contributor

@bkossows ,

I fixed this issue in the master but not released yet.
Please give it a try 👍
I should release a new version by the end of the year or begining of the next one.

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

No branches or pull requests

5 participants