PennLINC / xcpEngine

Official public repository for the XCP Engine. This tool is deprecated in favor of XCP-D and ASLPrep.
MIT License
66 stars 42 forks source link

Seed-based connectivity with mask (using singularity) #338

Open danella opened 4 years ago

danella commented 4 years ago

Describe the bug I have successfully added seeds using MNI and radius; however, now I would like to use a mask. I am running analyses in singularity using the following code.

export DATA_ROOT=/media/danella/DATA1/BEAM/Preprocessed

singularity run -B ${DATA_ROOT}:${HOME}/data ${HOME}/singularity/xcpEngine_190821.simg -d ${HOME}/data/fc-36p_despike_scrub_FD5_add_AMYmask_200524.dsn -c ${HOME}/data/func_cohort_190821_MNI_good_rest_105.csv -o ${HOME}/data/xcp_MNI_despike_scrub_FD5_rest -t 0 -r ${HOME}/data/fmriprep

I put my mask in ${DATA_ROOT}/parcellations/

Cohort file Paste cohort file between the triple backticks

Just running with a single participant for now - not so relevant.

Design File Paste your entire design (.dsn) file between the triple backticks

#!/usr/bin/env bash

###################################################################
#  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  #
###################################################################

###################################################################
# This design file stores the values of all variables required to
# execute a complete neuroimage processing pipeline. You may
# execute the analysis specified in this design file by calling
# (in any v4 or higher bash terminal):
#
# xcpEngine -d <design> -c <cohort> -o <output> <options>
#
# Variables fall into five general categories:
# * ANALYSIS VARIABLES are used at all stages of this analysis.
# * PIPELINE specifies the modules that comprise the analysis.
# * MODULE VARIABLES are used during one stage of the analysis.
#                  These are typically array variables with array
#                  indices equal to the index of the module that
#                  calls them.
# * OUTPUT VARIABLES may be used at all stages of the analysis.
#                  These are typically array variables with array
#                  indices equal to the value of the primary
#                  subject identifier. They will appear only in
#                  localised design files.
###################################################################

###################################################################
# ANALYSIS VARIABLES
###################################################################

analysis=fc_$(whoami)
design=/home/danella/data/fc-36p_despike_scrub_FD5_add_AMYmask_200524.dsn
sequence=anatomical
standard=MNI%2x2x2

###################################################################
# PIPELINE
###################################################################

pipeline=prestats,confound2,regress,fcon,qcfc,seed

###################################################################
# 1 PRESTATS
###################################################################

prestats_rerun[1]=1 #always rerun except when just doing a group analysis
prestats_cleanup[1]=1
prestats_process[1]=FMP

###################################################################
# 2 CONFOUND2
###################################################################

confound2_rps[2]=1
confound2_rms[2]=0
confound2_wm[2]=1
confound2_csf[2]=1
confound2_gsr[2]=1
confound2_acompcor[2]=0
confound2_tcompcor[2]=0
confound2_aroma[2]=0
confound2_past[2]=0
confound2_dx[2]=1
confound2_sq[2]=2
confound2_custom[2]=
confound2_censor[2]=1
confound2_censor_contig[2]=1
confound2_framewise[2]=fds:0.25,dv:2
confound2_rerun[2]=0 #rerun for qcfc
confound2_cleanup[2]=1

###################################################################
# 3  REGRESS
###################################################################

regress_tmpf[3]=butterworth
regress_hipass[3]=0.01
regress_lopass[3]=0.08
regress_tmpf_order[3]=1
regress_tmpf_pass[3]=2
regress_tmpf_ripple[3]=0.5
regress_tmpf_ripple2[3]=20
regress_dmdt[3]=2
regress_1ddt[3]=1
regress_smo[3]=6
regress_sptf[3]=susan
regress_usan[3]=default
regress_usan_space[3]=
regress_rerun[3]=0
regress_cleanup[3]=1
regress_process[3]=DMT-DSP-TMP-REG

###################################################################
# 4 FCON
###################################################################

fcon_atlas[4]=power264
fcon_metric[4]=corrcoef
fcon_thr[4]=N
fcon_window[4]=10
fcon_pad[4]=FALSE
fcon_rerun[4]=0 #rerun for qcfc
fcon_cleanup[4]=1

##################################################################
# 5 QCFC
###################################################################
qcfc_atlas[5]=power264
qcfc_sig[5]=fdr
qcfc_rerun[5]=0
qcfc_cleanup[5]=1

##################################################################
# 6 SEED
###################################################################
seed_mask[6]=/home/danella/data/parcellations/juelich_prob_GM_Amygdala_superficial_R_bin.nii.gz
seed_names[6]=RSA
seed_sptf[6]=susan
seed_smo[6]=4 #changed this
seed_rerun[6]=0
seed_cleanup[6]=1

Error message Paste your error message between the backticks

###################################################################
#  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  #
#                                                                 #
#  ⊗               SEED-BASED CORRELATION MODULE               ⊗  #
#                                                                 #
#  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  ⊗  #
###################################################################

[I][/home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/sub-105_ses-post_rest.nii.gz]
[O][/home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/seed]
RSA
                             -   -   -
>> mkdir -p /home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/seed/RSA/
                             -   -   -
>> mkdir -p /home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/seed/RSA/
· @0.1
                             -   -   -
>> rln /home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/prestats/sub-105_ses-post_rest_referenceVolume.nii.gz /home/danella/data/xcp_MNI_despike_scrub_FD5_rest/sub-105/ses-post/rest/seed/sub-105_ses-post_rest_referenceVolume.nii.gz
                             -   -   -
>> 9-7-1
                             -   -   -
>> 9-1
/xcpEngine/modules/seed/seed.mod: line 139: {seed_radius[cxt]}=5: command not found

Current processing step:
@1 Spatially filtering image
····································································
· @1.1
· @1.2 [Configuring SUSAN]
· @1.4
· @1.6
· @1.7b
····································································
Processing step complete:
Spatially filtering image
RSA

Current processing step:
@2 RSA
····································································
· @2.2.2
· @2.4.1
/xcpEngine/core/functions/import_image: line 19: /home/danella/data/parcellations/juelich_prob_GM_Amygdala_superficial_R_bin.nii.gz: bad substitution
****

Runtime Information Running through singularity

Additional context I recognize that I could use the utility here instead of the module. However, the last time I looked into this, the utility only used gaussian smoothing, and in my experience, I really do prefer susan for the preservation of tissue boundaries. My guess is that this has something to do with the "import_image" function not having access to the actual image, or something like that. I would appreciate any advice for how to fix this.

Also, is there any way to look at multiple masks here? I know for coordinates, you can just separate the coordinates by #. When I tried this with the mask, it gave me additional errors. Is this possible? Thanks in advance for your help!

a3sha2 commented 4 years ago

HI @danella yes susan filtering will work.

the error from this is that the mask path has to bind like you bind the docker image ${DATA_ROOT}/home/danella/data/parcellations/juelich_prob_GM_Amygdala_superficial_R_bin.nii.gz

Using the multiple mask is not possible for now, it has to be done one by one

danella commented 4 years ago

Thanks @a3sha2 . I have put the mask into the same ${DATA_ROOT} directory, which I bind like this -B ${DATA_ROOT}:${HOME}/data

but I am still getting this error:

/xcpEngine/core/functions/import_image: line 19: /home/danella/data/juelich_prob_GM_Amygdala_superficial_R_bin.nii.gz: bad substitution

Do I need to still separately bind the mask path, even if it is in the same directory as the data? I also tried that, and continued to get this error. Thanks in advance for your help.

BlackHoleExelion commented 3 years ago

I got the same issue. Any solutions available now?