Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ workflow {
}
else {
ch_after_preqc = ch_dwi_bvalbvec.dwi
bvs_after_preqc = ch_dwi_bvalbvec.bvs
bvs_after_preqc = ch_dwi_bvalbvec.bvs_files
}

if (params.run_denoising){
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"tracking/localtracking": {
"branch": "main",
"git_sha": "63dc80c43cdca798a5f11cd5124da35337a94ac5",
"git_sha": "ec4f04fd25e3167ba495094925027248722c1aad",
"installed_by": ["modules"]
},
"utils/extractb0": {
Expand Down
15 changes: 11 additions & 4 deletions modules/nf-neuro/tracking/localtracking/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@ process TRACKING_LOCALTRACKING {
}

"""
# Set home directory. This is problematic if the container is run
# with non-root user which does not create a home directory. When
# running the local tracking using GPU, its trying to write to
# ~/.cache/ directory, causing the job to fail.
mkdir -p /tmp
export HOME=/tmp

export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1

local_step="$local_step"
local_step_size="$local_step"
if [[ -z "$local_step" ]] && [[ -n "$local_step_pct" ]]; then
pixdim=\$(scil_header_print_info $wm --keys pixdim | tr -d '[]' | awk '{for(i=2;i<=4;i++) if(\$i>0 && (\$i<min || min=="")) min=\$i} END {print min}')
local_step=\$(awk -v pixdim="\$pixdim" -v pct="$local_step_pct" 'BEGIN {printf "--step %.6f", pixdim * pct / 100}')
local_step_size=\$(awk -v pixdim="\$pixdim" -v pct="$local_step_pct" 'BEGIN {printf "--step %.6f", pixdim * pct / 100}')
fi

if [ "${local_tracking_mask}" == "wm" ]; then
Expand Down Expand Up @@ -94,7 +101,7 @@ process TRACKING_LOCALTRACKING {
scil_tracking_local $fodf ${prefix}__local_seeding_mask.nii.gz \
${prefix}__local_tracking_mask.nii.gz tmp.trk $enable_gpu\
$local_algo $local_seeding $local_nbr_seeds\
$local_random_seed $local_step $local_theta\
$local_random_seed \$local_step_size $local_theta\
$local_sfthres $local_min_len\
$local_max_len $compress $basis -f

Expand All @@ -113,7 +120,7 @@ process TRACKING_LOCALTRACKING {
"random_seed": $task.ext.local_random_seed,
"is_compress": "${task.ext.local_compress_streamlines}",
"compress_value": $task.ext.local_compress_value,
"step": \${local_step/--step /},
"step": \${local_step_size/--step /},
"theta": $task.ext.local_theta,
"sfthres": $task.ext.local_sfthres,
"min_len": $task.ext.local_min_len,
Expand Down