TIGRLab/FeenICS

Name: FeenICS

Owner: Kimel Family Translational Imaging-Genetics Research Lab

Description: A pipeline for FrEquENcy-based Ica Cleaning of Spirals

Created: 2017-11-21 20:52:35.0

Updated: 2017-12-29 19:30:34.0

Pushed: 2018-01-15 19:52:59.0

Homepage: null

Size: 1024

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

FeenICS (f?'n?ks)

A pipeline for FrEquENcy-based Ica Cleaning of Spirals. Aims to remove spiral-specific aritfact from fMRI scans.

This tool was built to work with FSL's MELODIC. It was created to automate the process of evaluating and removing ICA components containing spiral artifact, which is accomplished by evaulating the per slice frequency loading, and scoring components based on patterns of low or high frequency information. The fsl_regfilt command-line program can then be used to regress out components selected for removal.

Installation
ownload Dockerfile
udo apt-get install docker.io (if you don't have docker already installed)
d /path/to/Dockerfile
udo docker build -t feenics .
udo docker run -v /path/to/data:/input -i -t feenics
NOTE: where /path/to/data is a folder that you want access to from inside
the container; 'input' will be the name of this folder inside the container.
Dependancies

This program requires either FSL or the outputs of FSL Melodic in order to work.

Python dependancies (these will be installed when you install FeenICS if you don't already have them):

There are four executables:
s1_folder_setup.py
e:
_folder_setup.py -p -i PATH -s PATH <directory>

ments:

irectory>         Path to top experiment directory. Outputs will be created
                  here.
ons:

sprl, -i PATH     Specify alternative folder containing split spirals.

subs, -s PATH     Specify alternative experiment folder containing
                  subjectID subfolders.

parallel, -p      Print instuctions for running in parallel (GNU parallel)
                  instead of running FSL steps on machine in series.

ILS
s subject and sprl subfolders within <directory>. Moves separated spiral
s to appropriate subfolders. If split spirals are not already contained
in <directory>, use the "-i" option to specify an alternative path. Specify
 if you would not like to run FSL preprocessing steps at this time. It will
t instructions to run MCFLIRT, BET, and MELODIC using GNU parallel.
s2_identify_components.py
e:
_identify_components.py -m FLOAT -l FLOAT <directory>

ments:
irectory>         Path to top experiment directory.

ons:
midFactor, -m     Cutoff multiplier for mid range frequency information.
                  Raise this value to more aggressively remove noise
                  components. Default is 3.

lowFactor, -l     Cutoff multiplier for low range frequency information.
                  Raise this value to keep more signal components.
                  Default is 1.

ILS
s paths, multipliers, and output file names to check_slices.py for each
ect within the specified directory. The default name for the output
sification file is fix4melview_Standard_thr20.txt.
s3_remove_flagged_components.py
e:
_remove_flagged_components.py -c PATH -o PATH <directory>

ments:
irectory>         Path to top experiment directory.

ons:
clean_img, -c     Path to desired location of cleaned images.

output, -o        If csv outputs were generated in non-default location,
                  identify path to this location.

ILS
 fsl_regfilt to regress out the components specified in the last line of the
sification file (fix4melview_Standard_thr20.txt). The outputs are cleaned,
still separated spiral niftis. They will be named subject.sprl.denoised.nii.gz.
icarus-report (optional)

An html report creation tool written by E.Dickie. This step is optional, but will make checking your data much easier.

Follow the sample in Usage Examples, below or click here for futher instructions.

check_slices.py
e:
eck_slices.py <melodic_file> <outputname> <factorA> <factorB>

ments:
elodic_file>      Path to any melodic_IC.nii.gz file.

utputname>        Path to desired output classification file location.

actorA>           Multiplier to be used to determine mid/high frequency
                  cutoffs. If called from s2, default is 3.

actorB>           Multiplier to be used to determine low frequency cutoffs.
                  If called from s2, default is 1.

ILS
 script is called by s2_identify_components.py. Can be used independently to
bleshoot classification or path identification issues, or just to run one
al scan at a time. The algorithm scores each slice based on how much high
low frequency information is present after performing an FFT (fast fourier
sform). The scores are tallied per component, and the result determines
her or not a component is to be flagged for removal. The output of this script
 classification text file (fix4melview_Standard_thr20.txt), which details the
e and classification criteria per slice, as well as the removal decision
component. The final line of this document is a list of which components are
e removed. If you disagree with the decision, change the component numbers in
 list, as this line will be read into s3_remove_flagged_components.py.
Usage Examples:

To run FeenICS locally for an experiment called EXPR, with additional use of Erin Dickie's ICArus package (https://github.com/edickie/ICArus) to better visualize the decisions made by the check_slices.py algorithm

Step 1:
older_setup.py /path/to/EXPR
Step 2:
dentify_components.py /path/to/EXPR
Step 3(optional) - Run ICArus (see https://github.com/edickie/ICArus for more information):
s=`cd /path/to/EXPR; ls -1d */sprl*/`
us-report ${sprls}

 qc_icafix.html in your favourite web browser to view the classification results.
Step 4 - After you are okay with classifications, run s3_1_remove_flagged_components.py:
emove_flagged_components.py /path/to/EXPR

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.