Changeset 119 for misclib/fmri_smooth.m


Ignore:
Timestamp:
Apr 9, 2010, 2:24:32 PM (9 years ago)
Author:
tjniskan
Message:
  • Added support for triple-reference EPI data.
  • Added two new properties for aedes_readfid:
    • FileChunkSize? for reducing memory requirements when reading large fid-files (default FileChunkSize?=500 MB)
    • EPIBlockSize for reducing memory requirements when reading large multireceiver EPI (default=100 volumes)
  • Tried to speed up smoothing in fMRI analysis by performing the

operation in frequency space. Still needs some work...

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misclib/fmri_smooth.m

    r98 r119  
    4141% Calculate kernel size using STDs
    4242kernel_sz = round(6*stds);
     43if kernel_sz(3)>floor((size(data,3)/2))
     44  kernel_sz(3)=floor((size(data,3)-1)/2);
     45end
     46kernel_sz
    4347
    4448% Construct the smoothing kernel
     
    6266nVols = size(data,4);
    6367if ~UseImFilter
    64   ind_hi=ceil(size(data(:,:,:,1))/2)+ceil(size(s_kernel)/2);
     68  tmp_sz = size(data(:,:,:,1));
     69  %tmp_sz(3)=tmp_sz(3)+fwhm_sz(3);
     70  ind_hi=ceil(tmp_sz/2)+floor(size(s_kernel)/2);
    6571  ind_lo=ind_hi-(size(s_kernel)-1);
    6672  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;
     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;
    7076end
    7177for ii=1:nVols
     
    8389  else
    8490    tmp_data = double(data(:,:,:,ii));
    85     smooth_data(:,:,:,ii) = fftshift(ifftn(fftn(tmp_data).*fftn(tmp_kernel)));
     91    %pad_sz=size(tmp_data)+fwhm_sz*2;
     92    %tmp_data(pad_sz(1),pad_sz(2),pad_sz(3))=0;
     93    %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));
    8696  end
    8797end
Note: See TracChangeset for help on using the changeset viewer.

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