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

Importing BIDS dataset #77

Closed dkp closed 1 year ago

dkp commented 1 year ago

I was excited to see that ezBIDS allows me to import BIDS datasets. I aimed to find an easy way to use the GUI to upload a bids directory to BrainLife.

I used a validated BIDS dataset created with Heudiconv (and therefore dcm2niix underneath). You can retrieve the dataset here: https://osf.io/m2dz7 The dataset includes IntendedFor fields for both the phasediff.json and the reverse polarity DWI images in the fmap directory. These are correctly specified as confirmed by the BIDS validator and by running fMRIprep and QSIprep.

I was somewhat disappointed that ezBIDS encountered so many difficulties importing a fully validated BIDS dataset:

I was surprised that there was no pass-through mechanism that would do something like:

Thanks for all your hard work!

dlevitas commented 1 year ago

Thanks for these helpful comments, @dkp!

Indeed, now that ezBIDS is interoperable with both brainlife.io and OpenNeuro, we've been meaning to incorporate a mechanism that assess a dataset's BIDS-compliance. If so, ezBIDS should skip its processing steps (i.e. web pages) and proceed directly to the Finalize page for transfer.

We can't commit to a timeline, but this is definitely something that would be useful to users, particularly for cases like yours. We'll keep you updated on this feature enhancement.

cc @anibalsolon

dlevitas commented 1 year ago

On second though, it might be better to still allow users to proceed through the steps, even though the data should all be accurate. In the event user wants to upload task events timing data for conversion to events.tsv format, or defacing of anatomical images.

dkp commented 1 year ago

Maybe there could be a choice. I'm glad it is on your roadmap though, because the command-line setup for uploading to brainlife is a bit difficult for anyone who isn't skilled with npm. Thank you.

francopestilli commented 1 year ago

hi @dkp thanks so much for your contribution here. I was wondering whether you were aware that the the Command Line Interface (CLI) of brainlife.io allows uploading BIDS datasets.

See here: https://brainlife.io/docs/cli/upload/

The command would like something like this:

bl bids upload --tag test --project 5b031990251f5200274d9cc4 -d my_bids_dir

Installing the CLI should be easy, enough: https://brainlife.io/docs/cli/install/

Let me know if this helps! And absolutely we will also improve ezBIDS!

dkp commented 1 year ago

Thank you @francopestilli! I have used the command line interface. However, I teach neuroimaging and I know that folks who are not that comfortable at the command line are going to have trouble with node and npm (it is not always as clean and flawless as the installation page implies, at least in my experience). That's why I was hunting for a GUI to do the same thing.

francopestilli commented 1 year ago

I see the use case. We will work on the GUI. Thanks for using brainlife for teaching.

If possible, please report issues on the CLI repository when you encounter them. Without that we cannot help/improve.

dlevitas commented 1 year ago

@dkp,

I've pushed a series of changes that allow ezBIDS users to upload BIDS-compliant data(sets). If ezBIDS determines that the uploaded data is BIDS-compliant according to the bids-validator (i.e. no validation errors generated), then several processing steps are altered/skipped. If any errors are found however; ezBIDS will not treat the data as BIDS-compliant.

You will still need to proceed through the web-pages; however, the BIDS information (data type, suffix, entity labels) from each image file is preserved, including information in the root level folder (e.g., dataset_description.json, participants.json, and participants.tsv), as well as IntendedFor mapping information.

Two things to note: 1). Any task events (events.tsv) files uploaded will currently not be converted. This will take me some time, given the workflows ezBIDS uses for converting users' task events files to BIDS' events.tsv format. 2). Lastly, uploaded BIDS-compliant data will still subject to ezBIDS' QA checks (e.g., checking to ensure that an IntendedFor mapping doesn't point to a field map), so there's the possibility that certain BIDS information could be modified if the QA checks determine it to be problematic.

I've tested this on several different BIDS-compliant datasets, and things appear to be working as expected, but let me know if you encounter any issues of your own.

dkp commented 1 year ago

I tried it and it was awesome! I can't thank you enough. This lowers to bar for exploring Brainlife.