gICA using HCP pipelines?

125 views
Skip to first unread message

Lin Chen

unread,
Oct 4, 2023, 2:46:14 PM10/4/23
to hcp-...@humanconnectome.org
Hi all!

I'm planning to use HCPpipeline for gICA and from what I've understand this can be done using the three first parts of the tICA script, ie GroupSICA, indProjSICA and ConcatGroupSICA. Would you recommend using the tICAPipeline.sh and modify it to keep only these steps or what approach would be best if you only want to extract spatial group ICA components?

Best and thank you in advance,
Lin

Glasser, Matt

unread,
Oct 4, 2023, 2:54:35 PM10/4/23
to hcp-...@humanconnectome.org

You can only run the steps you want from the tICA pipeline.  No need to modify it.  We built that in as it is a relatively common usecase (or even wanting to run parts of the tICA pipeline at different times).  Let us know if you have any issues figuring out how to do that. 

 

Matt.

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/CANHS7XiqO4QB8iM1jMTrDxTay-oD9DOE%2BoKrBVUZYn8nBOULhA%40mail.gmail.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Lin Chen

unread,
Oct 5, 2023, 4:27:13 AM10/5/23
to HCP-Users, Glasser, Matt
Thank you for your answer!

I don't really understand how to specify which parts of the pipeline to use? Which tICAPipeline.sh argument should be set to specify only running the script up to sICA concatenation?

Best and thank you
Lin

Glasser, Matt

unread,
Oct 5, 2023, 10:08:51 AM10/5/23
to hcp-...@humanconnectome.org, Yang, Chunhui

Here is the usage:

 

tICAPipeline.sh: implements temporal ICA decomposition and cleanup

 

Usage: tICAPipeline.sh PARAMETER ...

 

A parameter enclosed in [ ] is optional.

A parameter enclosed in { } is required, but can be provided by a config file.

All other parameters must be specified.

Anything enclosed in < > is a placeholder for a user supplied value.

 

  [--help or -h] - show this usage information and exit

  [--config=<file>] - load parameter values from a file

   --study-folder=<path> - folder that contains all subjects

   --subject-list=100206@100307... - list of subject IDs separated by @s

   --fmri-names=rfMRI_REST1_LR@rfMRI_REST1_RL... - list of fmri run names separated by @s

  [--mrfix-concat-name=<rfMRI_REST>] - if multi-run FIX was used, you must specify the concat name with this option

   --output-fmri-name=<rfMRI_REST> - name to use for tICA pipeline outputs

   --proc-string=<string> - file name component representing the preprocessing already done, e.g. '_Atlas_MSMAll_hp0_clean'

   --fix-high-pass=<integer> - the high pass value that was used when running FIX

   --out-group-name=<string> - name to use for the group output folder

   --fmri-resolution=<string> - resolution of data, like '2' or '1.60'

   --surf-reg-name=<MSMAll> - the registration string corresponding to the input files

  {--num-wishart=<integer>} - how many wisharts to use in icaDim

  {--low-res=<meshnum>} - mesh resolution, like '32' for 32k_fs_LR

   --subject-expected-timepoints=<string> - output spectra size for sICA individual projection, RunsXNumTimePoints, like '4800'

  [--ica-mode=<string>] - whether to use parts of a previous tICA run (for instance, if this group has too few subjects to simply estimate a new tICA).  Defaults to NEW, all other modes require specifying the --precomputed-* options.  Value must be one of:

        NEW - estimate a new sICA and a new tICA

        REUSE_SICA_ONLY - reuse an existing sICA and estimate a new tICA

        INITIALIZE_TICA - reuse an existing sICA and use an existing tICA to start the estimation

        REUSE_TICA - reuse an existing sICA and an existing tICA

  [--precomputed-clean-folder=<folder>] - group folder containing an existing tICA cleanup to make use of for REUSE or INITIALIZE modes

  [--precomputed-clean-fmri-name=<rfMRI_REST>] - the output fMRI name used in the previously computed tICA

  [--precomputed-group-name=<PrecomputedGroupName>] - the group name used during the previously computed tICA

  [--extra-output-suffix=<string>] - add something extra to most output filenames, for collision avoidance

  [--pca-out-dim=<integer>] - override number of PCA components to use for group sICA

  [--pca-internal-dim=<integer>] - override internal MIGP dimensionality

  [--migp-resume=<YES or NO>] - resume from a previous interrupted MIGP run, if present, default YES

  [--sicadim-iters=<integer>] - number of iterations or mode for estimating sICA dimensionality, default 100

  [--sicadim-override=<integer>] - use this dimensionality instead of icaDim's estimate

  [--low-sica-dims=num@num@num...] - the low sICA dimensionalities to use for determining weighting for individual projection, defaults to '7@8@9@10@11@12@13@14@15@16@17@18@19@20@21'

  [--reclean-mode=<YES or NO>] - whether the data should use ReCleanSignal.txt for DVARS

  [--manual-components-to-remove=<file>] - text file containing the component numbers to be removed by cleanup, separated by spaces, requires either --ica-mode=REUSE_TICA or --starting-step=CleanData

  [--fix-legacy-bias=<YES or NO>] - whether the input data used the legacy bias correction

  [--config-out=<file>] - generate config file for rerunning with similar settings, or for reusing these results for future cleaning

  [--starting-step=<step>] - what step to start processing at, one of:

        MIGP

        GroupSICA

        indProjSICA

        ConcatGroupSICA

        ComputeGroupTICA

        indProjTICA

        ComputeTICAFeatures

        ClassifyTICA

        CleanData

  [--stop-after-step=<step>] - what step to stop processing after, same valid values as --starting-step

  [--parallel-limit=<integer>] - set how many subjects to do in parallel (local, not cluster-distributed) during individual projection and cleanup, defaults to all detected physical cores

  [--matlab-run-mode=<0, 1, or 2>] - defaults to 1

        0 = compiled MATLAB

        1 = interpreted MATLAB

        2 = Octave

 

It sounds like you want to do the equivalent of a “dual regression” type analysis (we use a weighted multiple regression described in Glasser et al., 2016 Nature).  That would be --starting-step=MIGP and --stop-after-step=ConcatGroupSICA.  I have CCed Alex who can help too.

Lin Chen

unread,
Oct 6, 2023, 6:00:42 AM10/6/23
to hcp-...@humanconnectome.org, Yang, Chunhui

Yang, Chunhui

unread,
Oct 6, 2023, 7:25:32 AM10/6/23
to Lin Chen, hcp-...@humanconnectome.org
Hi Lin,

Feel free to let me know if you encounter any issues running the tICA pipeline.

Alex

From: Lin Chen <clin...@gmail.com>
Sent: Friday, October 6, 2023 6:00:25 AM
To: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Cc: Yang, Chunhui <chunh...@wustl.edu>

Lin Chen

unread,
Oct 8, 2023, 10:58:27 AM10/8/23
to Yang, Chunhui, hcp-...@humanconnectome.org
Dear Axel,

Thank you!

I tried to run the pipeline for 3 test subjects using

tICAPipeline.sh --study-folder=fmriresults01 –subject-list=<subject1>@<subject2>@<subject3> --fmri-names=rfMRI_REST_Atlas_MSMAll_hp0_clean.dtseries.nii@rfMRI_REST_Atlas_MSMAll_hp0_clean.dtseries.nii@rfMRI_REST_Atlas_MSMAll_hp0_clean.dtseries.nii --proc-string='_Atlas_MSMAll_hp0_clean' --surf-reg-name='MSMAll' --num-wishart=5 --starting-step='MIGP' --stop-after-step=ConcatGroupSICA --output-fmri-name='rfMRI_REST' --fix-high-pass='0' --out-group-name='output' --fmri-resolution='2' --low-res='32' –subject-expected-timepoints='1912'


but this throws an error I don't really understand:


s = 1

Warning: failed to save to checkpoint file

> In MIGP (line 83)

s = 2


Error using eigs>checkInputs

Number of eigenvalues requested must be a nonnegative integer. Instead, it was -1.


Error in eigs (line 90)

innerOpts, useEig, originalB] = checkInputs(varargin{:});


Error in MIGP (line 67)

[uu, ~] = eigs(W * W', min(dPCAinternal, size(W, 1) - 1)); % reduce W to dPCAinternal eigenvectors


How can I resolve this?


Thank you in advance,

Lin




Yang, Chunhui

unread,
Oct 8, 2023, 11:13:31 AM10/8/23
to Lin Chen, hcp-...@humanconnectome.org
Hi Lin,

I think the issue is raised because the script cannot correctly find your dense timeseries for processing. The argument fmri-names don't need the proc-strings included and only requires single-run or multi-run fMRI names. I have several questions that I may need clarifications from you to help me better understand your task. 
  1. Are your data single run or multi-run processed? From your original argument "--fmri-names", I assume you were using multi-run. 
  2. Do you have your dataset group averaged and save under directory: fmriresults01/output, which is ${StudyFolder}/${OutGroupName}? I suggest you use the absolute path for the argument --study-folder, for example --study-folder=/yourpath/fmriresults01.
If your data is processed via multi-run and you indeed have your subjects group averaged and saved under the group folder, then the command line can be:

tICAPipeline.sh --study-folder=fmriresults01 –subject-list=<subject1>@<subject2>@<subject3> --fmri-names='rfMRI_REST'--mrfix-concat-name='rfMRI_REST' --proc-string='_Atlas_MSMAll_hp0_clean' --surf-reg-name='MSMAll' --num-wishart=5 --starting-step='MIGP' --stop-after-step=ConcatGroupSICA --output-fmri-name='rfMRI_REST' --fix-high-pass='0' --out-group-name='output' --fmri-resolution='2' --low-res='32' –subject-expected-timepoints='1912'


Alex

From: Lin Chen <clin...@gmail.com>
Sent: Sunday, October 8, 2023 10:58 AM
To: Yang, Chunhui <chunh...@wustl.edu>
Cc: hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>

Lin Chen

unread,
Oct 8, 2023, 11:19:45 AM10/8/23
to Yang, Chunhui, hcp-...@humanconnectome.org
Dear Alex,

Thank you for your reply!
It's HCP data and pre-processed by HCP; I don't have a group-average, just the single fMRIs that I like to concat for group ICA

Best and thank you,
Lin

Yang, Chunhui

unread,
Oct 8, 2023, 11:35:19 AM10/8/23
to Lin Chen, hcp-...@humanconnectome.org
If you are using the HCP-Young Adult dataset, then here're the steps that you may want to follow.
  1. Make your group average dataset using https://github.com/Washington-University/HCPpipelines/blob/master/Examples/Scripts/MakeAverageDatasetBatch.sh. You need to specify the study folder, the subject list and also remember to update with your own environment script (line#62).
  2. After the step1, you should have a group averaged folder generated, by default it will be the directory: ${StudyFolder}/GroupAnalysis_n${nSubj}. Then you can run the tICA pipeline using the following command:

    tICAPipeline.sh --study-folder=${StudyFolder}–subject-list=<subject1>@<subject2>@<subject3> --fmri-names='rfMRI_REST1_RL@rfMRI_REST1_LR@rfMRI_REST2_LR@rfMRI_REST2_RL' --proc-string='_Atlas_MSMAll_hp0_clean' --surf-reg-name='MSMAll' --num-wishart=5 --starting-step='MIGP' --stop-after-step=ConcatGroupSICA --output-fmri-name='rfMRI_REST' --fix-high-pass='0' --out-group-name=GroupAnalysis_n${nSubj} --fmri-resolution='2' --low-res='32' –subject-expected-timepoints='1912'
Please let me know if you encounter any issues.

Alex

From: Lin Chen <clin...@gmail.com>
Sent: Sunday, October 8, 2023 11:19 AM

Yang, Chunhui

unread,
Oct 8, 2023, 11:40:55 AM10/8/23
to Lin Chen, hcp-...@humanconnectome.org
Sorry, the previous email has typos. Here's the command line in step2 after fixed if you want to use the 3T resting state fMRI data from the HCP-Young Adult dataset:

tICAPipeline.sh --study-folder=${StudyFolder} \
     --subject-list=<subject1>@<subject2>@<subject3> \
     --fmri-names='rfMRI_REST1_RL@rfMRI_REST1_LR@rfMRI_REST2_LR@rfMRI_REST2_RL' \
     --proc-string='_Atlas_MSMAll_hp2000_clean' \
     --surf-reg-name='MSMAll' \
     --num-wishart=5 \
     --starting-step='MIGP' \
     --stop-after-step=ConcatGroupSICA \
     --output-fmri-name='rfMRI_REST' \
     --fix-high-pass='2000' \
     --out-group-name=GroupAnalysis_n${nSubj} \
     --fmri-resolution='2' \
     --low-res='32' \
     --subject-expected-timepoints='1912'

Alex

From: Yang, Chunhui <chunh...@wustl.edu>
Sent: Sunday, October 8, 2023 11:34 AM
To: Lin Chen <clin...@gmail.com>

Yang, Chunhui

unread,
Oct 8, 2023, 3:51:03 PM10/8/23
to Lin Chen, hcp-...@humanconnectome.org
And the `--subject-expected-timepoints=` should be 4800 for 3T HCP-YA resting state data. However, if you are using the data you collected by your own in HCP-style, you may want to adjust the arguments. If you can provide more information on your datasets, then I may be able to provide more specific help.

Alex

From: Yang, Chunhui <chunh...@wustl.edu>
Sent: Sunday, October 8, 2023 11:40 AM

Lin Chen

unread,
Oct 9, 2023, 7:26:53 AM10/9/23
to Yang, Chunhui, hcp-...@humanconnectome.org
Dear Alex,
Thank you. It's HCP-D data.

Sorry for all these questions but the fmri-names list that doesn't list the .dtseries but rather the rfMRI .dscalar files?

Best
Lin

Yang, Chunhui

unread,
Oct 9, 2023, 10:17:13 AM10/9/23
to Lin Chen, hcp-...@humanconnectome.org
Hi Lin,

The fmri-names lists the name of the fMRI runs not the file names, for example, 'rfMRI_REST1_RL@rfMRI_REST1_LR@rfMRI_REST2_LR@rfMRI_REST2_RL' for HCP-YA 3T resting state using the four single runs. For your case using the HCP-D dataset, if your previous processing on the HCP-D resting state follows a multi-run manner (e.g. using sICA Multi-run FIX), then you should have a multi-run concatenated fMRI name, for example something like rfMRI_REST, and also a dense timeseries file under ${StudyFolder}/${Subject}/MNINonLinear/Results/rfMRI_REST/rfMRI_REST_Atlas_MSMAll_hp0_clean.dtseries.nii. Since we recommend multi-run processing for HCP-D, I assume the following command should work in your case, as long as you have processed your data using the multi-run setting:

tICAPipeline.sh --study-folder=${StudyFolder} \
     --subject-list=<subject1>@<subject2>@<subject3> \
     --fmri-names='rfMRI_REST1_AP@rfMRI_REST1_PA@rfMRI_REST2_AP@rfMRI_REST2_PA' \
     --mrfix-concat-name='rfMRI_REST' \
     --proc-string='_Atlas_MSMAll_hp0_clean' \
     --surf-reg-name='MSMAll' \
     --num-wishart=5 \
     --starting-step='MIGP' \
     --stop-after-step=ConcatGroupSICA \
     --output-fmri-name='rfMRI_REST' \
     --fix-high-pass='0' \
     --out-group-name=GroupAnalysis_n${nSubj} \
     --fmri-resolution='2' \
     --low-res='32' \
     --subject-expected-timepoints='1912'

The arguments marked bold are those you should pay attention to. If you have a larger sample size in your study (e.g. more than 100 subjects), you may want to switch the number of wishart filtering from 5 to 6 to reduce more random noise thus a smaller number of group sICA components, depending on the number of components estimated from group sICA.

Alex

From: Lin Chen <clin...@gmail.com>
Sent: Monday, October 9, 2023 7:26 AM

Glasser, Matt

unread,
Oct 9, 2023, 11:58:07 AM10/9/23
to hcp-...@humanconnectome.org, Lin Chen

I will note that there is a new data release percolating through the NDA now.  That has all of the fMRI data and improved spatial ICA and new temporal ICA denoising.  You would definitely want to use that one for any final analyses.


Matt.

Lin Chen

unread,
Oct 10, 2023, 12:55:01 PM10/10/23
to Glasser, Matt, hcp-...@humanconnectome.org
Thank you both!
Reply all
Reply to author
Forward
0 new messages