Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Although an App runs smoothly locally, when you try to run it on BL errors can occur. Here are the errors I came across and the way I solved them.

Null value of an optional parameter

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 string by the Python code and an error occurs.

...

Case of a NUMBER parameter

For instance, the app-maxfilter 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:

...

Case of a STRING parameter

app-maxfilter 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:

...

If you choose to enter your parameter as an ENUM parameter, no need to modify your Python file the way it is presented for a STRING parameter and a NUMBER parameter.

Error when an optional file is not available in a dataset

In a BL datatype, some files are mandatory whereas other are optional. For instance, for the neuro/meg/fif datatype, the meg file in FIF format is required whereas channels.tsv, headshape.pos, coordsystem.json, calibration_meg.dat, crosstalk_meg.fif, and destination.fif are optional.

When I registered my App on BL, for instance app-maxfilter, I defined the input as follows:

...

Then I execute my job on BL. Xhen the dataset I choose to run my App on has the calibration, destination, and crosstalk files it works. But if one ot these optionnal files is missing, I get the error:

Code Block
OSError: trans file "../605db81c7503897f9beb333f/6011c463c08103cd2aba03ea/destination.fif" not found

This file is supposed to be optional, so why an error is raised when it is not provided?