Skip to content

Commit

Permalink
start of capsul engine sync with mia pref (#185)
Browse files Browse the repository at this point in the history
    - fsl
  • Loading branch information
servoz committed Feb 11, 2022
1 parent dace297 commit 25fd1de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 13 additions & 0 deletions python/populse_mia/software_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ def set_capsul_config(self, capsul_config_dict):
else:
capsul_config = capsul_config_dict.get('study_config', {})

# matlab
matlab_path = capsul_config.get('matlab_exec')
use_matlab = capsul_config.get('use_matlab', None)
if use_matlab and matlab_path:
Expand All @@ -858,6 +859,7 @@ def set_capsul_config(self, capsul_config_dict):
elif use_matlab is False:
self.set_use_matlab(False)

# spm
if capsul_config.get('use_spm', False):
spm_dir = capsul_config.get('spm_directory')
spm_standalone = capsul_config.get('spm_standalone')
Expand All @@ -881,6 +883,17 @@ def set_capsul_config(self, capsul_config_dict):
self.set_use_spm(False)
self.set_use_spm_standalone(False)

# fsl
use_fsl = capsul_config.get('use_fsl', False)
fsl_conf_path = capsul_config.get('fsl_config')

if use_fsl and fsl_conf_path:
self.set_fsl_config(matlab_path)
self.set_use_fsl(True)

elif use_fsl is False:
self.set_use_fsl(False)

def setChainCursors(self, chain_cursors):
"""Set the value of the checkbox 'chain cursor' in the miniviewer.
Expand Down
13 changes: 11 additions & 2 deletions python/populse_mia/user_interface/pop_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,9 @@ def __init__(self, main_window):

# Groupbox "CAPSUL"
groupbox_capsul = Qt.QGroupBox("CAPSUL")
capsul_config_button = Qt.QPushButton("Edit CAPSUL config", default=False, autoDefault=False)
capsul_config_button = Qt.QPushButton("Edit CAPSUL config",
default=False,
autoDefault=False)
capsul_config_button.clicked.connect(self.edit_capsul_config)
h_box_capsul = Qt.QHBoxLayout()
h_box_capsul.addWidget(capsul_config_button)
Expand Down Expand Up @@ -2644,7 +2646,9 @@ def edit_capsul_config(self):
del capsul_config['study_config']
config.set_capsul_config(capsul_config)

# update matlab/SPM GUI which might have changed
# update Mia preferences GUI which might have changed

# matlab
use_matlab = config.get_use_matlab()
use_matlab = Qt.Qt.Checked if use_matlab else Qt.Qt.Unchecked
self.use_matlab_checkbox.setCheckState(use_matlab)
Expand All @@ -2654,6 +2658,8 @@ def edit_capsul_config(self):
self.use_matlab_standalone_checkbox.setCheckState(use_matlab_sa)
self.matlab_standalone_choice.setText(
config.get_matlab_standalone_path())

# spm
use_spm = config.get_use_spm()
use_spm = Qt.Qt.Checked if use_spm else Qt.Qt.Unchecked
self.use_spm_checkbox.setCheckState(use_spm)
Expand All @@ -2664,6 +2670,9 @@ def edit_capsul_config(self):
self.spm_standalone_choice.setText(
config.get_spm_standalone_path())

# fsl


del dialog
del engine

Expand Down

0 comments on commit 25fd1de

Please sign in to comment.