Changeset 121


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

Files:
3 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
  • aedes_readfdf.m

    r80 r121  
    114114  count=count+1;
    115115 
    116   % Check first char on the line
    117   isnull=double(fread(file_fid,1,'char'))==0;
    118   if isnull
     116  % Check first and second char on the line.
     117  % In SWIFT reconstruction fdf:s there can be an additional
     118  % form feed character (12) before NULL...
     119  tmp=double(fread(file_fid,2,'char'));
     120  if any(tmp==0)
    119121    done=true;
    120122    continue;
    121123  else
    122124    % Move file indicator back
    123     fseek(file_fid,-1,0);
     125    fseek(file_fid,-2,0);
    124126  end
    125127 
  • aedes_revision.m

    r120 r121  
    9393% bash-script every time it is called so that this file "aedes_revision.m" is
    9494% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
    95 % - Svn Hook -
     95% - SVN Hook -
Note: See TracChangeset for help on using the changeset viewer.

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