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

hcp_reapply_fix [... processing options]

Runs the ReApplyFix step of HCP Pipeline (ReApplyFixMultiRunPipeline.sh or ReApplyFixPipeline.sh).


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.

--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_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_regname (str, default 'NONE'):

Specifies surface registration name. If 'NONE' MSMSulc will be used.

--hcp_lowresmesh (int, default 32):

Specifies the low res mesh number.

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 ReApplyFix step of HCP Pipeline. This function executes two steps, first it applies the hand reclassifications of noise and signal components from FIX (ApplyHandReClassifications.sh) using the ReclassifyAsNoise.txt and ReclassifyAsSignal.txt input files. Next it executes the HCP Pipeline's ReApplyFix or ReApplyFixMulti (ReApplyFixMultiRunPipeline.sh or ReApplyFixPipeline.sh).

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_reapply_fix parameter mapping:

QuNex parameter

HCPpipelines parameter












qunex hcp_reapply_fix \
    --batchfile=processing/batch.txt \
    --sessionsfolder=sessions \
qunex hcp_reapply_fix \
    --batchfile=processing/batch.txt \
    --sessionsfolder=sessions \
    --hcp_icafix_bolds="GROUP_1:BOLD_1,BOLD_2|GROUP_2:BOLD_3,BOLD_4" \