Advice on fmri bids

60 views
Skip to first unread message

Aaron Tanenbaum

unread,
Jun 12, 2024, 12:49:15 PMJun 12
to bids-discussion
Hello Folks,
I am looking for some advice. I am in a lab that has a study going on for the past 20 years.  For the first half of the study our fMRI study had our participants close their eyes. At some point the MRI scanner we were using was upgraded from a Siemens Trio to a Prisma. Along with the scanner upgraded we upgraded our fMRI protocol from single band to multi band.  Finally, the biggest change we made when the scanner got upgraded was we went from eyes closed to eyes open for our resting states.  This last detail for me a doozy.  It's going to be hard to deal with this in a longitudinal study.  This is a subset of this study were participants on the same day were scanned on the new Prisma and another Trio machine in the facility with both eyes open and closed.

Now I have been instructed to convert our data to a BIDS format.  I will have the eyes open/closed state included in the metadata however I feel compelled to include this detail in the filenames of all the bold runs under task entity. I feel compelled because if the end user does not spend time looking over the metadata they may not notice.  it can easy find it's way into a publication.  However, we have other studies that were converted to bids a while ago and many colleagues want this detail omitted from the filenames to ensure compatibilities between studies.  To me this, a name change is a minor inconvenience.


What would you folks do?

Remi Gau

unread,
Jun 12, 2024, 3:35:30 PMJun 12
to bids-di...@googlegroups.com, Aaron Tanenbaum

Hey

Assuming that files were named something like:

  • sub-01_task-rest_run-1_bold.nii.gz

You could use the "acq" entity to specify this information: https://bids-specification.readthedocs.io/en/latest/appendices/entities.html#acq

  • sub-01_task-rest_acq-eyesopen-run-1_bold.nii.gz
  • sub-01_task-rest_acq-eyesclosed-run-1_bold.nii.gz

The may be stretching the "technical" definition of what the acq entity is for but I have seen worse.

In any case all studies would have the same "task" but you would still have some sign in the filename that they should expect differences.

HTH

Rémi

--
We are all colleagues working together to shape brain imaging for tomorrow, please be respectful, gracious, and patient with your fellow group members.
---
You received this message because you are subscribed to the Google Groups "bids-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bids-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/2eebcd27-235f-43a5-9aab-4efb191e93f2n%40googlegroups.com.

Aaron Tanenbaum

unread,
Jun 12, 2024, 7:28:44 PMJun 12
to bids-discussion
Remi,
This issue is not which entity to put this under. The issue is about them wanting the same file name. In essence, the want all bold runs to be ${sub}_${ses}_task-rest_run-${run}_bold.nii.gz

Aaron Tanenbaum

unread,
Jun 12, 2024, 7:28:44 PMJun 12
to bids-discussion
Remi,
Thank you for responding. I need a clarification, are your saying this detail should not be under task? Nevertheless, the issue is not what entity to use but the fact that the filename is changed. So they want the file name to be like sub-01_task-rest_run-1_bold.nii.gz. All other studies in our lab use this conversion. However they do not have this issue with half the sessions collected with eyes closed and the other eyes open.

On Wednesday, June 12, 2024 at 2:35:30 PM UTC-5 Remi Gau wrote:

Remi Gau

unread,
Jun 13, 2024, 4:14:21 AMJun 13
to bids-di...@googlegroups.com, Aaron Tanenbaum

> the fact that the filename is changed

But the filename DOES anyway change from one subject to another because the subject label changes

> are your saying this detail should not be under task?

Pretty much because then most of the tools that you can use to easy access your data like pybids or bids-matlab will be able to "filter" by task only or by task and acq.

---

If your lab is switching to  BIDS, there can be added value to start using those tools as they are exactly made for this.

Quick example with bids-matlab (pybids can do the same, no problem) on an example dataset that contains resting state data with different "acq" entity

https://github.com/bids-standard/bids-examples/tree/master/7t_trt

Index the data

>> layout = bids.layout(fullfile(pwd, 'tests', 'bids-examples', '7t_trt'))
layout =
  struct with fields:

              pth: '/home/remi/github/bids/matlab/tests/bids-examples/7t_trt'
      description: [1×1 struct]
         sessions: {}
     participants: [1×1 struct]
        phenotype: [1×1 struct]
         subjects: [1×66 struct]
             root: [0×0 struct]
    is_datalad_ds: 0

List data files for one subject for resting state

>> bids.query(layout, 'data', 'task', 'rest', 'sub', '01', 'suffix', 'bold')
ans =
  6×1 cell array
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-1/func/sub-01_ses-1_task-rest_acq-fullbrain_run-1_bold.nii.gz'}
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-1/func/sub-01_ses-1_task-rest_acq-fullbrain_run-2_bold.nii.gz'}
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-1/func/sub-01_ses-1_task-rest_acq-prefrontal_bold.nii.gz'     }
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-2/func/sub-01_ses-2_task-rest_acq-fullbrain_run-1_bold.nii.gz'}
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-2/func/sub-01_ses-2_task-rest_acq-fullbrain_run-2_bold.nii.gz'}
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-2/func/sub-01_ses-2_task-rest_acq-prefrontal_bold.nii.gz'     }

List data files for one subject for resting state ONLY for a given acq

>> bids.query(layout, 'data', 'task', 'rest', 'sub', '01', 'suffix', 'bold', 'acq', 'prefrontal')
ans =
  2×1 cell array
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-1/func/sub-01_ses-1_task-rest_acq-prefrontal_bold.nii.gz'}
    {'/home/remi/github/bids/matlab/tests/bids-examples/7t_trt/sub-01/ses-2/func/sub-01_ses-2_task-rest_acq-prefrontal_bold.nii.gz'}
 

HTH

Rémi

Aaron Tanenbaum

unread,
Jun 13, 2024, 10:06:25 AMJun 13
to bids-discussion
First let me get back to my original question let me rephrase it. In the spirit of bid conversion would it be more appropriate  to have eye open and closed in the files regards of which entity it should go under. Would future collaborators be more annoyed if it was omitted from filename. This is more of a question directed at the community.

Second, you said
"> are your saying this detail should not be under task?
Pretty much because then most of the tools that you can use to easy access your data like pybids or bids-matlab will be able to "filter" by task only or by task and acq."

Your post implies that the existing software can find the scans I want by using task or acq, so I am a bit confused. I am not sure if I want to use any of these packages I am still new to bids but have been processing fMRI for 10 years and I can write any program to grab the data. My question is more towards to the bids conversion, is it a task or acq.

Cook, Philip

unread,
Jun 13, 2024, 10:14:17 AMJun 13
to bids-di...@googlegroups.com

IMO if you change what the participant should be doing during the acquisition, it's a different task. If you change what the scanner is doing, it's a different acq.

 

tibor...@gmail.com

unread,
Jun 13, 2024, 10:17:39 AMJun 13
to bids-di...@googlegroups.com

Another food for thought: If a particular condition covers all the session, you may consider dividing your dataset into sessions; especially if the same participants underwent both conditions. However, if different participants were included in different sessions, then you may rather create two separate datasets, because the number of use cases combining them might be very limited.

 

Kind regards,

Tibor

 

Dr Tibor Auer, MD, PhD, FHEA

tibor...@gmail.com

+44-7906-863837

LinkedIn: tibor-auer

dan.handwerker

unread,
Jun 13, 2024, 10:21:41 AMJun 13
to bids-discussion
Hi Aaron,

I'm going to gently push against the initial framing of your question. You are rightfully concerned that you have a study where several things have changes and people will pull the data without being aware of the key differences. Eyes open/closed is one change, but changing scanners and pulse sequences may non-trivally affect noise and artifact properties in the data and can potentially bias analyses. It sounds like the the change from eyes close/open happened with a protocol change which would be "acq". I'm less of a BIDS notation expert, so others might correct me on proper BIDS notation, but I'd recommend something like:
  • sub-01_task-rest_acq-paradigm1-run-1_bold.nii.gz
  • sub-02_task-rest_acq-paradigm1-run-1_bold.nii.gz
  • sub-03_task-rest_acq-paradigm1-run-1_bold.nii.gz
  • ...
  • sub-50_task-rest_acq-paradigm2-run-1_bold.nii.gz
  • sub-51_task-rest_acq-paradigm2-run-1_bold.nii.gz
  • sub-52_task-rest_acq-paradigm2-run-1_bold.nii.gz
  • ...
  • sub-100_task-rest_acq-paradigm3-run-1_bold.nii.gz
  • sub-101_task-rest_acq-paradigm3-run-1_bold.nii.gz
  • sub-102_task-rest_acq-paradigm3-run-1_bold.nii.gz
That is, if the worry is that people won't search for differences in the json files, then mark all the key changes in paradigms in the file names. In the study description json file, you could also have a narrative description of the key changes (including eyes open/closed) with each change in paradigm.

Hope this helps

Dan

Aaron Tanenbaum

unread,
Jun 13, 2024, 10:38:41 AMJun 13
to bids-di...@googlegroups.com
Excellent, I wanted to point out that we do have a small subset of the data where on the same day the participants were scanned on both the new prisma and a trio in the same facility.  This happened just after the upgrade, For the trio scans, participants alternated between eyes open and closed during that session. Not sure if we did that for the Prisma.  So it may be wise to use both task and acq.

I am not sure if the boss would like breaking the dataset into two. Finally there is strong evidence that  there is an interaction between eyes open/closed and what we are studying but an interaction between what we are studying and scanner/sequence change is highly unlikely. This interaction may be a future paper.

You received this message because you are subscribed to a topic in the Google Groups "bids-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bids-discussion/DFE495axhL0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bids-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/bbd84e4d-8fab-4c65-ae5f-788b05dd6edfn%40googlegroups.com.

Earl, Eric (NIH/NIMH) [C]

unread,
Jun 13, 2024, 10:42:53 AMJun 13
to bids-di...@googlegroups.com

Hi,

 

For my 2 cents, it is a different fMRI task and calls for a slightly different “fMRI task information” in the task-resteyesopen_bold.json or task-resteyesclosed_bold.json which you can place at the top of the BIDS tree for lower files to inherit (thanks to the inheritance principle).

 

https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetic-resonance-imaging-data.html#fmri-task-information

 

https://bids-specification.readthedocs.io/en/stable/common-principles.html#the-inheritance-principle

 

P.S. I think Rémi was just advocating for “some” difference in filename to annotate the fact that they are not equivalent “tasks” or “acquisitions” (in the broader sense of the term). Rémi, please do correct me if I’m wrong and you felt more strongly about using acq- for a different task-.

 

Warm regards,

 

Eric Earl [C]

Scientist

 

eric...@nih.gov

(503) 752-8549

 

NIMH IRP Data Science & Sharing Team

https://cmn.nimh.nih.gov/dsst

Google Scholar Profile

https://scholar.google.com/citations?user=8IwbaOcAAAAJ

Book a meeting

https://calendly.com/ericearl

To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/MN2PR04MB68306A4819E892DD19443934E6C12%40MN2PR04MB6830.namprd04.prod.outlook.com.

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and are confident the content is safe.

 

Aaron Tanenbaum

unread,
Jun 13, 2024, 10:42:53 AMJun 13
to bids-di...@googlegroups.com
Sorry I posted response twice because the first one did appear to post.  I guess there a large delay

You received this message because you are subscribed to a topic in the Google Groups "bids-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bids-discussion/DFE495axhL0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bids-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/c4e234b5-05aa-42e2-a02a-81f544bde6e5n%40googlegroups.com.

tibor...@gmail.com

unread,
Jun 13, 2024, 10:57:40 AMJun 13
to bids-di...@googlegroups.com

It seems to me that there should be three datasets:

  1. Trio only with eyes closed. It is a single session, single condition dataset, where the condition eyes closed can go to task-rest.json.
  2. Prisma and Trio with eyes closed and eyes open. Here, Prisma and Trio should be sessions (also based on BIDS’s convention), while eyes closed and eyes open should be ‘tasks’.
  3. Prisma with eyes open. It is a single session, single condition dataset, where the condition eyes open can go to task-rest.json.

 

Kind regards,

Tibor

 

Dr Tibor Auer, MD, PhD, FHEA

tibor...@gmail.com

+44-7906-863837

LinkedIn: tibor-auer

 

Chris Markiewicz

unread,
Jun 13, 2024, 11:01:34 AMJun 13
to bids-discussion
> I am not sure if the boss would like breaking the dataset into two. Finally there is strong evidence that  there is an interaction between eyes open/closed and what we are studying but an interaction between what we are studying and scanner/sequence change is highly unlikely.

From your description, these are effectively two entirely separate studies with a highly overlapping cohort. Any effect you show that differs between eyes open/closed is going to be confounded by scanner and acquisition protocol, and I doubt there's a way to account for batch effects without washing out the effect of interest.

The desire to name these scans equivalently appears to be leading to a result where the differences will be easily overlooked and may go unaccounted for during analysis. I think your options are pushing back now or vigilantly checking every analysis to make sure the differences aren't being elided.

Best,
Chris

dan.handwerker

unread,
Jun 13, 2024, 1:39:15 PMJun 13
to bids-discussion
Now I'll gently push back on some of the BIDS maintainers. Studies with a range of acquisition parameters are common. This is particularly true for longitudinal studies. I'd go as far to say almost every longitudinal study that lasts more than 5 years has potentially non-trivial parameter changes. If the experiment's designers say data are from a single study, artificially dividing the data into multiple studies for the sake of BIDS compliance is not ideal. Whether it's a recommendation for how to apply existing BIDS naming conventions or a tweak of naming conventions, there really needs to be clear way to annotate changes like this within a study.

For Aaron: "Finally there is strong evidence that  there is an interaction between eyes open/closed and what we are studying but an interaction between what we are studying and scanner/sequence change is highly unlikely." I guarantee those acquisition changes affected results. Just switching from single-band to multi-band will affect your temporal-signal-to-noise and types of spatial and temporal artifacts in your data. For a correlation-based metric that's sensitive to TSNR, you will likely see a brain-wide shift in mean correlation magnitudes. It might be less structured than the eyes close/open difference, but I wouldn't be surprised if it's bigger. If you want to highlight eyes close/open you'll definitely also want to highlight these acquisition parameter changes.

Best

Dan

Mark Mikkelsen

unread,
Jun 15, 2024, 4:09:10 PMJun 15
to bids-discussion
Hi Dan,

You make a great point about changes to parameters over time for longitudinal studies. This happens—upgrades to scanners are a big one. But wouldn't (shouldn't) these be documented in the README.md and CHANGES files anyway? And I feel it's up to third-party users of shared datasets to read these files so they know what exactly may have changed.

Also, if parameters and scanner software/hardware change over time and they are non-trivial changes, then this fundamentally changes the study in itself from a scientific standpoint. So, I agree with Chris and others here that these changes have to be clearly differentiated in the filenames, as the differences could be easily overlooked.

Best,
Mark

dan.handwerker

unread,
Jun 15, 2024, 10:35:41 PMJun 15
to bids-discussion
Hi Mark,

I'm fine with these being noted in file names (and I suggested an possible approach above). I'm just advising against the proposed options to divide this into different studies for each parameter set.

FWIW, I'm not sure if this already exists, but this points to the benefits of a `diff` BIDS app that would identify and summarize acquisition parameter and task condition fields that are different within a study. That way differences, like the ones discussed here could be brought to the surface for data-users even if the data-sharers didn't highlight them using the README or file names.

Best

Dan

Dan Lurie

unread,
Jun 18, 2024, 5:33:25 PMJun 18
to bids-discussion
On Jun 15, 2024, 19:35 -0700, dan.handwerker <dan.han...@gmail.com>, wrote:
FWIW, I'm not sure if this already exists, but this points to the benefits of a `diff` BIDS app that would identify and summarize acquisition parameter and task condition fields that are different within a study. That way differences, like the ones discussed here could be brought to the surface for data-users even if the data-sharers didn't highlight them using the README or file names.
Harsh Sinha and Pradeep Raamana recently came out with a package which tries to get at this (mrQA: https://www.biorxiv.org/content/10.1101/2023.07.17.548591v2.fullhttps://github.com/Open-Minds-Lab/mrQA). It’s aimed at checking for deviations from planned scan protocols but outputs tables which summarize the various acquisition parameters and how they vary across a dataset. It can read directly from DICOMs or a NIfTI BIDS dataset. Paper has an example application to the ABCD study.

Dan

Dan Lurie, PhD
www.danlurie.org

Cook, Philip

unread,
Jun 18, 2024, 6:02:42 PMJun 18
to bids-di...@googlegroups.com
For NIFTI bids data, There’s also CUBIDS by Sydney Covitz and colleagues

https://cubids.readthedocs.io/en/latest/


On Jun 18, 2024, at 5:33 PM, Dan Lurie <danj...@gmail.com> wrote:


You don't often get email from danj...@gmail.com. Learn why this is important
Reply all
Reply to author
Forward
0 new messages