JaneliaSciComp/JRCLUST

Probe config file will fail if no semicolon at end

Opened this issue · 1 comments

sppmg commented

Output of ver

all

Output of gpuDevice

all

The command you used

(e.g., jrc detect-sort myparam.prm)
jrc bootstrap

If manually sorting, what it is you tried to do

Console output


Hi

I'm try JRCLUST-4.0.0-beta, but discover a little problem.

When probe config file(*.prb) not end by semicolon, it will get error.

Error using loadProbe (line 11)
missing `channels` field

Error in jrclust.Config/loadParams (line 78)
        probe = loadProbe(pf);

Error in jrclust.Config (line 86)
            obj.loadParams(userParams);

Error in JRC/bootstrap (line 128)
    hCfg_ = jrclust.Config(cfgData);

Error in JRC/processArgs (line 128)
            obj.bootstrap(obj.args{:});

Error in JRC (line 54)
                    obj.processArgs();

Error in jrc (line 16)
    hJRC = JRC(varargin{:});

It cause by JRCLUST-4.0.0-beta/+jrclust/+utils/mToStruct.m Line 12

eval(cell2mat(lines'));

e.g. If below in prb

geometry(1:end,1) = 0 
geometry(1:end,2) = 100*[0:31] 

cell2mat(lines') will output below string, so error.

geometry(1:end,1) = 0 geometry(1:end,2) = 100*[0:31] 

Suggest instead of eval(strjoin(lines,';')) to insert semicolon.
(Note: strjoin introduced in R2016b)

Thanks.

Nice catch, but your solution won't quite work, since, e.g., a semicolon would break an if statement. For the time being just add the semicolons and I'll push a fix in the near future.