Currently, if one wishes to run scripts related to specific studies done with Zeffiro, one has to jump through unnecessary hoops to even start a computation. This is because
the scripts/ and m/ folders are not automatically in the Matlab path and
the Zeffiro startup script m/zef_start_config.m errors out, if all submodules (which are most probably not even related to the study) are not installed.
Ideally, one should simply be able to start up a computation by typing a path to the needed function.
Steps to reproduce
Navigate to the Zeffiro Interface installation folder and
attempt to start a study-related computation from the Matlab command line, by calling a main function related to a specific study, such as [stats, L] = inverse_sensitivity_fn(args...), without manually doing any modifications to the Matlab PATH or Zeffiro source code.
Expected behavior
The computation should start and finish without errors, as long as a user has provided arguments that conform to the pre-conditions of the given main function.
Error messages
Instead of screenshots, here is a description of events that occur, when trying to run a study-related function:
>> cd zeffiro_interface/
>> [stats, L] = inverse_sensitivity_fn("data/article_1_brain_10kL_d0.5mm.mat", "Dipole Scan", 1, -30, "L2", acceptable_source_depth=0.5, optimization_system_type="pbo", lead_field_filter_quantile=1, use_gpu=true, build_lead_field=false, build_mesh=false);
Unrecognized function or variable 'inverse_sensitivity_fn'.
>> addpath(genpath("."))
>> [stats, L] = inverse_sensitivity_fn("data/article_1_brain_10kL_d0.5mm.mat", "Dipole Scan", 1, -30, "L2", acceptable_source_depth=0.5, optimization_system_type="pbo", lead_field_filter_quantile=1, use_gpu=true, build_lead_field=false, build_mesh=false);
Error using evalc
Unrecognized function or variable 'ft_defaults'.
Error in zef_start_config (line 7)
if isequal(zef.zeffiro_restart, 0), evalc('ft_defaults'); end
Error in zeffiro_interface (line 285)
zef_start_config;
Error in inverse_sensitivity_fn (line 159)
project_struct = zeffiro_interface( ...
Context
Name
Value
Version
bf185da Add files via upload
OS
Any and all
Shell
Any and all
This could be fixed at least partially by making a +studies/+study_name/ folder for each study. Because this would make the folders packages from Matlab's point of view, one could start a study-related computation simply by typing
results = studies.study_name.main(args...) ;
into the Matlab command prompt. The m/ folder would also need to be added to the path somehow, but a function studies.init_paths or similar could be provided for any study-related main functions, which would do the necessary path additions.
This is if we do not wish to turn all Zeffiro folders into Matlab packages, which would be the ideal solution. It would simply take quite a bit of typing.
Description
Currently, if one wishes to run scripts related to specific studies done with Zeffiro, one has to jump through unnecessary hoops to even start a computation. This is because
scripts/
andm/
folders are not automatically in the Matlab path andm/zef_start_config.m
errors out, if all submodules (which are most probably not even related to the study) are not installed.Ideally, one should simply be able to start up a computation by typing a path to the needed function.
Steps to reproduce
[stats, L] = inverse_sensitivity_fn(args...)
, without manually doing any modifications to the Matlab PATH or Zeffiro source code.Expected behavior
The computation should start and finish without errors, as long as a user has provided arguments that conform to the pre-conditions of the given main function.
Error messages
Instead of screenshots, here is a description of events that occur, when trying to run a study-related function:
Context
This could be fixed at least partially by making a
+studies/+study_name/
folder for each study. Because this would make the folders packages from Matlab's point of view, one could start a study-related computation simply by typinginto the Matlab command prompt. The
m/
folder would also need to be added to the path somehow, but a functionstudies.init_paths
or similar could be provided for any study-related main functions, which would do the necessary path additions.This is if we do not wish to turn all Zeffiro folders into Matlab packages, which would be the ideal solution. It would simply take quite a bit of typing.