Cortical Thickness Failing (using ANTS in xcpEngine)

Note: This is a duplicate post that’s open on github, but I was hoping someone here might be able to help/explain. Thanks!

Describe the bug
I have been trying to run my dataset through the xcpEngine structural pipeline, and it continually gets stuck on the Cortical thickness using DiReCT (KellyKapowski) step. It will not go past the 10th iteration (though it’s supposed to go up to 45), and the current energy always = 1 (in other datasets this number has been different).

Cohort file

id0,img
sub-ADS4107,/projects/adapt_lab/shared/ADS/data/BIDS_data/derivatives/fmriprep/sub-ADS4107/anat/sub-ADS4107_desc-preproc_T1w.nii.gz
sub-ADS4111,/projects/adapt_lab/shared/ADS/data/BIDS_data/derivatives/fmriprep/sub-ADS4111/anat/sub-ADS4111_desc-preproc_T1w.nii.gz

Design File

#!/usr/bin/env bash

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


###################################################################
# This design file stores the values of all variables required to
# execute a complete task-free functional connectivity pipeline.
# You may execute the analysis specified in this design file by
# calling (in any 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.
# * GLOBAL VARIABLES are used at all stages of all analyses.
# * MODULE VARIABLES are used during one stage of the analysis.
#                  These are typically array variables with array
#                  indices equal to the index of the analysis
#                  stage during which they are used.
# * OUTPUT VARIABLES may be used at all stages of the analysis.
#                  These are sometimes 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=struc-ACCELERATOR
design=/projects/adapt_lab/shared/ADS/Scripts/rsfMRI/xcpEngine/anat-Minimal_201903162306.dsn
sequence=anatomical
standard=MNI%1x1x1

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

pipeline=struc,qcanat

###################################################################
# 1 STRUC
###################################################################

struc_denoise_anat[1]=1
struc_prior_weight[1]=0.25
struc_posterior_formulation[1]='Socrates[1]'
struc_keepBEImages[1]=0
struc_floating_point[1]=0
struc_random_seed[1]=0
struc_bspline[1]=0
struc_fit[1]=0.3
struc_quick[1]=0
struc_seg_priors[1]=0
struc_rerun[1]=0
struc_cleanup[1]=1
struc_process[1]=ACT

###################################################################
# 2 QCANAT
###################################################################

qcanat_gm[2]=Y
qcanat_gm_val[2]=2,4
qcanat_wm[2]=Y
qcanat_wm_val[2]=3
qcanat_csf[2]=Y
qcanat_csf_val[2]=1
qcanat_cort[2]=Y
qcanat_cort_val[2]=4
qcanat_rerun[2]=0
qcanat_cleanup[2]=1

Error message
Paste your error message between the backticks

Running DiReCT for 3-dimensional images.

  Iteration 1 (of 45).  Current energy = 1.  
  Iteration 2 (of 45).  Current energy = 1.  
  Iteration 3 (of 45).  Current energy = 1.  
  Iteration 4 (of 45).  Current energy = 1.  
  Iteration 5 (of 45).  Current energy = 1.  
  Iteration 6 (of 45).  Current energy = 1.  
  Iteration 7 (of 45).  Current energy = 1.  
  Iteration 8 (of 45).  Current energy = 1.  
  Iteration 9 (of 45).  Current energy = 1.  
  Iteration 10 (of 45).  Current energy = 1.  (convergence value = -3.18099e-06, threshold = 0)
   ImageToImageFilter (0x555555c09ad0)
     RTTI typeinfo:   itk::DiReCTImageFilter<itk::Image<unsigned int, 3u>, itk::Image<float, 3u> >
     Reference Count: 1
     Modified Time: 159635
     Debug: Off
     Object Name: 
     Observers: 
       IterationEvent(Command)
     Inputs: 
       Primary: (0x555555c141a0) *
       _1: (0x555555c1d1d0)
       _2: (0x555555c145c0)
     Indexed Inputs: 
       0: Primary (0x555555c141a0)
       1: _1 (0x555555c1d1d0)
       2: _2 (0x555555c145c0)
     Required Input Names: Primary
     NumberOfRequiredInputs: 3
     Outputs: 
       Primary: (0x555555c30770)
       _1: (0x555555c302a0)
     Indexed Outputs: 
       0: Primary (0x555555c30770)
       1: _1 (0x555555c302a0)
     NumberOfRequiredOutputs: 1
     Number Of Work Units: 112
     ReleaseDataFlag: Off
     ReleaseDataBeforeUpdateFlag: Off
     AbortGenerateData: Off
     Progress: 0
     Multithreader: 
       RTTI typeinfo:   itk::PoolMultiThreader
       Reference Count: 1
       Modified Time: 193
       Debug: Off
       Object Name: 
       Observers: 
         none
       Number of Work Units: 112
       Number of Threads: 28
       Global Maximum Number Of Threads: 128
       Global Default Number Of Threads: 28
       Global Default Threader Type: PoolMultiThreader
       SingleMethod: 0
       SingleData: 0
     DynamicMultiThreading: On
     CoordinateTolerance: 1e-06
     DirectionTolerance: 1e-06
     Gray matter label = 2
     White matter label = 3
     Maximum number of iterations = 45
     Thickness prior estimate = 10
     Smoothing variance = 1
     Smoothing velocity field variance = 1.5
     Number of integration points = 10
     Maximum number of invert displacement field iterations = 20
     Initial gradient step = 0.025
     Current gradient step = 0.025
     Convergence threshold = 0
     Convergence window size = 10
     Time smoothing variance = 1
DiReCT elapsed time: 11191.3

Runtime Information
I was using a singularity container on an HPC. I had allotted 100GB of memory to the task, and readouts state that the task used only 21GB.

Additional context
I’ve run this exact pipeline with other datasets and it’s not having this issue. It may be that our anatomical files are almost double in size than in other datasets. I tried using .nii instead of .nii.gz to reduce memory usage, but the issue persisted.