I am a beginner in HCPpipeline and I have completed hcp_pre_freesurfer, hcp_freesurfer, hcp_post_freesurfer, hcp_fmri_volume, hcp_fmri_ surface. Based on the processing flowchart in the body of the QuNex article, it looks like I’m going to have to refer to the “https://qunex.readthedocs.io/en/latest/wiki/UsageDocs-BOLDPreprocessing.html” process in the documentation and the " [RESOLVED] Setting up connectivity analysis - Use Questions - QuNex Discourse" grega suggests to use fc_compute_roifc to extract the time series after processing according to the above flow, and then carry out the subsequent functional connectivity matrix calculation.
But what confuses me is that I saw the following flowchart in the appendix of the QuNex article, which seems to imply that I should use the HCP_ICAFIX family of denoising methods.
I’m not sure what the difference is between these two fmri denoising processes? Should I choose one of these two methods or should I use ICAFIX denoising first, followed by the “https://qunex.readthedocs.io/en/latest/wiki/UsageDocs-BOLDPreprocessing.html” processing method? If it is the latter, is it applicable to both volume space and surface space denoising + time series extraction?
Also, hcp_msmall seems to do MSMAll alignment after denoising, which should use myelin-map, and if I don’t have a T2 image, is this step still possible?
What you did so far makes sense. The next step we usually do is hcp_icafix, this a denosing step that uses pretrained models. Since you have “legacy data” (no T2w), the default pre-trained model probably won’t work well. There are some other pretrained models shipped with FSL, you can check if those would be maybe OK. When we have data that is not acquired per HCP’s protocol, we often train our own ICAFix models, details for this can be found at HCP ICAFix pipeline — QuNex documentation. Unfortunately, this can be a bit tedious and right now there is no easy/user-friendly way to do this.
I do not know the answer for what will MSMAll give you without a T2w from the top of my head. Let me ask around and get back to you.
After that, QuNex offers additional denoising methods through nuissance regression (BOLD task-evoked and resting-state functional connectivity preprocessing — QuNex documentation). In our lab we do that additional step as we believe your signal to noise ratio (SNR) is better after this, but I know that several labs do no do this and just use HCP denoised outputs. So it seems like there is no clear consensus in the community whether this extra effort is worth it. Any way you pick, you should be able to get both volume and surface outputs in the end.
I talked with a colleague regarding MSMAll and we both believe that MSMAll will work without T2w, it will use the data it has for alignment. It probably won’t be that good without T2w, but it will do its job. We would need to run this by HCP folks or check the HCP Pipelines code to be sure. though.
When we are not sure, we usualy just run it as part of pilot processing and check what happens and the outputs it produces.
The HCP ICAFIX process is indeed relatively more complex, and I do have some questions about hcp_icafix.
Regarding --hcp_icafix_traindata, can I set it to the file path of the data I want to process? Like if I train the ICAFIX model on the data I need to process and then apply it to the whole dataset? (For example, if I am processing with QuNex, I divide the whole dataset into four batches, I train on one of the batches, and apply the model I get from the ICAFIX training on those four batches) If so, how should I set --hcp_icafix_traindata? (At what level should the file path be)
I note that grega seems to have mentioned that some of the instructions in (BOLD task-evoked and resting-state functional connectivity preprocessing - QuNex documentation) seem to apply only to the Volume space?
1/--hcp_icafix_traindata: The parameter name here is maybe a bit misleading. Historically, this was called trainingdata but lately the downstream pipelines we call changed the name to trainingfile, training model or model would be more appropriate here. So, this is the path to a trained model, either somefile.RData, somefile.pyfix_model, or a pyfix built-in model without extension. We will change the parameter name and description for the next version, the old parameter name will also work for backwards compatibility. This is the new name and description:
--hcp_icafix_model (str, default detailed below):
Which model to use for classification. Can be one of the
pre-trained models shpipped with FSL or a custom model as
`somefile.RData`, `somefile.pyfix_model`, or a pyfix built-in model
without extension. 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.
2/--hcp_matlab_mode leave this unset and it will be set automatically to the appropriate value. You need to play around with this only if some issues pop up with the default.
3/ I would need to consult Grega on this, I know that there was an issue when one of the users was mixing inputs/outputs from volume and surface spaces when generating BOLD derivatives. We can tackle this once you reach this phase of analysis and we have some concrete command examples in our hands. If some commands do not yet work in surface space, I think this would be easy to extend and upgrade.
I really don’t understand the ICAFIX training process. Regarding --hcp_icafix_traindata, how should I prepare this file?
If I understand correctly, when I train the custom model, I should first create the <boldname>.ica folder under MNINonLinear/Results/<boldname>/, and then call the fix command in FSL to get some output files.
Then create a new hand_labels_noise.txt file under the <boldname>.ica folder, This text file should contain a single line (or, at least, should have as its final line), a list of the bad components This text file should contain a single line (or, at least, should have as its final line), a list of the bad components only, with the format (for example): [1, 4, 99, … 140]. 140], and then call fix once more to train the model? Get the model training result mymodel.pyfix_model and then execute hcp_icafix one last time?
Perhaps I should read and re-read the FIX documentation provided by FSL.FIX
All in all, I need to use FIX to train the model first, and then use the model training result mymodel.pyfix_model to call the hcp_icafix application?
First, you can try ICAFix using some FSL’s pretrained models and check wheter they work with your data. hcp_post_fix will create files you can open in Connectome Workbench to check this out.
If this does not work, then you need to train your own model. From a bird’s eye perspective this means that for a couple of sessions, you need to calculate the ICA components and then manually classify them as noise or signal. fix can then use this information to train a classification model that is then applied to the remaining sessions. Say your study has 500 sessions, you classify 20 manually and then apply the trained model to the remaining 480. If your study has 20 sessions in the first place, you can just classify them manually.
I started with ICA denoising using the default pre-training model (i.e.,--hcp_icafix_traindata=“Standard.RData” ), which applies to data with roughly the following parameters e.g., TR=3s, Resolution=3.5x3.5x3.5mm, Session=6mins, default FEAT preprocessing (including default spatial smoothing).
hcp_icafix automatically executes hcp_post_fix after training using the pre-training model, I downloaded the processed data and used workbench to view the classification results, but it seems to be less easy to confirm the correctness of the classification results (some of the noise is more noticeable, and some of the noise looks very similar to the signal).
I need to first perform ICA denoising using the default standard pre-trained model Standard.RData
Manually check the ICA denoising results of around 20 cases and create a new hand_labels_noise.txt file listing the noise component numbers of the ICA divisions for each subject
Refer to the following samples using FIX for model training
Perform ICA denoising again using FIX training results mymodel.pyfix_model
Normally, we would probably only use the hcp_icafix and hcp_post_fix commands? I think I probably won’t be doing manual reclassification of noise and signal components in FIX, so can I skip the hcp_reapply_fix command?
I will ask my colleagues who have done ICA custom model training on their research studies to help out here. There is a public holiday in Slovenia over the next couple of days though, so they are out of office. I will ask them to help you out early next week when they return.
Yes, first you run hcp_icafix. You can use the Standard.RData model or any other model listed in the FSL documentation (FSL - the FMRIB Software Library). It’s best to choose the one that has the most similar acquisition parameters to your data.
Yes.
Yes - you train your own model with fix. Check the results in <model_name>_LOO_results.
Yes, make sure you set the appropriate threshold and set --hcp_reuse_existing_ica=TRUE and --hcp_fix_backup=<backup_name> to avoid computing ICA again (the ICA algorithm is stochastich, so the exact ICA solution will be slightly different if you rerun ICA). You can skip hcp_reapply_fix.
I also suggest you to look at the examples of independent components in this paper: Griffanti, et al. 2017. If you are still not sure regarding classification of some components you can ask here or perhaps on FSL mailing list.
Many thanks to andraz.matkovic for recommending this article, which I noticed earlier while reading the official FIX documentation provided by FSL, and which helped me a lot!
I noticed this image while looking at the official FIX docs, does this mean that at this point ICAFix bundles all the bolds together and performs a multi-run HCP ICAFix? (The whole set of data together to do the ICA?)
Is hcp_ica_fix the result of only having volume space? I noticed that its output is in nii.gz format, if I want to get the ICA denoising result in surface space, can I map it to the cortex via wb_command -volume-to-surface-mapping?
Also, I’m very sorry I have to insert a question about dmri processing in fmri processing issues.
In the following link, I noticed that yjia describes this processing flow, and I processed the dmri data once as described, but the results I got after dwi_parcellate were a bit strange.
Below is a heatmap of the connection matrix I plotted using waytotnorm_MMP360.pconn.nii obtained by dwi_parcellate, and you can see that its overall value is extremely small (vmax: 6.13359475210018e-07) and the main connections are concentrated in the diagonal region, which is a result that is different from what I was expecting in advance a big difference.
Theoretically shouldn’t the structural connectivity matrix obtained from the above step-by-step procedure be the number of white matter fiber streamlines between any two ROIs? Shouldn’t the resulting structural connectivity matrix be more similar to the common functional connectivity matrix?
Regarding ICA, I think you’re confusing ICAFIX with group ICA (dual regression). ICA-FIX is intended for cleaning artifacts at the individual level, whereas group ICA is a type of group parcellation. In group ICA, ICA is performed on data from all subjects together. On the other hand, ICA-FIX is always run for each subject/session separately.
Now, ICAFIX can be run for each BOLD (within subject) separately or for all BOLDs in one session, which is referred to as “multi-run ICA.” This is specified by the parameter --hcp_icafix_bolds. By default, ICAFIX concatenates all BOLDs (resulting in fMRI_CONCAT_ALL folder). This simplifies preprocessing because ICA classification usually only needs to be done once per subject/session and improves ICA decomposition (see section Multi-session temporal concatenation in documentation for MELODIC). You can also specify different variants of ICA decomposition, e.g., for each BOLD separately or for groups of BOLDs (see help for --hcp_icafix_bolds). Grouping of BOLDs would usually make sense if BOLDs have been recorded at different sessions, but if they have been recorded in the same day, the default options are sufficient.
I did confuse the concept of ‘multi-run ICA’. Since I only have one BOLD per session in my data, I guess I don’t need to pay extra attention to --hcp_icafix_bolds, which should only have an effect on the naming form.
But I have another question, --hcp_icafix_bolds should affect the output filename while affecting how BOLD is handled. Therefore, when following up with other commands, do I need to pay attention to the back-to-back filenames in order to correctly extract the files that were processed in the previous step?
Finally, regarding the ICAFIX results, is it correct to get the ICA denoising results for the surface space via wb_command -volume-to-surface-mapping?(For example, my ICAFIX denoising result is 1_hp0_clean.nii.gz)
ICAFIX should also return dtseries.nii file. You should see something like fMRI_CONCAT_ALL_Atlas_hp0_clean.dtseries.nii in MNINonLinear/Results folder. Even if you have multiple BOLDs, the results will automatically be applied to each BOLD separately, just the classification will be done on concatenated data.
There is no need to run any commands outside qunex except for training fix.
I actually have another question, after using ICAFIX to do the denoising results, some of them will also use a series of extract_nuisance_signal and so on for secondary processing. This is of course fine for data in volume space, but there seems to be some issues with data in surface space. (extract_nuisance_signal seems to extracts nuisance signal from volume BOLD files…)
Does this mean that for fmri data in surface space, ICAFIX is the entire denoising process? And for volume-space fmri data, it’s still useful to do a subsequent extract_nuisance_signal
A nuisance signal, such as white matter or ventricles, can only be extracted from volume data because the surface format does not contain the white matter or ventricles. However, this doesn’t mean that the nuisance signal doesn’t impact the surface data.
As for whether nuisance regression (and scrubbing) is necessary, I have no definitive answer. People have been doing all sorts of things, including finishing with ICAFIX + MSMAll, performing nuisance and motion regression after ICAFIX, and scrubbing after ICAFIX. Note that none of these preprocessing pipelines removes the global signal. At the very least, you should regress the global signal/artifacts from the data (or better - compare GSR vs. no GSR pipelines).
The issue with global signal regression is that is may also remove signal, not only noise. An alternative would be to perform temporal ICA after ICAFIX + MSMAll. However, this work is still in progress (even though the preprint says this has been finished automatic classification has not yet been fully integrated into HCP pipelines).
I am currently comparing all these options, and for brain-behavior association purposes, my preliminary tests suggest that nuisance regression and scrubbing yield the best results. However, I suggest trying different options. It also depends on what you want to do with the data. If you are interested in time-varying connectivity or require the full time series, you may want to avoid scrubbing.
In any case, once temporal ICA is integrated, separate nuisance or global signal regression won’t be necessary anymore.