nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
630 stars 292 forks source link

Processing Error #688

Closed ddshin closed 7 years ago

ddshin commented 7 years ago

I converted the recently acquired fMRI/DTI/T1/T2/TOPUP data set into BIDS format. The images were acquired on a GE 3T MR 750 scanner with standard product sequences. The set appears to pass the validation step okay (see below).

screen shot 2017-08-31 at 2 39 56 pm

I ran fMRIprep BIDS-app on the data using a Mac and ended up getting the following error:

screen shot 2017-08-31 at 4 43 04 pm

Any idea what is causing this error?

chrisgorgo commented 7 years ago

This is probably a better place to report this issue. Someone will get back to you soon. I

You try to run poldracklab/fmriprep docker image instead of bids/fmriprep to try the latest version.

jdkent commented 7 years ago

My current best guess is fmriprep is trying to use more memory than your machine has. If that's the case, try adding --low-mem to your fmriprep command. How much ram is on your mac/how much memory do you allow docker to use?

ddshin commented 7 years ago

Thanks for your prompt response. My Mac has 16GB of memory but it looks like my docker is only provisioned with 2GB (good catch!). I will try again both on my Mac and on a Linux server, then report back!

jdkent commented 7 years ago

np! glad you're using fmriprep. If your docker installation is only provisioned 2gb, you can change it so it has access to at least 8gb (necessary for fmriprep), or to your machine's full 16gb. so the --low-mem wouldn't be necessary. If you click on the docker app and click preferences, you can change the default amount of memory docker has access to.

effigies commented 7 years ago

As an added comment, we recommend using the fmriprep-docker wrapper. In addition to simplifying invocation, it also does some basic checks, including verifying that Docker is configured to allocate at least 8GB of RAM and warning users, otherwise.

The simplest way to use this is pip install --upgrade [--user] fmriprep-docker, which ensures that the latest version of FMRIPREP will be run by default.

ddshin commented 7 years ago

@effigies - Thanks, I will try that!

@jdkent - After allocating 9GB of RAM to docker on my Mac, I was able to let "bids/fmriprep" run its course. Took about 10 hours though. For general user support, will need to come up with a more time efficient solution. Maybe use AWS or GCP?

Overall, the results look amazing and the HTML report is very informative. Thanks for the good work, guys.

Two pending issues.... One major and one minor.

1: For some reason, it looks like TOPUP distortion correction was not applied to the dwi set, though my auto conversion script did create fieldmap niis (fwd/rvs) intended for dwi.

screen shot 2017-09-01 at 11 27 33 am

In fact, it looks as if the dwi data was not touched at all. screen shot 2017-09-01 at 11 25 43 am

2: The html report lists some errors at the end (see below). What does this mean and can this be avoided?

screen shot 2017-09-01 at 11 06 00 am

effigies commented 7 years ago

@ddshin At this point, FMRIPREP does not preprocess DWI images at all, and we have no plans to add it. That said, it may be worth considering what parts of our pipeline can be adapted to DWI, to ensure reasonable consistency of preprocessing across modalities, and you should feel free to consult with us if you do make an attempt.

The second issue is a bug reported in #595, #598, and fixed in #604. Upgrading will resolve it. (Note, however, that the latest release is saving crashfiles to a log folder, but not including them in reports (#686). This will be resolved in the next release.)

ddshin commented 7 years ago

@effigies - At the very least, I think supporting distortion correction would be highly desirable. Most fMRI users run DWI as part of their scan so running fmriprep and having the distortion corrected dwi in addition to everything else you guys generate will save a lot of time. Otherwise, users will need to find another BIDS app separately (are there any that can do this?) or run the TOPUP correction manually just for dwi.

Next level feature would be to incorporate FSL dtifit for basic visualization of FA and V1 maps.

The first feature I think would be critical for our operational needs, the second feature is optional but would be nice to have.

chrisgorgo commented 7 years ago

Hi @ddshin, As others already mentioned FMRIPREP is focusing on preprocessing fMRI (BOLD) data. Adding support for DWI data is currently out of the scope of this software.

Having said that there are some elements of FMRIPREP that could be reused in DWI processing (mostly T1w and field unwarping related). It might be worth while abstracting those away so multiple apps could use the same sub-workflows.

BTW you should have a look at ndmg and MRTrix_connectome BIDS Apps.

ddshin commented 7 years ago

@chrisfilo - I confirmed that the ndmg app does NOT support distortion correction. I will try running MRTrix_connectome on my BIDS data set and report back. Even if that works, it is possible that the version of FSL topup algorithm used may be different between FMRIPREP and MRTrix_connectome, which is a lingering concern.

I agree that reusing the elements of FMRIPREP to support distortion correction of dwi could be useful. Maybe create a new app specific for 1) distortion correction of fMRI and DWI sets simultaneously and 2) dedicated reports similar to how FMRIPREP does it (love the before/after distortion correction maps).

I also would like to see some modular support for BIDS data sets, i.e. being able to run one app (distortion correction for DTI and fMRI) followed by running other apps (ndmg and/or FMRIPREP) which can recognize and skip distortion correction but do the rest.

chrisgorgo commented 7 years ago

Cool - let me know (chrisgor@stanford.edu) if you would like to contribute a new BIDS App for DWI preprocessing. I can set you up with a repository in the BIDS-Apps organization.