aodn/imos-toolbox

MCR reference in imread mainWindow.m causes error in non-mcr setups

Opened this issue · 1 comments

Lines 290, 300, 310 in GUI/mainWindow all reference 'mcr' and cause the zoom, pan tools not to appear if mcr is not in use.

[img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_zoom_in.png'));
[img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_zoom_out.png'));
[img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_hand.png'));

I am removing the 'mcr' to enable the function to work, but maybe there is a nice way to get around this in the code.

Yes, but removing it breaks the stand-alone app. The correct fix is to check if the toolbox is running in deployed mode (standalone version) or within matlab. It is a very quick fix , one just needs to wrap a path to the pngs around the isdeployed function.