Changeset 121 for aedes.m


Ignore:
Timestamp:
Apr 28, 2010, 3:57:51 PM (9 years ago)
Author:
tjniskan
Message:
  • Fixed contrast auto-balance to work with datas that are in [0 1] range
  • aedes_readfdf now reads also SWIFT reconstruction FDF:s

M aedes_readfdf.m
M aedes.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r120 r121  
    72607260
    72617261% Set Contrast
    7262 cont = round(diff(Dat.OrigClim(Dat.DataInd,:))/2);
    7263 Clim(1) = round(Dat.OrigClim(Dat.DataInd,1)+((100-Dat.Contrast)/100)*cont);
    7264 Clim(2) = round(Dat.OrigClim(Dat.DataInd,2)-((100-Dat.Contrast)/100)*cont);
     7262% cont = round(diff(Dat.OrigClim(Dat.DataInd,:))/2);
     7263% Clim(1) = round(Dat.OrigClim(Dat.DataInd,1)+((100-Dat.Contrast)/100)*cont);
     7264% Clim(2) = round(Dat.OrigClim(Dat.DataInd,2)-((100-Dat.Contrast)/100)*cont);
     7265cont = diff(Dat.OrigClim(Dat.DataInd,:))/2;
     7266Clim(1) = Dat.OrigClim(Dat.DataInd,1)+((100-Dat.Contrast)/100)*cont;
     7267Clim(2) = Dat.OrigClim(Dat.DataInd,2)-((100-Dat.Contrast)/100)*cont;
     7268
    72657269
    72667270% Set Brightness
    7267 Clim = Clim+round((diff(Dat.OrigClim(Dat.DataInd,:))/2)*(Dat.Brightness/100));
     7271% Clim = Clim+round((diff(Dat.OrigClim(Dat.DataInd,:))/2)*(Dat.Brightness/100));
     7272Clim = Clim+(diff(Dat.OrigClim(Dat.DataInd,:))/2)*(Dat.Brightness/100);
    72687273Dat.Clim = Clim;
    72697274
     
    73137318  % Saturate 1% of the low and high values
    73147319  normClim = stretchlim(single(DATA{Dat.DataInd}.FTDATA(:,:,:,Dat.CurrentVol))./ ...
    7315                         single(max_val),[0.005 0.995]);
    7316  
    7317   Clim(1) = floor(max_val*normClim(1));
    7318   Clim(2) = ceil(max_val*normClim(2));
     7320    single(max_val),[0.005 0.995]);
     7321 
    73197322else
    73207323  % Find the minimum values of all slices in the current volume
     
    73337336    [0.005 0.995]);
    73347337  normClim = max(normClim,[],2);
    7335  
    7336   Clim(1) = floor(max_val*normClim(1));
    7337   Clim(2) = ceil(max_val*normClim(2));
    7338 end
    7339 
     7338end
     7339
     7340%if max_val<10
     7341  Clim(1) = max_val*normClim(1);
     7342  Clim(2) = max_val*normClim(2);
     7343%else
     7344%  Clim(1) = floor(max_val*normClim(1));
     7345%  Clim(2) = ceil(max_val*normClim(2));
     7346%end
    73407347
    73417348% Update contrast
Note: See TracChangeset for help on using the changeset viewer.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008