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 件)

Rik
Rik 2018 年 1 月 2 日
編集済み: Rik 2018 年 1 月 2 日

2 投票

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 件のコメント

pra sa
pra sa 2018 年 1 月 2 日
Thanks..but still it shows the same error
Rik
Rik 2018 年 1 月 2 日
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 ExchangeNeuroimaging についてさらに検索

質問済み:

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