getting an error while using rest slice viewer ??

Error using sprintf Function is not defined for 'matlab.ui.Figure' inputs.
Error in rest_sliceviewer>InitControls (line 940) set(theFig, 'DeleteFcn', sprintf('rest_sliceviewer(''Delete'', %g);', theFig) );
Error in rest_sliceviewer (line 74) REST_SliceViewer_Cfg.Config(1+GetDisplayCount(REST_SliceViewer_Cfg)) =InitControls(AFilename, ACallback);
Error in rest_sliceviewer (line 38) rest_sliceviewer('ShowImage',''); %by Default, I show a black brain image
Error in rest (line 153) rest_sliceviewer,
Error using drawnow Error while evaluating UIControl Callback

回答(1 个)

Apparently rest slice viewer was made for HG1 releases (which have numerical handles), and so is not compatible with HG2 releases (R2014b and newer).
This specific instance can be fixed by explicitly loading the number (which might have been turned off)
set(theFig, 'DeleteFcn', sprintf('rest_sliceviewer(''Delete'', %g);', get(theFig,'Number')) );
Edit: this change will keep the code compatible with prior releases, although there may be many other things you will have to change.

2 个评论

Thanks..but still it shows the same error
Really? Does it still say "Error using sprintf Function is not defined for 'matlab.ui.Figure' inputs." for this same line? I don't understand that, because it doesn't use the figure object as an argument for sprintf anymore. Have you close all instances of this function before retrying?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Neuroimaging 的更多信息

提问:

2018-1-2

评论:

Rik
2018-1-2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by