Ignore:
Timestamp:
Jun 16, 2009, 10:54:45 AM (10 years ago)
Author:
tjniskan
Message:
  • Some minor modifications to aedes_readfid.m
  • Added BOLD strength estimation to

plugins/fmri_plugins/basic_fmri_analysis.m

  • Changed the image in about dialog
  • Added support for negative threshold in misclib/fmri_blob_overlay.m

M misclib/fmri_blob_overlay.m
M aedes_helpabout.m
M plugins/fmri_plugins/basic_fmri_analysis.m
M aedes_readfid.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misclib/fmri_blob_overlay.m

    r80 r82  
    2222%       **********              ************
    2323%
     24%       'Deactivation'         'on','off': Select if deactivation blobs are also
     25%                               displayed (default = 'off')
     26%
    2427%       'BlobCMin'              Min color limit for scaling activation
    2528%                               blobs. (default = min(ImBlob))
     
    3033%       'AnatCLim'              A two element vector [CLOW CHIGH] for
    3134%                               scaling anatomical image. (default =
    32 %                               min/max) 
     35%                               min/max)
    3336%
    3437%       'BlobCmap'              String of a valid colormap name
    3538%                               ('jet','hot',etc.) to be used with
    3639%                               activation blobs. (default = 'hot')
     40%
     41%       'BlobNegCmap'           String of a valid colormap name
     42%                               ('cool','jet',etc.) to be used with
     43%                               deactivation blobs. (default = 'cool')
    3744
    3845%       'AnatCmap'               String of a valid colormap name
     
    7279blobcmin = [];
    7380blobcmax = [];
     81blobnegcmin = [];
     82blobnegcmax = [];
    7483anatcmin = [];
    7584anatcmax = [];
     85deactivations = false;
    7686blobcmap = 'hot';
     87blobnegcmap = 'cool';
    7788anatcmap = 'gray';
    7889vnmrfix = false;
     
    95106 
    96107  switch param
     108    case 'deactivation'
     109      if strcmpi(value,'on')
     110        deactivations = true;
     111      end
    97112    case 'blobclim'
    98113      blobcmin = value(1);
     
    100115    case 'blobcmin'
    101116      blobcmin = value;
     117    case 'blobnegcmin'
     118      blobnegcmin = abs(value);
     119    case 'blobnegcmax'
     120      blobnegcmax = abs(value);
    102121    case 'blobcmax'
    103122      blobcmax = value;
     
    107126    case 'blobcmap'
    108127      blobcmap = value;
     128    case 'blobnegcmap'
     129      blobnegcmap = value;
    109130    case 'anatcmap'
    110131      anatcmap = value;
     
    152173end
    153174
    154 
     175if length(thold)==2
     176  if isnan(thold(2))
     177    thold = thold(1);
     178  else
     179    deactivations = true;
     180  end
     181end
     182
     183if deactivations
     184  tholdneg = abs(thold(2));
     185  thold = thold(1);
     186end
    155187
    156188% Check image sizes ------------------------------------
     
    170202end
    171203
     204ImBlobNeg = -ImBlob;
     205
    172206% Threshold blobs
    173207ind_lo = find(ImBlob<=thold);
     
    175209minT = min(ImBlob(:));
    176210maxT = max(ImBlob(:));
     211
     212if deactivations
     213  ind_neg_lo = find(ImBlobNeg<=tholdneg);
     214  ind_neg_hi = find(ImBlobNeg>tholdneg);
     215  minTneg = min(ImBlobNeg(:));
     216  maxTneg = max(ImBlobNeg(:));
     217end
    177218%ImBlob(ImBlob<=thold) = 0;
    178219%ind = find(ImBlob~=0);
     
    184225  ind_hi = find(ImBloIndHi);
    185226end
     227if deactivations
     228  ImBloNegIndHi = ImBlobNeg>tholdneg;
     229  ImBloNegIndHi = bwareaopen(ImBloNegIndHi,voxelsizemin,8);
     230  ind_neg_hi = find(ImBloNegIndHi);
     231end
    186232
    187233% Handle clims for blobs and anatomical image -----------
     
    196242ImBlob=(ImBlob-min(ImBlob(:)));
    197243
     244if deactivations
     245  if ~isempty(blobnegcmin)
     246    ImBlobNeg(ImBlobNeg<blobnegcmin) = blobnegcmin;
     247    minTneg = blobnegcmin;
     248  end
     249  if ~isempty(blobnegcmax)
     250    ImBlobNeg(ImBlobNeg>blobnegcmax) = blobnegcmax;
     251    maxTneg = blobnegcmax;
     252  end
     253  ImBlobNeg=(ImBlobNeg-min(ImBlobNeg(:)));
     254end
     255
    198256if ~isempty(anatcmin)
    199257  ImAnat(ImAnat<anatcmin) = anatcmin;
     
    204262
    205263% Construct indexed image -------------------------------
    206 ImBlob = round(ImBlob./(maxT-minT)*255)+1;
    207 ImAnat = round(ImAnat./max(ImAnat(:))*255)+1;
     264ImBlob = round(ImBlob./(maxT-minT)*255);
     265if deactivations
     266  ImBlobNeg = round(ImBlobNeg./(maxTneg-minTneg)*255);
     267  ImBlobNeg = abs(ImBlobNeg-256);
     268end
     269ImAnat = round(ImAnat./max(ImAnat(:))*255);
    208270ImRes = ImAnat;
    209 ImRes(ind_hi) = ImBlob(ind_hi)+256;
    210 %ImRes = ImRes+ImBlob;
     271if deactivations
     272  ImRes(ind_neg_hi) = ImBlobNeg(ind_neg_hi)+256;
     273  ImRes(ind_hi) = ImBlob(ind_hi)+2*256;
     274else
     275  ImRes(ind_hi) = ImBlob(ind_hi)+256;
     276end
    211277
    212278% Construct joint colormap
    213 ImBlobColormap=eval([blobcmap,'(256)']);
     279if deactivations
     280  tmp = eval([blobcmap,'(256)']);
     281  %tmp2 = jet(512);
     282  %tmp2=tmp2(1:256,:);
     283  tmp2 = eval([blobnegcmap,'(256)']);
     284  ImBlobColormap = [tmp2;tmp];
     285else
     286  ImBlobColormap=eval([blobcmap,'(256)']);
     287end
    214288ImAnatColormap=eval([anatcmap,'(256)']);
    215289StackedColormap = [ImAnatColormap;ImBlobColormap];
     
    219293  cmap = StackedColormap;
    220294  im_rgb = ind2rgb(im,cmap);
    221   minmaxT = [minT maxT];
    222 end
    223 
    224 
     295  if deactivations
     296     minmaxT = [minT maxT -maxTneg -minTneg];
     297  else
     298    minmaxT = [minT maxT];
     299  end
     300end
     301
     302
Note: See TracChangeset for help on using the changeset viewer.

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