Donders-Institute / staff-scientists

The consultancy page for the DCCN staff scientists
https://staff-scientists-dccn.readthedocs.io
3 stars 1 forks source link

Converting nifti to bids format #18

Closed jamelink closed 2 years ago

jamelink commented 2 years ago

Describe the issue As part of a collaboration we get nifti-files that are not in bids format. We would like to convert these to bids-formatting (incl jsons etc.) both for reproducibility/standardisation reasons as well as compatibility with mriqc. This is also applicable to legacy datasets.

Describe yourself

  1. Jitse Amelink
  2. PhD candidate
  3. Language & Genetics, Max Planck & Statistics (PIs: Francks and Fisher) in Neuroimaging (PI: Beckmann)

Audience Anyone with nifti-data that is not in bids-format (so legacy datasets and collaborations).

Test data Contact Jitse

To Reproduce N/A

Expected behavior A function similar to/part of bidscoin that converts the data. E.g. nifti2bids -options (e.g. bidsmap)

Screenshots N/A

Environment and versions (please complete the following information):

Additional context If more info needed, please ask

robertoostenveld commented 2 years ago

It would help a lot if you would get a single original dicom file (as that has all header details). You could then use FieldTrip data2bids to rename/reorganize the nifti's to BIDS and to add the header details from the dicom (using cfg.dicomfile).

But perhaps Marcel has other/better ideas.

marcelzwiers commented 2 years ago

BIDScoin can also extract the info from a DICOM header, but I'm thinking of building a separate generic mechanism to load metadata from a file (not necessarily limited to DICOM) into BIDScoin's metadata table (which itself is saved in conjunction as a json sidecar file).

marcelzwiers commented 2 years ago

See e.g. the BIDScoin issue here

marcelzwiers commented 2 years ago

I added a new nibabel2bids plugin that can convert nifti source data to bids. Note that you have to enter the json meta data yourself (since it's not available in the nifti data). Example:

bidsmapper /project/foo/raw /project/foo/bids -p nibabel2bids