qx_utilities.hcp.process_hcp.hcp_icafix(sinfo, options, overwrite=False, thread=0)#

hcp_icafix [... processing options]

Runs the ICAFix step of HCP Pipeline (hcp_fix_multi_run or hcp_fix).


The code expects the input images to be named and present in the QuNex folder structure. The function will look into folder:

<session id>/hcp/<session id>

for files:



--batchfile (str, default ''):

The batch.txt file with all the sessions information.

--sessionsfolder (str, default '.'):

The path to the study/sessions folder, where the imaging data is supposed to go.

--parsessions (int, default 1):

How many sessions to run in parallel.

--parelements (int, default 1):

How many elements (e.g. bolds) to run in parallel.

--overwrite (str, default 'no'):

Whether to overwrite existing data (yes) or not (no).

--hcp_suffix (str, default ''):

Specifies a suffix to the session id if multiple variants are run, empty otherwise.

--logfolder (str, default ''):

The path to the folder where runlogs and comlogs are to be stored, if other than default.

--log (str, default 'keep'):

Whether to keep ('keep') or remove ('remove') the temporary logs once jobs are completed.

When a comma or pipe ('|') separated list is given, the log will be created at the first provided location and then linked or copied to other locations. The valid locations are:

  • 'study' (for the default: <study>/processing/logs/comlogs location)

  • 'session' (for <sessionid>/logs/comlogs)

  • 'hcp' (for <hcp_folder>/logs/comlogs)

  • '<path>' (for an arbitrary directory).

--hcp_icafix_bolds (str, default ''):

Specify a list of bolds for ICAFix. You can specify a comma separated list of bolds, e.g. "<boldname1>,<boldname2>", in this case single-run HCP ICAFix will be executed over specified bolds. You can also specify how to group/concatenate bolds together, e.g. "<group1>:<boldname1>,<boldname2>| <group2>:<boldname3>,<boldname4>", in this case multi-run HCP ICAFix will be executed. Instead of full bold names, you can also use bold tags from the batch file. If this parameter is not provided ICAFix will bundle all bolds together and execute multi-run HCP ICAFix, the concatenated file will be named fMRI_CONCAT_ALL.

--hcp_icafix_highpass (int, default detailed below):

Value for the highpass filter, [0] for multi-run HCP ICAFix and [2000] for single-run HCP ICAFix.

--hcp_matlab_mode (str, default 'compiled'):

Specifies the Matlab version, can be 'interpreted', 'compiled' or 'octave'.

--hcp_icafix_domotionreg (str, default detailed below):

Whether to regress motion parameters as part of the cleaning. The default value for single-run HCP ICAFix is [TRUE], while the default for multi-run HCP ICAFix is [FALSE].

--hcp_icafix_traindata (str, default detailed below):

Which file to use for training data. You can provide a full path to a file or just a filename if the file is in the ${FSL_FIXDIR}/training_files folder. [HCP_hp<high-pass>.RData] for single-run HCP ICAFix and [HCP_Style_Single_Multirun_Dedrift.RData] for multi-run HCP ICAFix.

--hcp_icafix_threshold (int, default 10):

ICAFix threshold that controls the sensitivity/specificity tradeoff.

--hcp_icafix_deleteintermediates (str, default 'FALSE'):

If True, deletes both the concatenated high-pass filtered and non-filtered timeseries files that are prerequisites to FIX cleaning.

--hcp_icafix_fallbackthreshold (int, default 0):

If greater than zero, reruns icadim on any run with a VN mean more than this amount greater than the minimum VN mean.

--hcp_config (str, default ''):

Path to the HCP config file where additional parameters can be specified. For hcp_icafix, these parametersa are: volwisharts, ciftiwisharts and icadimmode.

--hcp_icafix_postfix (str, default 'TRUE'):

Whether to automatically run HCP PostFix if HCP ICAFix finishes successfully.

Output files

The results of this step will be generated and populated in the MNINonLinear folder inside the same sessions's root hcp folder.

The final clean ICA file can be found in:


where highpass is the used value for the highpass filter. The default highpass value is 0 for multi-run HCP ICAFix and 2000 for single-run HCP ICAFix.


Runs the ICAFix step of HCP Pipeline (hcp_fix_multi_run or hcp_fix). This step attempts to auto-classify ICA components into good and bad components, so that the bad components can be then removed from the 4D FMRI data. If ICAFix step finishes successfully PostFix (PostFix.sh) step will execute automatically, to disable this set the hcp_icafix_postfix to FALSE.

If the hcp_icafix_bolds parameter is not provided ICAFix will bundle all bolds together and execute multi-run HCP ICAFix, the concatenated file will be named fMRI_CONCAT_ALL. WARNING: if session has many bolds such processing requires a lot of computational resources.

hcp_icafix parameter mapping:

QuNex parameter

HCPpipelines parameter
























qunex hcp_icafix \
    --batchfile=processing/batch.txt \
qunex hcp_icafix \
    --batchfile=processing/batch.txt \
    --sessionsfolder=sessions \