Changeset 84


Ignore:
Timestamp:
Jul 14, 2009, 2:33:10 PM (10 years ago)
Author:
tjniskan
Message:
  • Added some memory optimizations for handling large EPI datas

M aedes_readfid.m
M aedes_revision.m

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • aedes_readfid.m

    r83 r84  
    887887
    888888%% Allocate space for k-space
    889 kspace=zeros(hdr.FileHeader.np/2,...
    890              hdr.FileHeader.ntraces,hdr.FileHeader.nblocks);
    891 
    892 if any(AcqType==[1 2])
    893   switch seqcon(2:3)
    894    case {'cc','sc'}
     889% kspace=zeros(hdr.FileHeader.np/2,...
     890%              hdr.FileHeader.ntraces,hdr.FileHeader.nblocks);
     891
     892if ~Dat.FastDataRead
     893  if any(AcqType==[1 2])
     894    switch seqcon(2:3)
     895      case {'cc','sc'}
     896        kspace = zeros(hdr.FileHeader.np/2,...
     897          hdr.FileHeader.ntraces,...
     898          hdr.FileHeader.nblocks,Dat.precision);
     899      otherwise
     900        kspace = zeros(hdr.FileHeader.np/2,...
     901          hdr.FileHeader.nblocks,...
     902          hdr.FileHeader.ntraces,Dat.precision);
     903    end
     904  else
    895905    kspace = zeros(hdr.FileHeader.np/2,...
    896                  hdr.FileHeader.ntraces,...
    897                  hdr.FileHeader.nblocks,Dat.precision);
    898    otherwise
    899     kspace = zeros(hdr.FileHeader.np/2,...
    900                    hdr.FileHeader.nblocks,...
    901                    hdr.FileHeader.ntraces,Dat.precision);
     906      hdr.FileHeader.ntraces,...
     907      hdr.FileHeader.nblocks,Dat.precision);
    902908  end
    903909else
    904   kspace = zeros(hdr.FileHeader.np/2,...
    905                  hdr.FileHeader.ntraces,...
    906                  hdr.FileHeader.nblocks,Dat.precision);
     910  kspace = [];
    907911end
    908912
     
    10381042        % slowed down considerably. If you for some reason want to save also the
    10391043        % block headers in the DATA structure comment out the code line below.
    1040         %hdr.BlockHeaders = [];
     1044        hdr.BlockHeaders = [];
    10411045  end % for ii=1:hdr.
    10421046
     
    13621366   
    13631367    % Flip even kspace lines
    1364     kspace(:,2:2:end,:,:) = flipdim(kspace(:,2:2:end,:,:),1);
    1365    
     1368    if ~Dat.FastDataRead
     1369      for tt=2:2:size(kspace,2)
     1370        kspace(:,tt,:,:) = flipdim(kspace(:,tt,:,:),1);
     1371      end
     1372    else
     1373      kspace(:,2:2:end,:,:) = flipdim(kspace(:,2:2:end,:,:),1);
     1374    end
     1375   
     1376    for tt=2:2:size(kspace,2)
     1377      kspace(:,tt,:,:) = flipdim(kspace(:,tt,:,:),1);
     1378    end
     1379   
    13661380   
    13671381    % Sort centric measurements
     
    15301544        data=kspace;
    15311545      end
     1546      if ~Dat.ReturnKSpace
     1547        kspace = [];
     1548      end
    15321549      if Dat.ShowWaitbar
    15331550        [wb_h,txh]=aedes_calc_wait('Fourier transforming image data...');
    15341551      end
     1552     
    15351553      %data=permute(fftshift(fftshift(abs(fft(permute(fft(data),[2 1 3 4]))),1),2),[2 1 3 4]);
    1536       data=fftshift(fftshift(abs(fft(fft(data,[],1),[],2)),1),2);
     1554      if ~Dat.FastDataRead
     1555        for tt=1:size(data,4)
     1556          data(:,:,:,tt)=fftshift(fftshift(abs(fft(fft(data(:,:,:,tt),[],1),[],2)),1),2);
     1557        end
     1558      else
     1559        data=fftshift(fftshift(abs(fft(fft(data,[],1),[],2)),1),2);
     1560      end
    15371561    else
    15381562      %% Fourier transform 3D image data
  • aedes_revision.m

    r83 r84  
    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 -
Note: See TracChangeset for help on using the changeset viewer.

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