Problem with view_surface_data

I'm having problems with view_surface_data().

When called as view_surface_data([], path_to_results_file), where the path was obtained by right-clicking on the result of a source computation and choosing 'copy path to clipboard, I get an error (see below).

I seems due to the fact that
bst_memory('GetDataSetResult', path_to_results_file) returns nothing (it should return 2 indices). Yet if I call
bst_get('ResultsFile', path_to_results_file), it returns a struct.

What am I missing?
Alain


Intermediate dot '.' indexing produced a comma-separated list with 0 values, but it must produce a single value when followed by subsequent indexing operations.

Error in panel_surface>SetSurfaceData (line 1492)
            if ~isempty(GlobalData.DataSet(iDS).Results(iRes).ColormapType)

Error in panel_surface (line 40)
eval(macro_method);

Error in view_surface_data (line 298)
isOk = panel_surface('SetSurfaceData', hFig, iTess, OverlayType, OverlayFile, isStat);

Error in Fig_V4e (line 16)
view_surface_data(surface_file, overlay_file);

The issue here is that the relative path of the file is expected, rather than the absolute path (the one that is given with "Copy path to clipboard").

Use file_short() to get the relative path (wrt the Protocol/data folder):

Just call view_surface_data([], file_short(path_to_results_file))

Thanks! I should have guessed. That inspires a feature suggestion: tweak the code to allow both? :slight_smile:

Absolutely, we'll check which other functions need that update