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

Problem getting cifti data #378

Closed rob-mccutcheon closed 4 years ago

rob-mccutcheon commented 4 years ago

Describe the bug I have ran the singularity of xcp engine 1.0 successfully. I wanted to get CIFTI outputs so have reran using version 1.2.1. However, I do not get any CIFTI outputs, and furthermore the files in my fcon folder all have zero bytes.

I have been using fmriprep version 20.0.5, and the cifti filename is sub-A00008965_task-rest_space-fsLR_den-91k_bold.dtseries.nii. Should I put the cifti path in my cohort file?

Many thanks,

Rob

Cohort file Paste cohort file between the triple backticks

id0,img
sub-A00000844,sub-A00000844/func/sub-A00000844_task-rest_space-MNI152NLin6Asym_desc-preproc_bold.nii.gz
...,...,...

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/k1201869/data_bind/src/brain_glu_schi/preprocessing/fc-36p_despike.dsn
sequence=anatomical
standard=MNI%2x2x2

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

pipeline=prestats,confound2,regress,fcon,reho,alff,roiquant,norm,qcfc

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

prestats_rerun[1]=1
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]=0
confound2_censor_contig[2]=0
confound2_framewise[2]=fds:0.167,dv:2
confound2_rerun[2]=1
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]=all
fcon_metric[4]=corrcoef
fcon_thr[4]=N
fcon_rerun[4]=0
fcon_cleanup[4]=1

###################################################################
# 5 REHO
###################################################################

reho_nhood[5]=vertices
reho_roikw[5]=0 # does nothing at the moment
reho_sptf[5]=susan
reho_smo[5]=6
reho_rerun[5]=0
reho_cleanup[5]=1

###################################################################
# 6 ALFF
###################################################################

alff_hipass[6]=0.01
alff_lopass[6]=0.08
alff_sptf[6]=susan
alff_smo[6]=6
alff_rerun[6]=0
alff_cleanup[6]=1

###################################################################
# 7 ROIQUANT
###################################################################

roiquant_atlas[7]=all
roiquant_globals[7]=1
roiquant_vol[7]=0
roiquant_rerun[7]=0
roiquant_cleanup[7]=1

###################################################################
# 8 NORM
###################################################################
norm_primary[8]=1
norm_rerun[8]=0
norm_cleanup[8]=1

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

Error message Paste your error message between the backticks


Current processing step:
Localising subject metadata...
····································································
· [Parsing subject identifiers]
· [Creating output directory]
· [/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828]
· [Initialising space mapping]
· [Initialising derivative maps]
· [Initialising atlas system]
· Ingress
· [Native space: sub-A00000828_anatomical]
· [Standard space: MNI]
· [Anatomical space: sub-A00000828_anatomical]
· [Priming analytic audit]
· [Priming quality assessment]

Current processing step:
Localising image
····································································
· [Verifying that images are present]
· [Conforming and localising images]

Current processing step:
Localising design
····································································
· [Writing localised design]
· [Evaluating subject variables]
cp: cannot open '/xcpEngine/space/MNI/MNI-2x2x2.nii.gz' for reading: Permission denied

Current processing step:
Ensure matching orientation
····································································
· Input: /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828~TEMP~.nii.gz
· Template: /xcpEngine/space/MNI/MNI-2x2x2.nii.gz
· Output root:
· checking the orientation of img and template
· img and template orientation are not the same
· make it: LPI -> NO-DSET

Current processing step:
getting data from fmriprep directory
····································································
· checking refvolume and structural orientation
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_referenceVolume.nii.gz does not exist . 
/xcpEngine/core/functions/exec_ants: line 1: 20696 Segmentation fault      ${ANTSPATH}/"${@}"
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_struct.nii.gz does not exist . 
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_referenceVolume.nii.gz does not exist . 
/xcpEngine/core/functions/exec_ants: line 1: 20700 Segmentation fault      ${ANTSPATH}/"${@}"
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_referenceVolume.nii.gz does not exist . 
/xcpEngine/core/functions/exec_ants: line 1: 20704 Segmentation fault      ${ANTSPATH}/"${@}"
· generate mask and referenceVolumeBrain
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_referenceVolume.nii.gz does not exist . 
/xcpEngine/core/functions/exec_ants: line 1: 20709 Segmentation fault      ${ANTSPATH}/"${@}"
Image Exception : #22 :: ERROR: Could not open image /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_structmask
terminate called after throwing an instance of 'RBD_COMMON::BaseException'
/xcpEngine/core/functions/exec_fsl: line 1: 20713 Aborted                 ${FSLDIR}/bin/"${@}"
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_mask.nii.gz does not exist . 
 file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_referenceVolume.nii.gz does not exist . 
/xcpEngine/core/functions/exec_ants: line 1: 20716 Segmentation fault      ${ANTSPATH}/"${@}"
Cannot open volume /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_mask for reading!
Cannot open volume /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_mask for reading!
· Quality assessment
Error in readNifti(mask1path) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_segmentation.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(mask1path) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/prestats/sub-A00000828_segmentation.nii.gz'
Execution halted

Current processing step:
Generating confound matrix
····································································
· Generating temporal mask
· [Computing framewise displacement]
· [Computing DVARS]
· [Selecting quality criteria]
· [Quality criterion: fd < .334000000]
· [Quality criterion: dvars < 2]
· [Applying framewise threshold to time series]
· [Evaluating data quality]
· relative maximum motion
· relative mean motion
· Including realignment parameters
· Including csf
· Including gsr
· Including wm
· [Including 1 derivative(s)]
· [Including 2 power(s)]

Current processing step:
Validating confound model
····································································

Current processing step:
Demeaning and detrending BOLD timeseries
····································································
· [Applying polynomial detrend]
· [Order: 2]
· [Executing detrend: Confound matrix]
Cannot open volume -mul for reading!

Current processing step:
Despiking BOLD timeseries
····································································
· [Executing despike: Primary analyte]
· [Executing despike: Derivative images]
· [Executing despike: Confound matrix]

Current processing step:
Temporally filtering image and confounds
····································································
· [butterworth filter]
· [High pass frequency: 0.01]
· [Low pass frequency: 0.08]
Cannot open volume -mul for reading!

Current processing step:
Converting BOLD timeseries to confound residuals
····································································
· [Computing confound correlations]
· [Executing detrend]
Cannot open volume -mul for reading!

Current processing step:
Spatially filtering image
····································································
· [Configuring SUSAN]
· No appropriate USAN: reconfiguring pipeline
· to smooth to uniformity instead
/xcpEngine/core/functions/configure: line 2: regress_sptf[3][3]=uniform: command not found
/xcpEngine/core/functions/write_config: line 3: regress_sptf[3][3]: bad substitution
Exception caught during reference file reading 

itk::ImageFileReaderException (0x55772cdb8040)
Location: "unknown" 
File: /tmp/ants/build/ITKv5-install/include/ITK-5.0/itkImageFileReader.hxx
Line: 139
Description:  Could not create IO object for reading file /xcpEngine/space/MNI/MNI-2x2x2.nii.gz
The file doesn't exist. 
Filename = /xcpEngine/space/MNI/MNI-2x2x2.nii.gz

 file /xcpEngine/space/MNI/MNI-2x2x2.nii.gz
/xcpEngine/core/functions/exec_ants: line 1: 26312 Segmentation fault      ${ANTSPATH}/"${@}"
niiRead(): error opening file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/boldtoMNI.nii.gz
niiRead(): error opening file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/lh_surface.nii.gz
niiRead(): error opening file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/boldtoMNI.nii.gz
niiRead(): error opening file /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/rh_surface.nii.gz

While running:
/xcpEngine/thirdparty/workbench/bin_rh_linux64/../exe_rh_linux64/wb_command -cifti-create-dense-scalar /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/sub-A00000828_residual.dscalar.nii -left-metric /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/sub-A00000828_residual_lh.func.gii -right-metric /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress/sub-A00000828_residual_rh.func.gii

ERROR: NAME OF FILE: sub-A00000828_residual_lh.func.gii
PATH TO FILE: /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/regress

File does not exist.

/xcpEngine/core/functions/write_config: line 3: regress_sptf[3][3]: bad substitution

Current processing step:
Functional connectome: HarvardOxford
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_HarvardOxford.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_HarvardOxford.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: aal116
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_aal116.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_aal116.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: desikanKilliany
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_desikanKilliany.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_desikanKilliany.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: glasser360
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_glasser360.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_glasser360.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: gordon333
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_gordon333.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_gordon333.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: power264
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_power264.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_power264.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer100x17
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer100x17.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer100x17.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer100x7
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer100x7.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer100x7.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer200x17
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer200x17.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer200x17.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer200x7
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer200x7.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer200x7.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer400x17
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer400x17.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer400x17.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Functional connectome: schaefer400x7
····································································
· Mapping network to image space
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· Computing network timeseries
Error in readNifti(roipath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer400x7.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(roipath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/sub-A00000828_atlas/sub-A00000828_schaefer400x7.nii.gz'
Execution halted
· Computing adjacency matrix
Error in read.table(tsPath, header = F) : no lines available in input
Calls: as.matrix -> unname -> read.table
Execution halted
Error in read.table(amatPath, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted
· Determining node coverage
Error in read.table(opt$input, header = F) : no lines available in input
Calls: as.matrix -> read.table
Execution halted

Current processing step:
Computing voxelwise ReHo
····································································
· Determining voxel neighbourhood
· Vertices
· Computing regional homogeneity (ReHo)
· Standardising ReHo values

Current processing step:
Spatially filtering ReHo map
····································································
· Filter: susan
· Smoothing kernel: 6 mm
· Generating a mask using 3dAutomask
· Standardising ReHo values

Current processing step:
Spatially filtering image
····································································
· [Configuring SUSAN]
· No appropriate USAN: reconfiguring pipeline
· to smooth to uniformity instead
/xcpEngine/core/functions/configure: line 2: alff_sptf[cxt][6]=uniform: command not found
/xcpEngine/core/functions/write_config: line 3: alff_sptf[cxt][6]: bad substitution

Current processing step:
Amplitude of low-frequency fluctuations
····································································
· At smoothness 0 mm
· Ensuring integer periods
· Odd volume count: Excising first volume
· Computing power spectrum
· Computing square root of amplitudes
· Extracting power spectrum at the low frequency band
· 0.01 Hz is approximately position 2
· of the power spectrum. There are about 24 frequency
· positions corresponding to the passband (0.08 - 0.01 Hz)
· in the power spectrum.
· Computing the amplitude of low-frequency fluctuations (ALFF)
· Standardising ALFF values
/xcpEngine/core/functions/write_config: line 3: alff_sptf[cxt][6]: bad substitution
cp: cannot open '/xcpEngine/space/MNI/MNI-2x2x2.nii.gz' for reading: Permission denied

Current processing step:
Normalising using ANTs
····································································
· [Selecting transforms to apply]
· [Normalising primary dataset]
· [Applying composite diffeomorphism to primary dataset]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [Applying composite diffeomorphism to derivative images:]
· [alff]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [alffZ]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [reho]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [rehoZ]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [rehoZ_sm6]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [reho_sm6]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted

Current processing step:
Preparing depth map
····································································
· Segmentation:
· Output: /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/qcfc/sub-A00000828_depthMap.nii.gz
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "i" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
readlink: invalid option -- 'i'
Try 'readlink --help' for more information.

Current processing step:
Aligning depth map
····································································
· Resampling to 6mm isotropic: minimally preprocessed
· Resampling to 6mm isotropic: denoised
· Aligning depth map to sequence space

Current processing step:
Preparing summary graphics
····································································
· Acquiring arguments
· Generating visuals
Warning messages:
1: Use of `ts$value` is discouraged. Use `value` instead. 
2: Use of `ts$value` is discouraged. Use `value` instead. 
3: Use of `ts$value` is discouraged. Use `value` instead. 
4: Use of `ts$value` is discouraged. Use `value` instead. 
5: Use of `ts$value` is discouraged. Use `value` instead. 
6: Use of `ts$value` is discouraged. Use `value` instead. 
Error in readNifti(maskpath) : 
  Failed to read image from path /home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/qcfc/sub-A00000828~TEMP~-onion-rs.nii.gz
Calls: readNifti -> .Call
In addition: Warning message:
In readNifti(maskpath) :
  nifti_image_read: failed to find header file for '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/qcfc/sub-A00000828~TEMP~-onion-rs.nii.gz'
Execution halted

Current processing step:
Estimating loss of temporal degrees of freedom
····································································
· 7.137621 number of spikes FD
/xcpEngine/modules/qcfc/qcfc.mod: line 253: 0           +     7.137621         : syntax error: invalid arithmetic operator (error token is ".137621         ")
· 0 number of spikes FD
/xcpEngine/modules/qcfc/qcfc.mod: line 262: nSpikesDV: command not found
· Total lost tDOF: 0

Current processing step:
Estimating post-processing DVARS
····································································
· [Computing DVARS]
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "n" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
Traceback (most recent call last):
  File "/xcpEngine/core/report.py", line 405, in <module>
    moving = load_img(outdir+'/norm/'+prefix+'_intensityStd.nii.gz')
  File "/usr/local/miniconda/lib/python3.7/site-packages/nilearn/image/image.py", line 1063, in load_img
    return check_niimg(img, wildcards=wildcards, dtype=dtype)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nilearn/_utils/niimg_conversions.py", line 251, in check_niimg
    raise ValueError("File not found: '%s'" % niimg)
ValueError: File not found: '/home/k1201869/data_bind/data/braingluschi/denoised/36pdespike122/sub-A00000828/norm/sub-A00000828_intensityStd.nii.gz'
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

Runtime Information Singularity

$ -m n

$ -N xcp

$ -o /home/k1201869/glu_rs/src/logs/xcp_o$TASK_ID

$ -e /home/k1201869/glu_rs/src/logs/xcp_e$TASK_ID

module load singularity

set SIMG='/home/k1201869/singularity_images/xcpEngine122.simg' set TEMP_COHORT='/home/k1201869/glu_rs/src/brain_gluschi/preprocessing/temp/tempcohort$SGE_TASK_ID.csv'

singularity run -B /home/k1201869/glu_rs:${HOME}/data_bind\ ${HOME}/singularity_images/xcpEngine122.simg\ -c ${TEMP_COHORT} \ -d ${HOME}/data_bind/src/brain_glu_schi/preprocessing/fc-36p_despike.dsn \ -r ${HOME}/data_bind/data/braingluschi/BIDS_data/ \ -o ${HOME}/data_bind/data/braingluschi/denoised/36pdespike122/ \

Additional context

a3sha2 commented 4 years ago

pls pull for latest docker image

rob-mccutcheon commented 4 years ago

Thank you, that works! Could I also please ask a question about the connectivity matrices generate by FCON - for e.g. Desikan-Killany are these calculated in surface space or is it from a version of the atlas that has been sampled into volumetric space?

a3sha2 commented 4 years ago

all in volume space

rob-mccutcheon commented 4 years ago

Thank you again.

One more freesurfer related question: I now have 'sub-XXXresidual{r/l}h.func.gii' in the 'regress' folder. These images are in fsaverage space.

  1. Are these generated from the fsLR files in the fmriprep folder, or upsampled from the fsaverage5?
  2. Is there a way to specify getting denoised images in fsaverage5/6 or fsnative space?

Thanks

Rob

a3sha2 commented 4 years ago

Yes you are right, the current fmriprep do not write out fsaverage5 surfaces, you can check freesurfer directory of one the fmriprep output. if you want to change cifti files to fsaverage5 or 6, you can use mri_surf2surf

rob-mccutcheon commented 4 years ago

Edited comment as issue was secondary to my bug, not xcp

thanks again!

rob-mccutcheon commented 4 years ago

Dear @a3sha2

Sorry, the issues does in fact seem to still be here

In the regress folder are 'subid-residual_{l/r}h.func.gii' the surface equivalents of 'subid-residualised.nii.gz'?

I ask because I have extracted the time series from the surface files and the connectivity matrixes generated from these look as though they may not have been denoised, as almost no negatively weighted connections (in contract to the matrices in the fcon folder which I believe have been generated from subid-residualised.nii.gz)

Thank you again!

a3sha2 commented 4 years ago

how man nodes or vertices do you have? you might have flip the matrix of time series

rob-mccutcheon commented 4 years ago

I'm using the gordon atlas so 333 nodes (and I have 165 timepoints), I thought it was that initially but the connectivity matrix I get using the below approach is 333*333 so I don't think it is

def gordon_surface_conn(sub_id, denoised_path):
    ''' Returns a Gordon connectivity matrix from a 
    XCP denoised file in surface space '''

    atlas_l_path = f'/home/k1201869/glu_rs/data/atlas_data/gordon/Parcels_L_164.func.gii'
    atlas_r_path = f'/home/k1201869/glu_rs/data/atlas_data/gordon/Parcels_R_164.func.gii'
    surf_image_l_path = f'{denoised_path}/sub-{sub_id}/regress/sub-{sub_id}_residual_lh.func.gii'
    surf_image_r_path = f'{denoised_path}/sub-{sub_id}/regress/sub-{sub_id}_residual_rh.func.gii'

    surf_image_l = surface.load_surf_data(surf_image_l_path)
    atlas_image_l = surface.load_surf_data(atlas_l_path)
    surf_image_r = surface.load_surf_data(surf_image_r_path)
    atlas_image_r = surface.load_surf_data(atlas_r_path)

    l_roi_timecourses = []
    # We don't include the first roi as this is background
    for i in np.unique(atlas_image_l)[1:]:
        roi_idxs = np.where(atlas_image_l==i)
        l_roi_timecourses.append(np.mean(surf_image_l[roi_idxs], axis=0))

    r_roi_timecourses = []
    # We don't include the first roi as this is background
    for i in np.unique(atlas_image_r)[1:]:
        roi_idxs = np.where(atlas_image_r==i)
        r_roi_timecourses.append(np.mean(surf_image_r[roi_idxs], axis=0))

    bilat_timecourses = np.array(l_roi_timecourses + r_roi_timecourses)

    correlation_measure = ConnectivityMeasure(kind='correlation')
    connectivity_matrix = correlation_measure.fit_transform([bilat_timecourses.T])[0]

    return connectivity_matrix
a3sha2 commented 4 years ago

@robmcc10 I expect the connectivity matrix to be the same as volume. what is space of the gordon parcel you are using? remember _residual_rh.func.gii is in fsaverage ( not fsaverage5).

rob-mccutcheon commented 4 years ago

The gordon parcellation is in the same space as _residual_rh.func.gii (163842 vertices), but the connectivity matrices are very different between surface and volume (the surface based one has almost no negative edges)

a3sha2 commented 4 years ago

pls can you share your Parcels_L_164.func.gii and Parcels_R_164.func.gii

rob-mccutcheon commented 4 years ago

They are the parcels available at https://sites.wustl.edu/petersenschlaggarlab/resources/

Thanks for looking into this

a3sha2 commented 4 years ago

sorry for late response. The issue is in your python code, the last line. remove the transform here connectivity_matrix = correlation_measure.fit_transform([bilat_timecourses.T])[0] by change it to connectivity_matrix = correlation_measure.fit_transform([bilat_timecourses])[0].

after that you can compare your result with just simple connectivity_matrix =np.corrcoef(bilat_timecourses)

rob-mccutcheon commented 4 years ago

I'm not sure this is ii as the timecourses matrix needs to be transposed otherwise one gets a matrix that is number_time_points number_timepoints as opposed number_nodes number_nodes.

np.corrcoef(bilat_timecourses)gives an almost identical result to correlation_measure.fit_transform([bilat_timecourses.T])[0]

Both still have this same issue of having way fewer negative edges (and a generally very different network structure) to the connectivity matrices calculated from the volumes

Edit: It seems the issue is that when loading the parcellation the rois are getting broken up and assigned to the wrong vertices, i.e. not an xcp engine issue. Will post here once I've fixed it in case anyone comes across same problem

rob-mccutcheon commented 4 years ago

The issue was not xcp related but a lack of correspondence between freesurfer and hcp vertices, sorry for any confusion! To map the gordon atlas from hcp to freesurfer space do the following (instructions below for right hemisphere):

  1. Download R.sphere.32k_fs_LR.surf.gii from

https://github.com/Washington-University/HCPpipelines/tree/master/global/templates/standard_mesh_atlases

and R-to-fs_LR_fsaverage.R_LR.spherical_std.164k_fs_R.surf.gii from

https://github.com/Washington-University/HCPpipelines/blob/master/global/templates/standard_mesh_atlases/fs_R

Run:

wb_command -label-resample Parcels_R.func.gii R.sphere.32k_fs_LR.surf.gii fs_R-to-fs_LR_fsaverage.R_LR.spherical_std.164k_fs_R.surf.gii BARYCENTRIC right.fsaverage164.label.gii