Skip to content

Commit

Permalink
Jan 26, 2015
Browse files Browse the repository at this point in the history
Fixed display results cbfreeze error with Matlab 2014b.
  • Loading branch information
MetricOptimizedGating committed Jan 26, 2015
1 parent 9f306a2 commit a18ac72
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 18 deletions.
28 changes: 22 additions & 6 deletions Displaying Results/display_refined_results.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ function display_results_OpeningFcn(hObject, dummy, handles, varargin)
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = display_results_OutputFcn(hObject, eventdata, handles) %#ok<*STOUT>
matlab_version = version('-release');
Images=handles.Images;
if strcmp(handles.DataType{1},'CINE')
h=imshow(Images(:,:,1),[min(min(min((Images(handles.yDimensions,handles.xDimensions,:))))),max(max(max((Images(handles.yDimensions,handles.xDimensions,:)))))],'Parent',handles.axes1);
else
h=imshow(Images(:,:,1),[],'Parent',handles.axes1);
end
colormap gray
ax=gca;
if ( strcmp(matlab_version,'2014b')==0)
colormap gray;
freezeColors %freeze this plot's colormap
else
colormap (ax,'gray');
end
axis 'image'
set(h,'hittest','off')
hFig = ancestor(hObject,'figure');
Expand All @@ -61,17 +67,20 @@ function display_results_OpeningFcn(hObject, dummy, handles, varargin)
title(handles.Protocol,'FontSize',14)
axis 'square'
axes(handles.axes2)
ax2=gca;
% won't change any frozen plots
colormap jet

if ( strcmp(matlab_version,'2014b')==0)
colormap jet;
else
colormap (ax2,'jet');
end
if strcmp(handles.patientType,'Fetal')
% xlim([110 180]);
% ylim([110 180]);
image(110:180,110:180,flipud(handles.FigureData),'CDataMapping','scaled');
set(gca,'YDir','normal')
axis 'square'
elseif strcmp(handles.patientType,'Adult')

xlim([40 110]);
ylim([40 110]);
image(40:110,40:110,flipud(handles.FigureData),'CDataMapping','scaled');
Expand All @@ -82,10 +91,13 @@ function display_results_OpeningFcn(hObject, dummy, handles, varargin)
ylabel('Heart Rate 2','FontSize',12)
box('on');
hold('all');
if ( strcmp(matlab_version,'2014b')==0)
colorbar;
cbfreeze
freezeColors;

else
h_cbar=colorbar;
end
% mark actual minimum
hold on;
plot(handles.axes2,handles.OptimalRates(1,1), handles.OptimalRates(1,2), 'w+');
Expand All @@ -96,16 +108,20 @@ function display_results_OpeningFcn(hObject, dummy, handles, varargin)
hold on
plot(handles.axes3,handles.t,handles.N_HR,'r')
hold off
axis([0 max(handles.t) 110 180])
axis([0 max(handles.t) 60 180])
xlabel('Time (s)')
ylabel('HR (bpm)')
legend('Two-Parameter Heart Rate Model','Multi-Parameter Heart Rate Model','location','NW')

while handles.stop_now~=1
for loop=2:size(Images,3)
set(h,'CData',Images(:,:,loop))
if ( strcmp(matlab_version,'2014b')==0)
colormap gray
freezeColors %freeze this plot's colormap
else
colormap (hFig,'gray');
end
pause(0.05)
handles=guidata(hObject);
if strcmp(handles.DataType{1},'CINE')
Expand Down
Binary file modified Displaying Results/display_results.fig
Binary file not shown.
26 changes: 22 additions & 4 deletions Displaying Results/display_results.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,47 @@ function display_results_OpeningFcn(hObject, dummy, handles, varargin)
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = display_results_OutputFcn(hObject, eventdata, handles) %#ok<*STOUT>
% check which version of matlab is running
matlab_version = version('-release');
Images=handles.Images;
if strcmp(handles.DataType{1},'CINE')
h=imshow(Images(:,:,1),[min(min(min((Images(handles.yDimensions,handles.xDimensions,:))))),max(max(max((Images(handles.yDimensions,handles.xDimensions,:)))))],'Parent',handles.axes1);
else
h=imshow(Images(:,:,1),[],'Parent',handles.axes1);
end
colormap gray
ax=gca;
if ( strcmp(matlab_version,'2014b')==0)
colormap gray;
freezeColors %freeze this plot's colormap
else
colormap (ax,'gray');
end
axis 'image'
set(h,'hittest','off')
hFig = ancestor(hObject,'figure');
set(hFig,'name','Displaying Results');
guidata(hObject, handles);
title(handles.Protocol,'FontSize',14)
axis 'square'
colormap jet % won't change any frozen plots
entropy_landscape_GUI(handles.FigureData,handles.OptimalRates,handles.patientType)
ax2=gca;
if ( strcmp(matlab_version,'2014b')==0)
colormap jet;
else
colormap (ax2,'jet'); % won't change any frozen plots
end
entropy_landscape_GUI(handles.FigureData,handles.OptimalRates,handles.patientType, matlab_version)
if ( strcmp(matlab_version,'2014b')==0)
freezeColors
end
while handles.stop_now~=1
for loop=2:size(Images,3)
set(h,'CData',Images(:,:,loop))
colormap gray
if ( strcmp(matlab_version,'2014b')==0)
colormap gray;
freezeColors %freeze this plot's colormap
else
colormap (hFig,'gray');
end
pause(0.05)
handles=guidata(hObject);
if strcmp(handles.DataType{1},'CINE')
Expand Down
Binary file modified Displaying Results/display_results_flow.fig
Binary file not shown.
20 changes: 18 additions & 2 deletions Displaying Results/display_results_flow.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,46 @@ function display_results_flow_OpeningFcn(hObject, dummy, handles, varargin)
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = display_results_flow_OutputFcn(hObject, eventdata, handles) %#ok<*STOUT>
matlab_version = version('-release');
Images=handles.Images;
if strcmp(handles.DataType{1},'CINE')
h=imshow(Images(:,:,1),[min(min(min((Images(handles.yDimensions,handles.xDimensions,:))))),max(max(max((Images(handles.yDimensions,handles.xDimensions,:)))))],'Parent',handles.axes1);
else
h=imshow(Images(:,:,1),[],'Parent',handles.axes1);
end
ax=gca;
if ( strcmp(matlab_version,'2014b')==0)
colormap gray
freezeColors %freeze this plot's colormap
else
colormap (ax,'gray');
end
axis 'image'
set(h,'hittest','off')
hFig = ancestor(hObject,'figure');
set(hFig,'name','Displaying Results');
guidata(hObject, handles);
title(handles.Protocol,'FontSize',14)
axis 'square'
ax2=gca;
if ( strcmp(matlab_version,'2014b')==0)
colormap jet % won't change any frozen plots
entropy_landscape_GUI(handles.FigureData,handles.OptimalRates,handles.patientType)
else
colormap (ax2,'jet');
end
entropy_landscape_GUI(handles.FigureData,handles.OptimalRates,handles.patientType,matlab_version)
if ( strcmp(matlab_version,'2014b')==0)
freezeColors
end
while handles.stop_now~=1
for loop=2:size(Images,3)
set(h,'CData',Images(:,:,loop))
if ( strcmp(matlab_version,'2014b')==0)
colormap gray
freezeColors %freeze this plot's colormap
else
colormap (hFig,'gray');
end
pause(0.05)
handles=guidata(hObject);
if strcmp(handles.DataType{1},'CINE')
Expand Down Expand Up @@ -112,4 +129,3 @@ function refineButton_Callback(hObject, eventdata, handles)
handles.stop_now = 1;
handles.yesno='refine';
guidata(hObject, handles);

4 changes: 3 additions & 1 deletion Displaying Results/entropy_landscape_GUI.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function entropy_landscape_GUI(ZI,optimalrates,patientType)
function entropy_landscape_GUI(ZI,optimalrates,patientType,matlab_version)

if strcmp(patientType,'Fetal')
% xlim([110 180]);
Expand All @@ -21,7 +21,9 @@ function entropy_landscape_GUI(ZI,optimalrates,patientType)
box('on');
hold('all');
colorbar;
if ( strcmp(matlab_version,'2014b')==0)
cbfreeze
end

% mark actual minimum
hold on;
Expand Down
4 changes: 2 additions & 2 deletions Version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2.3
NOvember 28, 2014
2.4
January 26, 2015
6 changes: 3 additions & 3 deletions VersionCheck.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Last version check: 28/11/2014;
Current Version: 2.3;
Release Date: November 28, 2014;
Last version check: 8/1/2015;
Current Version: 2.4;
Release Date: January 26, 2015;

0 comments on commit a18ac72

Please sign in to comment.