Skip to content

Commit

Permalink
don't fail post-install of spm in brainvisa.configuration.neuroConfig…
Browse files Browse the repository at this point in the history
… is not found
  • Loading branch information
denisri committed Jan 23, 2024
1 parent 570c815 commit 26d2103
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions python/casa_distro/thirdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,27 +187,28 @@ def get_spm12_standalone_init():
from brainvisa.configuration import neuroConfig
except ImportError:
# no axon in the image
pass
neuroConfig = None
conf = list(neuroConfig.readConfiguration(neuroConfig.mainPath, None, ''))
siteOptionFile = conf[0][1]
if siteOptionFile and os.path.exists(siteOptionFile):
neuroConfig.app.configuration.load(siteOptionFile)
neuroConfig.app.configuration.SPM.spm12_standalone_path = \
'/usr/local/spm12-standalone'
neuroConfig.app.configuration.SPM.spm12_standalone_command = \
'/usr/local/spm12-standalone/run_spm12.sh'
mcr_paths = glob.glob('/usr/local/spm12-standalone/mcr/v*')
if len(mcr_paths) != 1:
raise RuntimeError("Cannot find the MATLAB Compiler Runtime in the "
"expected location, please check your "
"install_thirdparty setting.")
neuroConfig.app.configuration.SPM.spm12_standalone_mcr_path = mcr_paths[0]
from pprint import pprint
pprint(neuroConfig.app.configuration)
neuroConfig.app.configuration.save(siteOptionFile)
if neuroConfig is not None:
conf = list(neuroConfig.readConfiguration(neuroConfig.mainPath, None, ''))
siteOptionFile = conf[0][1]
if siteOptionFile and os.path.exists(siteOptionFile):
neuroConfig.app.configuration.load(siteOptionFile)
neuroConfig.app.configuration.SPM.spm12_standalone_path = \
'/usr/local/spm12-standalone'
neuroConfig.app.configuration.SPM.spm12_standalone_command = \
'/usr/local/spm12-standalone/run_spm12.sh'
mcr_paths = glob.glob('/usr/local/spm12-standalone/mcr/v*')
if len(mcr_paths) != 1:
raise RuntimeError("Cannot find the MATLAB Compiler Runtime in the "
"expected location, please check your "
"install_thirdparty setting.")
neuroConfig.app.configuration.SPM.spm12_standalone_mcr_path = mcr_paths[0]
from pprint import pprint
pprint(neuroConfig.app.configuration)
neuroConfig.app.configuration.save(siteOptionFile)
'''
scripts = {'/casa/install/templates/brainvisa/spm.py': spm_script}

Expand Down

0 comments on commit 26d2103

Please sign in to comment.