brainlife / ezbids

A web service for semi-automated conversion of raw imaging data to BIDS
https://brainlife.io/ezbids
MIT License
26 stars 13 forks source link

PET integration #92

Closed dlevitas closed 8 months ago

dlevitas commented 1 year ago

Met earlier today with @bhatiadheeraj @bendhouseart @mnoergaard to discuss enabling PET conversion with ezBIDS. The biggest hurdle is identifying and enabling users to enter the relevant metadata information, as specified by BIDS. Complicating this problem is the fact that certain metadata fields (InjectedRadioactivity, InjectedMass, InjectedMassUnits, SpecificRadioactivity, etc) vary from sequence to sequence.

After discussions, there appear to be two valid ways forward.

1). Enable metadata spreadsheet injection with PET2BIDS. The format for such spreadsheets is as follows:

Once detected by PET2BIDS, all relevant and present metadata can be added to the sidecars if not detected within.

2). ezBIDS will parse the data sidecar(s) for the relevant metadata and alert users if required (and recommended?) metadata is missing. This can be partially done on the Series Mapping page (to save time), and on the Dataset Review page (for metadata fields that vary at the individual sequence level).

I feel that option 1 will best alleviate time for users, but we can build option 2 as a fail-safe (manual, but thorough).

@bendhouseart @mnoergaard: can you provide us a list of the metadata fields that vary from sequence to sequence?

bendhouseart commented 1 year ago

Per point 1, we've already got some documentation up concerning how to "best" format pet spreadsheets here.

And in response to your question, some of the fields that can vary between patient and scan are as follows:

InjectedRadioactivity
InjectedMass
SpecificRadioactivity
metabolite_parent_fraction
metabolite_polar_fraction
whole_blood_radioactivity
plasma_radioactivity
PlasmaFreeFraction
TimeZero
# note times below are relative to TimeZero
# they're often consistent but may vary across subjects/sessions
time
ScanStart
FrameTimesStart
InjectionStart
InjectionEnd

I'm not too sure about things like TubingType, TubingLength, etc as I personally haven't seen much data containing those measurements.

dlevitas commented 1 year ago

Thanks, @bendhouseart.

Currently, it's possible to use ezBIDS with PET data and get a BIDS dataset, though even when providing formatted spreadsheets (option 1), the validator throws several errors about certain metadata values not set with the correct type. This might be a pet2bids issue...

Will soon begin working on option 2.

bendhouseart commented 1 year ago

@dlevitas I would suggest running pet2bids with the --silent flag, it leads to improved mental health. I'm slowly chipping away at adding in the schema and other small quality of life fixes, however, just silencing the error messages and warnings is plenty considering you are following up the conversion with the bids-validator.

dlevitas commented 8 months ago

@bendhouseart I've aded additional PET support, mainly the ability to edit sidecar metadata.

dlevitas commented 8 months ago

@bendhouseart @mnoergaard

Given the recent PRs (#108 #110), ezBIDS now has BIDS conversion support for PET data. I will therefore go ahead and close this issue.

To summarize, the PET support consists of several features:

1). Support for both PET (NIfTI/JSON) and blood (JSON/TSV) data 2). Ability to upload DICOM, pypet2bids transformed data (e.g. NIfTI/JSON/TSV), and/or ECAT-formatted (.v, .v.gz) data 3). Improved JSON sidecar metadata support, including Excel spreadsheets, and/or ezBIDS metadata interface (organized according to the BIDS specification).

If any issues arise pertaining to PET BIDS conversion, a new issue can be opened.

mnoergaard commented 8 months ago

Many thanks for pushing these important efforts forward, @dlevitas and team!

mnoergaard commented 8 months ago

Just tested this locally and seems to be working like a charm! Fantastic! Great work @dlevitas and team!