I built a script that needs MINIMAL user input and runs freesurfer, creates QA images, extracts stats in CSV and runs the longitudinal pipeline. Open access!

Hello, NeuroStars community! :star2:

I’m thrilled to share this open-source project, designed to simplify and enhance your neuroimaging workflow: FreeSurfer’s recon-all BIDS Processing Script. This script requires MINIMAL user input and coding. I’m eager to share it with this community for feedback, contributions, and hopefully, widespread use.

Key Features:

  1. Automated Processing: Seamlessly process T1 images in your BIDS dataset with FreeSurfer’s recon-all. You just need to have your data in BIDS formatting and insert the path to your folder. The script will run the rest.
  2. Quality Control Montages: For each subject and session, the script generates detailed QC montages using FreeView and ImageMagick. Again, no additional user input, just let it run!
  3. Metadata & Metrics Extraction: It extracts T1 metadata and all Freesurfer metrics into CSV files automatically!
  4. Longitudinal Data Support: If you have longitudinal data, the script is able to run freesurfer’s longitudinal script.

Why This Matters: With the ever-evolving landscape of neuroimaging, having accessible and efficient tools is paramount. This script is a step in that direction, aiming to automate repetitive tasks, ensure data quality, and provide a holistic view of T1 imaging data.

Contribute & Collaborate: The script is now [open on GitHub: GitHub - cfatuesta/AutomatedFreeSurfer, and I welcome any feedback, issues, pull requests, or just a simple star if you find it helpful!

Looking forward to reading what you think!
Carolina Ferreira-Atuesta MD MSc

7 Likes

Thanks for sharing this!
Let’s say I have already run freesurfer via fmriprep. Could I still use your main_script.sh for getting the quality check plots and tables?

1 Like

Yes! You’d need to move/rename the freesurfer output folder so it matches the script specification (I’m adding that to the documentation so its clear). Once you have the output in the correct place, you can run the script and it will ask you if you want to run the freesurfer pipeline again, to which you’d say no, and then it will ask if you want to create the QC montages, to which you’d answer yes. At the end it creates the CSV automatically. I’ll keep you posted once its ready :slight_smile:
Cheers!

1 Like

Thank you Carolina! Brilliant! I had already run freesurfer, and I was able to get all the neat outputs from your pipeline.
The instructions on github were clear and I was able to understand easily the right data structure from taking a peek at the main script.

1 Like

Thank you @Carolina_Ferreira !

I also tried with already run freesufer from FMRIPREP v22.0.2, that is Freesurfer 7.2.0 for which were given as inputs T1w and T2w image.
To get those nice outputs I had to make a few adjustments:

  • My subjects didn’t have any session, I had to add one following BIDS specification to make the script go through.
  • put the Freesurfer output folder created by FMRIPREP in sub-SUB/ses-SES/anat/derivatives/.
  • In the Freesurfer output folder, since FS was run with T1w and T2w images, I had to rename rh.pial.T1 to rh.pial and lh.pial.T1 to lh.pial.

The results are great! Thank you!

1 Like

Oh that’s great! I’m glad it worked! Thanks for the feedback :slight_smile: I’ll adjust the README