Changeset 98 for misclib


Ignore:
Timestamp:
Oct 29, 2009, 3:57:22 PM (10 years ago)
Author:
tjniskan
Message:
  • 3D ROIs can now be loaded on 4D datasets if the first three

dimensions match.

  • Corrected a small bug in the time series viewing in Aedes.
  • Added Fourier domain smoothing to misclib/fmri_smooth.m
  • Removed an unnecessary matrix replication from

plugins/fmri_plugins/basic_fmri_analysis.m

M misclib/fmri_smooth.m
M aedes.m
M plugins/fmri_plugins/basic_fmri_analysis.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misclib/fmri_smooth.m

    r80 r98  
    2020  data = data.FTDATA;
    2121end
     22
     23UseImFilter = true;
    2224
    2325smooth_data = zeros(size(data));
     
    5961% Smooth the image data -----------------------
    6062nVols = size(data,4);
     63if ~UseImFilter
     64  ind_hi=ceil(size(data(:,:,:,1))/2)+ceil(size(s_kernel)/2);
     65  ind_lo=ind_hi-(size(s_kernel)-1);
     66  ind_lo(ind_lo<1)=1;
     67  tmp_kernel = zeros(size(data(:,:,:,1)));
     68  tmp_kernel(ind_lo(1):ind_hi(1),ind_lo(2):ind_hi(2),...
     69    ind_lo(3):ind_hi(3))=s_kernel;
     70end
    6171for ii=1:nVols
    6272  if ii==1
     
    6878    fprintf(1,'%d/%d',ii,nVols);
    6979  end
    70   tmp_data = data(:,:,:,ii);
    71   smooth_data(:,:,:,ii) = imfilter(tmp_data,s_kernel);
     80  if UseImFilter
     81    tmp_data = data(:,:,:,ii);
     82    smooth_data(:,:,:,ii) = imfilter(tmp_data,s_kernel);
     83  else
     84    tmp_data = double(data(:,:,:,ii));
     85    smooth_data(:,:,:,ii) = fftshift(ifftn(fftn(tmp_data).*fftn(tmp_kernel)));
     86  end
    7287end
    7388fprintf(1,'\n');
Note: See TracChangeset for help on using the changeset viewer.

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