Skip to content
Draft
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
4 changes: 2 additions & 2 deletions recon_surf/recon-surf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ for hemi in lh rh ; do

# Check if the surfaceRAS was correctly set and exit otherwise (sanity check in case nibabel changes their default header behaviour)
{
cmd="mris_info $outmesh | tr -s ' ' | grep -q 'vertex locs : surfaceRAS'"
cmd="mris_info $outmesh | awk '\$1 == \"vertex\" && \$2 == \"locs\" && \$3 == \":\" && \$4 == \"surfaceRAS\" { found = 1 } END { exit !found }'"
echo "echo \"$cmd\""
echo "$timecmd $cmd"
} | tee -a "$CMDF"
Expand Down Expand Up @@ -794,7 +794,7 @@ for hemi in lh rh ; do
echo "echo \"\""
} | tee -a "$CMDF"

cmd="recon-all -subject $subject -hemi $hemi -fix -no-isrunning -umask $(umask) $hiresflag $fsthreads"
cmd="env OMP_NUM_THREADS=1 ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 recon-all -subject $subject -hemi $hemi -fix -no-isrunning -umask $(umask) $hiresflag -threads 1 -itkthreads 1"
RunIt "$cmd" "$LF" "$CMDF"

# fix the surfaces if they are corrupt
Expand Down
2 changes: 1 addition & 1 deletion recon_surf/spherically_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_flipped_area(tria):
return area

fem = Solver(tria, lump=False, use_cholmod=use_cholmod)
evals, evecs = fem.eigs(k=4)
evals, evecs = fem.eigs(k=4, rng=0)

if debug:
data = dict()
Expand Down
14 changes: 12 additions & 2 deletions recon_surf/spherically_project_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ def setup_options():

if __name__ == "__main__":
import sys
from os import environ
opts = setup_options()

# The spectral projection is sensitive to tiny threaded BLAS/eigensolver
# differences, and those can be amplified by later topology correction.
for var in (
"OMP_NUM_THREADS",
"OPENBLAS_NUM_THREADS",
"MKL_NUM_THREADS",
"NUMEXPR_NUM_THREADS",
"VECLIB_MAXIMUM_THREADS",
):
environ[var] = "1"

# identify whether sksparse is installed (in which case we can use_cholmod in LaPy
try:
# ignore ruff F401 (unused import)
Expand All @@ -59,8 +71,6 @@ def setup_options():
has_sksparse = False
# First try to run standard spherical project
try:
from os import environ

from recon_surf.spherically_project import spherically_project_surface

source_surface = opts.sd / opts.subject / "surf" / f"{opts.hemi}.smoothwm.nofix"
Expand Down
Loading