Legend:
 Unmodified
 Added
 Removed

aedes.m
r132 r133 320 320 'CloseRequestFcn',@l_quit,... 321 321 'Handlevisibility','off'); 322 if Dat.MatlabVersion>=7.05 323 set(H.FIG,'WindowScrollWheelFcn',@l_MouseWheelFcn) 324 end 325 322 326 323 327 % File Uimenu  … … 1024 1028 1025 1029 % If JavaFigures are enabled, set image sliders to work while moving 1026 if Dat.MatlabVersion>7. 31030 if Dat.MatlabVersion>7.03 1027 1031 SliderListener1 = handle.listener(H.IMSLIDER(1),... 1028 1032 'ActionEvent',... … … 1111 1115 1112 1116 % If JavaFigures are enabled, set slider to work while moving 1113 if Dat.MatlabVersion>7. 31117 if Dat.MatlabVersion>7.03 1114 1118 SliderListener = handle.listener(H.SL_SLIDER,... 1115 1119 'ActionEvent',... … … 1336 1340 'string','Gamma (0.01  4.99)'); 1337 1341 1338 if Dat.MatlabVersion>7. 31342 if Dat.MatlabVersion>7.03 1339 1343 ContrastSliderListener = handle.listener(H.CONTRAST_SLIDER,... 1340 1344 'ActionEvent',@l_SetContrastBrightnessGamma); … … 4378 4382 4379 4383 % Suppress warning from get(fh,'javaFrame') generated in Matlab R2008a> 4380 if Dat.MatlabVersion>=7. 64384 if Dat.MatlabVersion>=7.06 4381 4385 warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame'); 4382 4386 end … … 5936 5940 5937 5941 % Suppress warning from get(fh,'javaFrame') generated in Matlab R2008a> 5938 if Dat.MatlabVersion>=7. 65942 if Dat.MatlabVersion>=7.06 5939 5943 warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame'); 5940 5944 end … … 7135 7139 % Calculate contrast value and to two decimals 7136 7140 Dat.Contrast=(diff(clim_in)/diff(Dat.OrigClim(Dat.DataInd,:)))*100; 7137 Dat.Contrast = fix(Dat.Contrast*100)/100;7141 %Dat.Contrast = fix(Dat.Contrast*100)/100; 7138 7142 7139 7143 % Calculate Brightness 7140 7144 Dat.Brightness = ((diff(clim_in)/2(diff(Dat.OrigClim(Dat.DataInd,:))/2))./(diff(Dat.OrigClim(Dat.DataInd,:))/2))*100; 7141 Dat.Brightness = fix(Dat.Brightness*100)/100;7145 %Dat.Brightness = fix(Dat.Brightness*100)/100; 7142 7146 7143 7147 % Make sure that contrast/brightness values are valid … … 7316 7320 Clim = zeros(1,2); 7317 7321 7318 if Dat.isDataMixed 7319 max_val = max(max(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol))); 7320 7322 tmp_data = DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol); 7323 max_val = max(tmp_data(:)); 7324 7325 if any(strcmpi(class(DATA{Dat.DataInd}.FTDATA),{'single','double'})) 7321 7326 % Saturate 1% of the low and high values 7322 normClim = stretchlim(single(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol))./ ... 7323 single(max_val),[0.005 0.995]); 7324 7327 normClim = stretchlim(tmp_data./max_val,... 7328 [0.005 0.995]); 7329 normClim = max(normClim,[],2); 7330 if max_val<1 7331 Clim(1) = max_val*normClim(1); 7332 Clim(2) = max_val*normClim(2); 7333 else 7334 Clim(1) = fix(max_val*normClim(1)*100)/100; 7335 Clim(2) = fix(max_val*normClim(2)*100)/100; 7336 end 7325 7337 else 7326 % Find the minimum values of all slices in the current volume 7327 %min_val = squeeze(min(min(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol)))) 7328 7329 % Find the maximum values of all slices in the current volume 7330 %max_val = squeeze(max(max(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol)))); 7331 7332 tmp = DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol); 7333 max_val = max(tmp(:)); 7334 7335 7336 %Clim(1) = median(min_val); 7337 %Clim(2) = median(max_val); 7338 if any(strcmpi(class(DATA{Dat.DataInd}.FTDATA),{'single','double'})) 7339 normClim = stretchlim(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol)./max_val,... 7340 [0.005 0.995]); 7341 normClim = max(normClim,[],2); 7342 if max_val<1 7343 Clim(1) = max_val*normClim(1); 7344 Clim(2) = max_val*normClim(2); 7345 else 7346 Clim(1) = fix(max_val*normClim(1)*100)/100; 7347 Clim(2) = fix(max_val*normClim(2)*100)/100; 7348 end 7349 else 7350 normClim = stretchlim(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol),... 7351 [0.005 0.995]); 7352 normClim = max(normClim,[],2); 7353 Clim(1) = floor(max_val*normClim(1)); 7354 Clim(2) = ceil(max_val*normClim(2)); 7355 end 7356 7357 end 7358 7338 % Saturate 1% of the low and high values 7339 normClim = stretchlim(tmp_data,... 7340 [0.005 0.995]); 7341 normClim = max(normClim,[],2); 7342 Clim(1) = floor(max_val*normClim(1)); 7343 Clim(2) = ceil(max_val*normClim(2)); 7344 end 7359 7345 7360 7346 % Update contrast … … 9845 9831 end % function l_SetMouseGestures(h, 9846 9832 9833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9834 % 9835 % Mouse wheel callback 9836 % 9837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9838 function l_MouseWheelFcn(h,evd) 9839 9840 %cp=get(H.FIG,'CurrentPoint') 9841 9842 if Dat.ZoomLevel==0 9843 l_Zoom([],[],'normalize') 9844 end 9845 9846 if evd.VerticalScrollCount<0 9847 l_Zoom([],[],'+') 9848 else 9849 l_Zoom([],[],'') 9850 end 9851 9852 end 9853 9847 9854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9848 9855 %%
Note: See TracChangeset
for help on using the changeset viewer.