Changeset 164 for misclib/fmri_smooth.m


Ignore:
Timestamp:
May 23, 2011, 9:18:21 AM (8 years ago)
Author:
tjniskan
Message:
  • Added option for using external regressors in misclib/fmri_analysis.m

M misclib/fmri_smooth.m
M misclib/fmri_analysis.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misclib/fmri_smooth.m

    r119 r164  
    3434% Calculate standard deviations using FWHM
    3535if fwhmInPixels
    36    stds = fwhm_sz/sqrt(8*log(2));
     36        stds = fwhm_sz/sqrt(8*log(2));
    3737else
    3838  stds = (fwhm_sz/sqrt(8*log(2)))./voxsize;
     
    4444  kernel_sz(3)=floor((size(data,3)-1)/2);
    4545end
    46 kernel_sz
    4746
    4847% Construct the smoothing kernel
     
    6867  tmp_sz = size(data(:,:,:,1));
    6968  %tmp_sz(3)=tmp_sz(3)+fwhm_sz(3);
    70   ind_hi=ceil(tmp_sz/2)+floor(size(s_kernel)/2);
    71   ind_lo=ind_hi-(size(s_kernel)-1);
    72   ind_lo(ind_lo<1)=1;
    73   tmp_kernel = zeros(tmp_sz);
    74   tmp_kernel((ind_lo(1):ind_hi(1))+1,(ind_lo(2):ind_hi(2))+1,...
    75     (ind_lo(3):ind_hi(3)))=s_kernel;
     69  %ind_hi=ceil(tmp_sz/2)+floor(size(s_kernel)/2);
     70  %ind_lo=ind_hi-(size(s_kernel)-1);
     71  %ind_lo(ind_lo<1)=1;
     72  %tmp_kernel = zeros(tmp_sz);
     73  %tmp_kernel((ind_lo(1):ind_hi(1))+1,(ind_lo(2):ind_hi(2))+1,...
     74  %  (ind_lo(3):ind_hi(3)))=s_kernel;
     75        tmp_kernel = s_kernel;
     76        tmp_kernel(tmp_sz(1),tmp_sz(2),tmp_sz(3))=0; % Pad with zeros
    7677end
    7778for ii=1:nVols
     
    9293    %tmp_data(pad_sz(1),pad_sz(2),pad_sz(3))=0;
    9394    %tmp_data = cat(3,tmp_data(:,:,1),tmp_data,tmp_data(:,:,end));
    94     tmp_smooth = fftshift(ifftn(fftn(tmp_data).*fftn(tmp_kernel)));
    95     smooth_data(:,:,:,ii) = tmp_smooth(:,:,1:size(data,3));
     95    tmp_smooth = fftshift(ifftn(fftn(tmp_data).*fftn(tmp_kernel)),3);
     96    smooth_data(:,:,:,ii) = tmp_smooth;%tmp_smooth(:,:,1:size(data,3));
    9697  end
    9798end
Note: See TracChangeset for help on using the changeset viewer.

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