Skip to content
levipriscila edited this page Sep 13, 2024 · 5 revisions

ICA-FIX is a great tool for removing noise from fMRI. Simmilarly to AROMA, it works by classyfying independent coponents of 4D fMRI data into 'good' or 'bad' and regressing out the 'bad' ones. Unlike AROMA, you build your own training set based on the structure of noise you may find in you particular dataset. This means that FIX should only be used if you have a large enough dataset, so you can spare a few subjects to use as a training set. It also means that you can train the model specifically to your data, so it might perform better than AROMA for different types of acqusition. For example, if you have multi-band data, 'bad' signals will look different to what AROMA is expecting, so you should use FIX to denoise. Here is a wiki page for FIX.

Running FIX

On MASSIVE, start by loading fix by typing this in a terminal module load fix

1st step: Running ICA:

To start the process you should run Independent Component Analyses to extract the different features of you data.

  • We recommend not specifying the numbers of components you want to run.
  • If you have data is already preprocessed, we also recommend adding the flag --nobet to not run brain extration again.

To run ICA, you can type the folowing example command on your terminal: 'melodic -i </ful/path/to/nifti/preprocessed/nifti/file.nii.gz> -o </full/path/to/output/dir/filtered_fun_data.ica> --nobet --report --Oall`

For more options type melodic --help

2nd step: Creating a trainning set:

There are few trainning sets available in the FIX directory, but these are based on different datasets and you should only use them if your data has the exact same acquisition parameters as the training set data. Otherwise, you need to create your own trainning set. This is the trickiest step! For this you need to hand label components into 'good' and 'bad' for at least 10 subjects. The best way to do this is to open the components in fsleyes melodic view using the following commands: module load fsleyes and vglrun fsleyes -s melodic -ad </directory/with/melodic/output/filtered_func_data.ica>

This should open a window that looks like this melodic_temp

The red box shows your component on the brain, the green box shows its time-series, and the blue box shows its power spectra. You will use these features to dcide how to label them. You can click on the items in the yellow box to change views of the brain. The purple box has a list of all of the components and their labels, you can see a different component by going clicking on them and you can add a label by double clicking on the white box of each component. When you do that a list of potential labels will appear, as shown in the image below. You can labels the as signal, unclassified noise, or a specific type of noise, but don't worry too much about identifying which type of noise your components are, just labelling them as either signal or unclassified noise is enough!

There are a few resources you can use to help label these components. Here are two paper with some examples: Griffanti et. al. and Salimi-Khorshidi et. al.. But there are lots of tutorials and other papers available. Here we outline a couple of examples and what to look for.

Signs that something is a signal:

  • Big clusters of activity, a lot of the times they will be located in the DMN or in the visual cortex, but in general, true signal usually comes in clusters.

Screenshot 2024-09-13 144842 Screenshot 2024-09-13 144429 Screenshot 2024-09-13 144718 Screenshot 2024-09-13 144813

  • Sinosidal-like time series Screenshot 2024-09-13 144446 Screenshot 2024-09-13 145303

  • Low power scpectra that looks something like this: Screenshot 2024-09-13 144454 Screenshot 2024-09-13 145441

Signs that something is noise:

  • Ring-like activity around the head

Screenshot 2024-09-13 150036 Screenshot 2024-09-13 150058 Screenshot 2024-09-13 151204

  • Unclustered activity

Screenshot 2024-09-13 150205 Screenshot 2024-09-13 150313

  • Activity in a nice straight line

Screenshot 2024-09-13 150233 Screenshot 2024-09-13 150617

  • Acitivity not in grey matter

Screenshot 2024-09-13 150658 Screenshot 2024-09-13 150505

  • High frequency or very rythmic time series Screenshot 2024-09-13 151212 Screenshot 2024-09-13 150023 Screenshot 2024-09-13 150902 Screenshot 2024-09-13 151327

  • Spread-out, high or single peak power spectra Screenshot 2024-09-13 151454 Screenshot 2024-09-13 151552

After you have labelled all the components, you can save them by clicking Save labels (located in the purple box shown in fig1). You should save them as hand_labels.txt on the same folder as filtered_fun_data.ica

3rd step: Train the classifier:

You can do that by running fix -t </full/path/to/output/> [-l] <full/path/to/subject/melodic/folder/sub1.ica> <full/path/to/subject/melodic/folder/sub2.ica>...

4th step: Run FIX

Now you need to extract features from every subject, then automatically labels their components, and finally remove the 'bad' components. At this stage, you're going to need to choose a threashold for cleaning, we recommend trying a few, like 5, 10, 20, 30, 40, 50. The higher the number, the more aggressive FIX will be. You can also apply a highpass filter. If you do, we recommnd 2000.

Run the following commands in terminal:

fix -f <full/path/to/subject/melodic/folder/subn.ica>

fix -c <full/path/to/subject/melodic/folder/subn.ica> </full/path/to/training/classifier.RData <threshold>

fix -a <full/path/to/subject/melodic/folder/subn.ica/fix4melview.txt> -m -h 2000

Clone this wiki locally