我有一個雙重的2D圖像,我想用我的用戶界面,我用指南。我有一個我想繪製它的軸柄。我試過這個沒有成功,我的形象全是藍色。如何繪製一個雙類型2D圖像到一個軸柄在matlabUI
function ComputeMap_Callback(hObject, eventdata, handles)
% hObject handle to ComputeMap (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global healthyImage;
global sickImage;
global tumorMapImage;
global costFunction;
if(get(handles.radiobuttonMSE,'Value') == get(hObject,'Max'))
costFunction = 0;
else
costFunction = 1;
end
disp(costFunction);
tumorMapImage = mexFunction(im2double(sickImage),im2double(healthyImage),get(handles.blockSize,'Value'),get(handles.windowSize,'value'), costFunction);
image(tumorMapImage,'parent',handles.sImageGUI);
這個mexFunction返回一個雙重二維圖像。如果我只是在沒有matlab和imShow(resultImage)的情況下調用這個函數;我得到了正確的結果。所以我認爲它與雙色的顏色映射有關,並且圖像不是3D而是2D。但我在matlab中熟悉gui以確定要做什麼。我做了一些更多的研究,我認爲我的問題可能與AlphaData屬性有關,但我不知道該怎麼做。
你能提供任何你正在使用的附加代碼或你得到的任何錯誤嗎?當你調用這個函數時會發生什麼?該行應該可以工作。 – aganders3
添加了東西,我沒有任何錯誤。 – DogDog