Changeset 80 for aedes_readfid.m


Ignore:
Timestamp:
Feb 20, 2009, 3:06:07 PM (10 years ago)
Author:
tjniskan
Message:
  • Changed the historical "an2_" prefix to "aedes_" in all files. NOTE:

Any script or function relying to Aedes functions will be broken
because of this. Just do a search/replace from "an2_" to "aedes_" in
your files and all should be well...

  • Changed the name of an2_readtab.m to a more informative

aedes_readphasetable.m

File:
1 moved

Legend:

Unmodified
Added
Removed
  • aedes_readfid.m

    r78 r80  
    1 function [DATA,msg_out] = an2_readfid(filename,varargin)
    2 % AN2_READFID - Read VNMR (Varian) FID-files
     1function [DATA,msg_out] = aedes_readfid(filename,varargin)
     2% AEDES_READFID - Read VNMR (Varian) FID-files
    33%   
    44%
    55% Synopsis:
    6 %        [DATA,msg]=an2_readfid(filename,'PropertyName1',value1,'PropertyName2',value2,...)
    7 %        [DATA,msg]=an2_readfid(filename,'header')
    8 %        [DATA,msg]=an2_readfid(filename,output_filename)
     6%        [DATA,msg]=aedes_readfid(filename,'PropertyName1',value1,'PropertyName2',value2,...)
     7%        [DATA,msg]=aedes_readfid(filename,'header')
     8%        [DATA,msg]=aedes_readfid(filename,output_filename)
    99%
    1010% Description:
     
    2121%                |-> fname        (file name)
    2222%                |-> fpath        (file path)
    23 %                |-> Param        (parameter values used by AN2_READFID to read the data)
     23%                |-> Param        (parameter values used by AEDES_READFID to read the data)
    2424%          |-> FTDATA             (real fourier transformed image data)
    2525%          |-> KSPACE             (complex k-space, empty by default)
     
    3030%        KSPACE, and PROCPAR fields) if an error has occurred during
    3131%        reading. The error message is returned in the second output
    32 %        argument msg. If AN2_READFID is called with only one output argument
     32%        argument msg. If AEDES_READFID is called with only one output argument
    3333%        (i.e. without MSG), the error message is echoed to the workspace.
    3434%       
     
    4242%        property and values 1, 2, or 3 (see below for more information).
    4343%
    44 %        The supported property-value pairs in AN2_READFID (property strings
     44%        The supported property-value pairs in AEDES_READFID (property strings
    4545%        are not case sensitive):
    4646%
     
    7272%                                               % procpar structure
    7373%                                               % will be read using
    74 %                                               % AN2_READPROCPAR
     74%                                               % AEDES_READPROCPAR
    7575%
    7676%        'ZeroPadding' :  ['off'|'on'|{'auto'}] % 'off' = force
     
    133133%
    134134% Examples:
    135 %        [DATA,msg]=an2_readfid(filename)             % Read image data from 'filename'
    136 %        [DATA,msg]=an2_readfid(filename,'header')    % Read only data file header
    137 %
    138 %        [DATA,msg]=an2_readfid(filename,'return',1)  % Return only image data (default)
    139 %        [DATA,msg]=an2_readfid(filename,'return',2)  % Return only k-space
    140 %        [DATA,msg]=an2_readfid(filename,'return',3)  % Return both image data and k-space
     135%        [DATA,msg]=aedes_readfid(filename)             % Read image data from 'filename'
     136%        [DATA,msg]=aedes_readfid(filename,'header')    % Read only data file header
     137%
     138%        [DATA,msg]=aedes_readfid(filename,'return',1)  % Return only image data (default)
     139%        [DATA,msg]=aedes_readfid(filename,'return',2)  % Return only k-space
     140%        [DATA,msg]=aedes_readfid(filename,'return',3)  % Return both image data and k-space
    141141%       
    142142%        % Read first data file header and then image data and k-space
    143 %        [DATA,msg]=an2_readfid(filename,'header')
    144 %        [DATA,msg]=an2_readfid(DATA.HDR,'return',3)
     143%        [DATA,msg]=aedes_readfid(filename,'header')
     144%        [DATA,msg]=aedes_readfid(DATA.HDR,'return',3)
    145145%
    146146%        % Read VNMR-data with default options and save slices in NIfTI
    147147%        % format
    148 %        DATA=an2_readfid('example.fid','saved_slices.nii');
     148%        DATA=aedes_readfid('example.fid','saved_slices.nii');
    149149%
    150150%        % If you want to use non-default options and also write
    151151%        % NIfTI-files, use the property/value formalism, for example
    152 %        DATA=an2_readfid('example.fid','ZeroPadding','off',...
     152%        DATA=aedes_readfid('example.fid','ZeroPadding','off',...
    153153%                     'OutputFile','saved_slices.nii');
    154154%
    155155% See also:
    156 %        AN2_READFIDPREFS, AN2_READPROCPAR, AN2_READTAB, AN2_DATA_READ,
    157 %        AN2_WRITE_NIFTI, AEDES
     156%        AEDES_READFIDPREFS, AEDES_READPROCPAR, AEDES_READPHASETABLE,
     157%        AEDES_DATA_READ, AEDES_WRITE_NIFTI, AEDES
    158158
    159159% This function is a part of Aedes - A graphical tool for analyzing
     
    454454%% Read procpar if not given as input argument
    455455if isempty(procpar) || nargin~=2
    456   [procpar,proc_msg]=an2_readprocpar([fpath,'procpar']);
     456  [procpar,proc_msg]=aedes_readprocpar([fpath,'procpar']);
    457457  if isempty(procpar)
    458458    DATA=[];
     
    485485    end
    486486  end
    487   [phasetable,msg] = an2_readtab([tabpath,procpar.petable{1}]);
     487  [phasetable,msg] = aedes_readphasetable([tabpath,procpar.petable{1}]);
    488488 
    489489  % If petable cannot be found, check if it is in procpar...
     
    509509    %% If the FID-file has been sorted, the reading can continue but
    510510    % throw a warning.
    511     fprintf(1,'Warning: an2_readfid: Could not find phasetable "%s" in "%s"!\n',procpar.petable{1},tabpath)
     511    fprintf(1,'Warning: aedes_readfid: Could not find phasetable "%s" in "%s"!\n',procpar.petable{1},tabpath)
    512512    Dat.phasetable=[];
    513513  else
     
    656656  nFiles = length(filenames);
    657657   
    658   h=an2_wbar(0,sprintf('Saving slice 1/%d in NIfTI format...',nFiles));
     658  h=aedes_wbar(0,sprintf('Saving slice 1/%d in NIfTI format...',nFiles));
    659659  for ii=1:nFiles
    660     an2_wbar(ii/nFiles,h,sprintf('Saving slice %d/%d in NIfTI format...',ii, ...
     660    aedes_wbar(ii/nFiles,h,sprintf('Saving slice %d/%d in NIfTI format...',ii, ...
    661661                             nFiles))
    662     [done,msg]=an2_write_nifti(DATA.FTDATA(:,:,ii),...
     662    [done,msg]=aedes_write_nifti(DATA.FTDATA(:,:,ii),...
    663663                           [niipath,filenames{ii}],'DataType','single',...
    664664                           'FileType',2);
     
    907907  % Initialize waitbar
    908908  if Dat.ShowWaitbar
    909         wb_h = an2_wbar(0/hdr.FileHeader.nblocks,...
     909        wb_h = aedes_wbar(0/hdr.FileHeader.nblocks,...
    910910          {['Reading ',num2str(AcqType),'D VNMR data (seqcon: "' seqcon '")'],...
    911911          ['(Processing data block ' ...
     
    917917        %% Update waitbar
    918918        if Dat.ShowWaitbar
    919           an2_wbar(ii/hdr.FileHeader.nblocks,...
     919          aedes_wbar(ii/hdr.FileHeader.nblocks,...
    920920                wb_h,...
    921921                {['Reading ',num2str(AcqType),'D VNMR data (seqcon: "' seqcon '")'],...
     
    10481048  % Initialize waitbar
    10491049  if Dat.ShowWaitbar
    1050         wb_h = an2_calc_wait(['Reading ',num2str(AcqType),...
     1050        wb_h = aedes_calc_wait(['Reading ',num2str(AcqType),...
    10511051          'D VNMR data (seqcon: "' seqcon '")']);
    10521052  end
     
    14171417  %% Fourier transform spectral data
    14181418  if AcqType==1
    1419         wb_h = an2_wbar(0,'Fourier transforming spectral data');
     1419        wb_h = aedes_wbar(0,'Fourier transforming spectral data');
    14201420    %data=zeros(size(kspace),'single');
    14211421        data=kspace;
     
    14261426        %% Update waitbar
    14271427        if Dat.ShowWaitbar
    1428           an2_wbar(count/sz,...
     1428          aedes_wbar(count/sz,...
    14291429               wb_h,...
    14301430               {'Fourier transforming spectral data',...
     
    14961496      end
    14971497      if Dat.ShowWaitbar
    1498         [wb_h,txh]=an2_calc_wait('Fourier transforming image data...');
     1498        [wb_h,txh]=aedes_calc_wait('Fourier transforming image data...');
    14991499      end
    15001500      %data=permute(fftshift(fftshift(abs(fft(permute(fft(data),[2 1 3 4]))),1),2),[2 1 3 4]);
     
    15031503      %% Fourier transform 3D image data
    15041504      if Dat.ShowWaitbar
    1505         [wb_h,txh]=an2_calc_wait('Fourier transforming 3D image data...');
     1505        [wb_h,txh]=aedes_calc_wait('Fourier transforming 3D image data...');
    15061506      end
    15071507     
     
    15321532      orient = procpar.orient{1};
    15331533      if any(strcmpi(orient,{'xyz','trans90','cor90','sag90'}))
    1534         data = flipdim(an2_rot3d(data,1,3),2);
     1534        data = flipdim(aedes_rot3d(data,1,3),2);
    15351535      elseif strcmpi(orient,'oblique')
    15361536        data = flipdim(flipdim(data,1),2);
Note: See TracChangeset for help on using the changeset viewer.

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