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

Add option to revert to old behaviour of grouping scans across different acquisitions? #897

Open
michellewang opened this issue Dec 4, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@michellewang
Copy link

Summary

Hi, I have a dataset where some of the participants have multi-shell data split across multiple scans (one scan per b-value), and we used the acq entity to label them. For example the raw BIDS data would look something like this:

  1. sub-001_ses-1_acq-B0_dir-AP_run-01_dwi.nii.gz
  2. sub-001_ses-1_acq-B0_dir-AP_run-02_dwi.nii.gz
  3. sub-001_ses-1_acq-B0_dir-AP_run-03_dwi.nii.gz
  4. sub-001_ses-1_acq-B0_dir-AP_run-04_dwi.nii.gz
  5. sub-001_ses-1_acq-B0_dir-PA_run-01_dwi.nii.gz
  6. sub-001_ses-1_acq-B1000_dir-PA_run-01_dwi.nii.gz
  7. sub-001_ses-1_acq-B2000_dir-PA_run-01_dwi.nii.gz
  8. sub-001_ses-1_acq-B700_dir-PA_run-01_dwi.nii.gz

So there are four B0 scans in the AP direction, then 4 in the PA direction with b-values 0, 1000, 2000 and 700. All of them have accompanying .bval/.bvec files too.

PR #862 changed QSIPrep's behaviour to account for the acq tag during the distortion group definition. Unfortunately, this results in undesirable behaviour in 1.0.0rc1 in my case, where the scans are not being merged as expected. With 0.23.0 I was getting a single desc-preproc_dwi.nii.gz file, while with 1.0.0rc1 I am getting a desc-preproc_dwi.nii.gz file for each of the B1000, B2000, and B700 scans, and I think there was was an error for the B0 scans because only the JSON was produced (might be a related issue).

I understand the reasoning for grouping by acq, but would it be possible to add a flag that allows the user to revert to the old behaviour of ignoring the acq entity when defining the scan groups?

Happy to create a PR for this if you could point me to the parts of the code to change.

Additional details

Next steps

@michellewang michellewang added the enhancement New feature or request label Dec 4, 2024
@tsalo
Copy link
Member

tsalo commented Dec 5, 2024

@mattcieslak and I have been talking about it and we came to the conclusion that QSIPrep should use the MultipartID metadata field to define these kinds of groups.

The basic idea is that, if multiple DWI scans share a MultipartID value, then they will be combined. I don't think the ID applies across phase encoding directions, so in your case you would probably have two IDs: apgroup and pagroup (or something similar).

@michellewang
Copy link
Author

Ok, I think that makes sense, and modifying fields in JSON sidecars is easier than renaming files in BIDS, so that would be doable for my dataset too.

Since MultipartID is optional, what would the default behaviour be? Treat every scan as a separate group?

@tsalo
Copy link
Member

tsalo commented Dec 5, 2024

Yeah I think that should be the default behavior. I'm not 100% sure what QSIPrep will do with multiple scans that aren't delimited with acq and dir entities though. E.g., sub-01_run-01_dwi.nii.gz and sub-01_run-02_dwi.nii.gz.

@mattcieslak
Copy link
Collaborator

qsiprep relies on the phase encoding direction and total readout time in the sidecars to determine if the distortion is the same in a group of scans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants