Changeset 98


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

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r97 r98  
    58815881  tmp = abs(diff([data_mn data_mx]))*0.05;
    58825882  ylim = [data_mn-tmp data_mx+tmp];
     5883  if ylim(1)==ylim(2)
     5884    ylim(1)=ylim(1)-1;
     5885    ylim(2)=ylim(2)+1;
     5886  end
    58835887  set(H.TSAX,'ylim',ylim)
    58845888  if isEPI
     
    84958499            tmp.ROI = [];
    84968500            %tmp.FileInfo = [];
    8497             tmp.ROI.voxels{1} = tmp_data.FTDATA;
     8501            tmp.ROI.voxels{1} = logical(tmp_data.FTDATA);
    84988502            tmp.ROI.fpath{1} = [fp,filesep];
    84998503            tmp.ROI.fname{1} = f_name;
     
    86018605            roi_sz=size(tmp.ROI(1).voxels{ii});
    86028606            im_sz = size(DATA{ii}.FTDATA);
    8603 
     8607           
     8608            % Allow loading a 3D ROI over a 4D data if 3D dimensions
     8609            % match...
     8610            if ~Dat.isDataMixed && ndims(DATA{ii}.FTDATA)==4 && ...
     8611                ndims(tmp.ROI(1).voxels{ii})==3 && ...
     8612                ismember(roi_sz(1:3),im_sz(1:3),'rows')
     8613             
     8614              tmp2=tmp.ROI;
     8615              for kk=1:length(tmp2)
     8616                tmp.ROI(kk).voxels{ii} = false(size(DATA{ii}.FTDATA));
     8617                tmp.ROI(kk).voxels{ii}(:,:,:,Dat.CurrentVol)=tmp2(kk).voxels{ii};
     8618              end
     8619              roi_sz=size(tmp.ROI(1).voxels{ii});
     8620              im_sz = size(DATA{ii}.FTDATA);
     8621              clear tmp2
     8622            end
     8623           
    86048624            %% Abort loading of ROIs if relative dimensions are not the same
    86058625            if length(tmp.ROI(1).voxels)~=length(DATA) || ...
  • aedes_revision.m

    r97 r98  
    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 -
  • 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');
  • plugins/fmri_plugins/basic_fmri_analysis.m

    r90 r98  
    7171% Resize tmap to EPI time series size
    7272tmap = maps_out.tmap;
    73 tmap = repmat(tmap,[1,1,1,size(DATA{1}.FTDATA,4)]);
     73%tmap = repmat(tmap,[1,1,1,size(DATA{1}.FTDATA,4)]);
    7474
    7575overlay.FTDATA = tmap;
     
    101101  overlay.fMRIdurats = new_durat;
    102102  DATA{1}.FTDATA(:,:,:,omitVols)=[];
    103   overlay.FTDATA(:,:,:,omitVols)=[];
     103  %overlay.FTDATA(:,:,:,omitVols)=[];
    104104else
    105105  new_onset = onset;
     
    183183  [II_mn,JJ_mn,KK_mn]=ind2sub(size(maps_out.tmap),I_mn);
    184184 
    185   ts_data_max = squeeze(DATA{1}.FTDATA(II_mx,JJ_mx,KK_mx,:));
    186   ts_data_min = squeeze(DATA{1}.FTDATA(II_mn,JJ_mn,KK_mn,:));
     185  ts_data_max = double(squeeze(DATA{1}.FTDATA(II_mx,JJ_mx,KK_mx,:)));
     186  ts_data_min = double(squeeze(DATA{1}.FTDATA(II_mn,JJ_mn,KK_mn,:)));
    187187 
    188188  [bold_prc_max,z_max,th_max,z_hat_max]=estimate_bold(new_onset,new_durat,TR,nScans,ts_data_max);
Note: See TracChangeset for help on using the changeset viewer.

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