bids-specification icon indicating copy to clipboard operation
bids-specification copied to clipboard

CBV and variable TR

Open chrisgorgo opened this issue 6 years ago • 13 comments

I recently received the following anonymus feedback:

I used unconventional CBV-fMRI data and I found the BIDS validator quite strict and in order to pass it. I had to fake some header values that are actually not right (I use variable TRs)

I am not a CBV expert, but I know that the spec does not currently support variable TR. @TheChymera you know much more about CBV - perhaps you could propose how we can extend the spec to support such case?

It would be also nice to hear from @melanieganz since variable TR is something that often happens in PET.

chrisgorgo avatar Feb 14 '19 19:02 chrisgorgo

Variable TRs should be achievable with the VolumeTiming metadata field. That was added to account for sparsely acquired fMRI (in particular, clustered volume acquisition (CVA), which can't be easily handled by RepetitionTime + DelayTime). Therefore it also requires AcquisitionDuration (or SliceTiming so TA can be calculated). I don't know if this suits CBV, but it may be that some of these constraints can be relaxed for CBV without adversely affecting our ability to represent sparse sequences.

effigies avatar Feb 14 '19 22:02 effigies

Perhaps the solution would be:

  1. Write an example of variable TR in context of CBV in the spec
  2. Make sure the validator treats variable TR cases correctly (perhaps we should also specify what pixdim[4] should be set to in such case

chrisgorgo avatar Feb 14 '19 22:02 chrisgorgo

In the PET-BIDS we handle different frame timings in the following way. We have a field in the .json associated with the PET that is called Time, where we besides ScanStart and its units also have a field with FrameTimes where we give start and end of the frame in specified units. You can see an example of the whole json here on OpneNeuro https://openneuro.org/datasets/ds001420/versions/1.0.0 under sub-01/ses-01/pet

Does this answer your question?

For the OpenNeuro upload I just used a .bidsignore for PET sofar since there doesn't exist a validator yet, but hoepfully coming soon.

Example:

"Time": { "ScanStart": ["10:33:47"], "ScanStartUnits": ["hh:mm:ss"], "FrameTimes": { "Labels": ["frameStart", "frameEnd"], "Units": ["s", "s"], "Values": [ [0, 10], [10, 20], [20, 30],.....

melanieganz avatar Feb 15 '19 08:02 melanieganz

It looks like the two things that this adds over VolumeTiming are ScanStart and the possibility of frame acquisition durations (I assume a frame is a volume in this context?) varying independently from the inter-frame interval. I wonder if we could permit AcquisitionDuration to take the following three values:

  1. Single value - constant acquisition duration
  2. List with length matching VolumeTiming
  3. Absent - equivalent to 2 such that AcquisitionDuration[n] = VolumeTiming[n+1] - VolumeTiming[n]

It occurs to me to ask: is (2) ever a real case in PET or CBV? That is, are all scans either continuous or constant acquisition duration?

effigies avatar Feb 15 '19 17:02 effigies

In PET we often have varying frame times ranging from a few seconds to several minutes. The reason the PET BIDS used also frameStart and End is that those numbers are usually used in subsequent kinetic modeling and hence are just easy to keep in this format.

melanieganz avatar Feb 15 '19 17:02 melanieganz

Regarding CBV, it should behave just as BOLD does in relation to TR. As I have mentioned before, it's simply another contrast.

However, I would expect _cbv to just fail right now, since I have only recently added it to the specification repo, and have not contributed anything relating to it to the BIDS validator package. I was thinking that it would get picked up whenever a new version of the standard gets released for the BIDS validator. If I need to include this support myself, please let me know where/how.

TheChymera avatar Feb 16 '19 06:02 TheChymera

However, I would expect _cbv to just fail right now, since I have only recently added it to the specification repo, and have not contributed anything relating to it to the BIDS validator package. I was thinking that it would get picked up whenever a new version of the standard gets released for the BIDS validator.

That is a very good point. _cbv is currently not supported by the validator. This means the anonymous user who provided the feedback must've used (an incorrect) bold suffix.

If I need to include this support myself, please let me know where/how. This should be relatively straightforward:

You will need to add _cbv (nii, nii.gz and json) lines here:

https://github.com/bids-standard/bids-validator/blob/b2f0dd3e6a37eb6caa2df0e0b16f535942636536/bids-validator/bids_validator/rules/file_level_rules.json#L143

The validator will then accept the files, but will not apply the same checks as to bold files. If you have an appetite for such change I can also walk you thorugh it. Thank you for your contribution.

chrisgorgo avatar Feb 19 '19 18:02 chrisgorgo

@chrisfilo Yes, let me know how I can bring CBV checks up to scratch.

TheChymera avatar Feb 25 '19 04:02 TheChymera

I think the next step is to find places in the validator where specific checks are applied to _bold nifti and json files and get them to work with _cbv when applicable. Here is an example: https://github.com/bids-standard/bids-validator/blob/b2f0dd3e6a37eb6caa2df0e0b16f535942636536/bids-validator/validators/headerFields.js#L90

chrisgorgo avatar Feb 26 '19 01:02 chrisgorgo

The latest developmental release of dcm2niix now supports FrameTimesStart and many other features described in BEP009. However, I am not familiar with this modality, and have access to only a few scans. It would be great if people who have DICOM PET data could validate this developmental release and identify any limitations of my current implementation. I have tried to support this BEP to the full extent given my limited knowledge and exemplars.

neurolabusc avatar Aug 13 '20 12:08 neurolabusc

pinging @melanieganz @mnoergaard

franklin-feingold avatar Aug 13 '20 16:08 franklin-feingold

@melanieganz and @mnoergaard have already helped tremendously. Not all sites have DICOM (many use ECAT), and many centers are unable to share sample images.

neurolabusc avatar Aug 13 '20 17:08 neurolabusc

BIDS now supports arrays for RepetitionTimeExcitation and RepetitionTimePreparation, so I think all we need to do is allow the cbv suffix to use those fields.

tsalo avatar Sep 18 '25 13:09 tsalo