netstim / leaddbs

Lead-DBS is a MATLAB toolbox facilitating deep brain stimulation electrode localization and connectomic neuroimaging.
https://www.lead-dbs.org
Other
94 stars 98 forks source link

Redownload datafiles fails as destination is empty #1047

Closed adhusch closed 1 year ago

adhusch commented 1 year ago

Hi!

I am trying to do Install / Redownload data-files

however i get

Error using fileparts Input must be a row vector of characters, or a string scalar, or a cellstr, or a string matrix.

Error in ea_checkinstall>ea_downloadasset (line 339) if ~exist(fileparts(destination), 'dir')

Error in ea_checkinstall (line 71) success=ea_downloadasset('LeadDBS Data Files',...

Error in ea_menuinstall (line 9) success=ea_checkinstall(cmd);

Error using matlab.ui.internal.controller.WebMenuController/fireActionEvent Error while evaluating Menu Callback.

When looking this up in ea_checkinstall.m in the function ea_downloadasset the destination variable is empty. Going up one step in the call stack to ea_checkinstall line 71 we find this call:

success=ea_downloadasset('LeadDBS Data Files',... [],... '');

where destination is the 2nd paramenter, i.e. hard-coded empty!

How could the datafile download ever work for anybody then? :) I am confused.

Best Andy

adhusch commented 1 year ago

Not sure of this is the cause or another addtional problem, i've just noticed that

in ea_downloadasset.m we do if strcmp(assetname,'Lead Datafiles')

however the asset name in the variable defined in the calling ea_checkinstall funciton is 'LeadDBS Data Files'. Or is this a compatiblity bridge for an older version?

ningfei commented 1 year ago

will check. Off-topic: fileparts now supports cell input since a couple of versions ago. But if you input a cell with only 1 element, it returns you a string instead of a cell. To me, it's a bug. Maybe we should use a wrapper to fix this.