Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longitudinal fmriprep with pre-run Freesurfer #21

Open
araikes opened this issue Apr 16, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@araikes
Copy link

commented Apr 16, 2018

Hi all,
In a previous issue (#993), there was a discussion about using fmriprep for longitudinal studies. The question came down to the reusability of Freesurfer outputs. The suggestion was made by @chrisfilo to run Freesurfer first (preferably the BIDS App Freesurfer) and then let fmriprep pull from that.

I've run Freesurfer's recon all for my participants. When I run fmriprep, should I use the --no-fs-reconall option. When I include the flag, the process crashes out with an error (see attached crash text file). When I do not include the flag, the process runs but it's not clear if the freesurfer output is being incorporated.

My call to fmriprep was:
-wrap "docker run -i --rm \ -v $INDIVDIR:/data:ro \ -v $OUTDIR:/out \ -v /data/BL2/BIDS_derivatives/code/license.txt:/opt/freesurfer/license.txt \ poldracklab/fmriprep \ /data /out \ participant \ --longitudinal \ --low-mem \ --n_cpus 1 \ --output-space template T1w fsaverage \ --work-dir /scratch \ --use-aroma \ --participant_label "sub-$subject" \ --write-graph"

where $OUTDIR already contains a "freesurfer" folder built from my $INDIVDIR. The --no-fs-reconall was included for one participant and excluded for one participant. The one where it was included completed.

Please let me know what other files might be needed to identify if freesurfer is getting incorporated as intended.

crash-20180414-015316-root-autorecon1-f42ca378-4525-48ee-ac26-65982571c354.txt

@effigies

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2018

You should not use --no-fs-reconall. That indicates that you do not intend to use FreeSurfer surface processing at all, which I do not believe is what you want. The attached crash file, however, seems to be from when you do not include the flag, as autorecon1 should not be run at all if --no-fs-reconall is specified.

Looking at that error, it's finding your FreeSurfer directory, but for some reason not identifying it as being complete. This is most likely a lapse in Nipype's ability to detect a completed directory. I'm not sure what all differences there are in such a directory.

Could you give a full listing of the commands you ran directly with FreeSurfer? If I can replicate your situation, I should be able to get ReconAll to correctly detect that your directory has already been run.

@araikes

This comment has been minimized.

Copy link
Author

commented Apr 16, 2018

Hi @effigies,
Here's the command for running freesurfer. I'm running it in parallel using SLURM on a private cluster.

sbatch -o $LOGS/sub-"$subject"/Freesurfer_out.txt \ -e $LOGS/sub-"$subject"/Freesurfer_error.txt \ --partition="verylong.q" \ --job-name="FS_sub-$subject" \ --wrap "docker run -i --rm \ -v $BIDSDIR:/bids_dataset:ro \ -v $FSOUT:/outputs \ -v /data/BL2/BIDS_derivatives/code/license.txt:/license.txt \ bids/freesurfer \ /bids_dataset \ /outputs \ participant \ --n_cpus 1 \ --multiple_sessions longitudinal \ --hires_mode disable \ --participant_label $subject \ --refine_pial T1only \ --skip_bids_validator \ --license_file "/license.txt""

where $FSOUT is my BIDS derivatives folder/freesurfer.

Attached is a truncated text file with the file tree that gets created from running this. This is the same participant for the crash file I attached previously. The only thing I'm not sure of is whether I needed the "steps" flag in the recon-all call, but it looks like it doesn't. It appears that the cross-sectional, base, and longitudinal folders all got created.

file_tree.txt

Thanks

@effigies

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2018

Could you share the scripts/recon-all.log?

@araikes

This comment has been minimized.

Copy link
Author

commented Apr 16, 2018

From the cross-sectional folders:
ses-Pre: recon-all.log
ses-Post: recon-all.log

From the base folder:
recon-all.log

From the longitudinal folders:
ses-Pre: recon-all.log
ses-Post: recon-all.log

@effigies

This comment has been minimized.

Copy link
Collaborator

commented Apr 23, 2018

Just an update to let you know that (a) I have not yet had time to look further into this and (b) I have not forgotten about this. Thanks for your patience.

@araikes

This comment has been minimized.

Copy link
Author

commented Apr 24, 2018

Thanks for the update @effigies

@pettitta

This comment has been minimized.

Copy link

commented Dec 17, 2018

Hi,

I have a follow-up tangential question for OP. I see that you have run the freesurfer scans through the longitudinal pipeline. How do you specify for fmriprep for them to use the longitudinally processed directories for each timepoint and not the original cross-sectional freesurfer output directories?

@oesteban oesteban transferred this issue from poldracklab/fmriprep Jan 8, 2019

@hpfisher3

This comment has been minimized.

Copy link

commented Feb 19, 2019

Has there been any update on this? I am also running into an issue of fmriprep not being able to recognize previously run freesurfer outputs for a longitudinal design. I get the "you are trying to re-run an existing subject with (possibly) new input data..." error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.