When an optional parameter is not given (the input field stays empty), it is not written as null
in the config.json
file generated by Brainlife but it is written as ““
. So it is considered as a an empty string by the Python code and an error occurs.
...
Case of a NUMBER parameter
For instance, the app-maxwell-maxfilterfilter takes the parameter st_duration
as optional. This parameter is either a float
or None
. Locally, in the config.json.example
, when this parameter is not given it is written as:
...
Then the value of this parameter is passed to the MNE function MaxFilterMaxwell Filter, which reads it as a string instead of None
and an error is raised because the function expects a float or None
:
...
Case of a STRING parameter
app-maxwell-maxfilterfilter takes another optional parameter (param_regularize
), and this time it is either a string
or None
. In this case, you can also add in the Python file:
...
These lines were added to helper.py
(see Create a helper.py file).