Changeset 78 for an2_readfid.m


Ignore:
Timestamp:
Feb 17, 2009, 3:00:56 PM (10 years ago)
Author:
tjniskan
Message:
  • Moved fMRI related plugins to their own subdirectories
  • Created a subdirectory for map calculation plugins and added a few

basic plugins for those. At the moment these plugins do not support
masking etc. and I didn't test them at all so be cautious...

  • Made a minor memory optimation to an2_readfid.m
  • Fixed a few issues in files related updating via SVN
  • Disabled some annoying warnings that Matlab R2008a and higher

generate from uitree and uitreenode functions inan2_juigetfiles.m

  • Coded something minor to an2_maptool.m. This is still stub and does

not work at all. Please don't try to use it.

  • Fixed a bug that caused Aedes to fail without generating an error

when reading VNMR FID-files that don't have PROCPAR in the same folder.

  • Fixed a javaFrame -warning (with R2008a and higher) in aedes.m

M an2_revision.m
M an2_data_read.m
M an2_maptool.m
M aedes.m
D plugins/calculate_t2_map.m
D plugins/calculate_t1r_map.m
D plugins/basic_fmri_analysis.m
D plugins/resting_state_fc.m
A plugins/fmri_plugins
A plugins/fmri_plugins/basic_fmri_analysis.m
A plugins/fmri_plugins/resting_state_fc.m
A plugins/map_plugins
A plugins/map_plugins/t2.m
A plugins/map_plugins/t1_3_parameter_fit.m
A plugins/map_plugins/t1_saturation_recovery.m
A plugins/map_plugins/t1_rho.m
A plugins/map_plugins/t2_rho.m
A plugins/map_plugins/t1_inversion_recovery.m
M an2_readfid.m
M an2_check_updates.m
M an2_juigetfiles.m
M an2_update.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • an2_readfid.m

    r77 r78  
    10701070  mode_bits = fliplr(double(dec2bin(tmp_mode,16))==49);
    10711071  for tt=1:length(BlockHeadStatusLabels)
    1072         if ~isempty(BlockHeadStatusLabels{tt})
    1073           hdr.BlockHeaders.status.(BlockHeadStatusLabels{tt}) = status_bits(tt);
    1074         end
    1075         if ~isempty(BlockHeadModeLabels{tt})
    1076           hdr.BlockHeaders.mode.(BlockHeadModeLabels{tt}) = mode_bits(tt);
    1077         end
     1072    if ~isempty(BlockHeadStatusLabels{tt})
     1073      hdr.BlockHeaders.status.(BlockHeadStatusLabels{tt}) = status_bits(tt);
     1074    end
     1075    if ~isempty(BlockHeadModeLabels{tt})
     1076      hdr.BlockHeaders.mode.(BlockHeadModeLabels{tt}) = mode_bits(tt);
     1077    end
    10781078  end
    10791079 
    10801080  %% Determine data precision
    10811081  if hdr.BlockHeaders.status.S_FLOAT==1
    1082         prec_str = ['single=>',Dat.precision];
    1083         prec = 4; % Precision in bytes
     1082    prec_str = ['single=>',Dat.precision];
     1083    prec = 4; % Precision in bytes
    10841084  elseif hdr.BlockHeaders.status.S_32==1 ...
    1085           && hdr.BlockHeaders.status.S_FLOAT==0
    1086         prec_str = ['int32=>',Dat.precision];
    1087         prec = 4;
     1085      && hdr.BlockHeaders.status.S_FLOAT==0
     1086    prec_str = ['int32=>',Dat.precision];
     1087    prec = 4;
    10881088  elseif hdr.BlockHeaders.status.S_32==0 ...
    1089           && hdr.BlockHeaders.status.S_FLOAT==0
    1090         prec_str = ['int16=>',Dat.precision];
    1091         prec = 2;
     1089      && hdr.BlockHeaders.status.S_FLOAT==0
     1090    prec_str = ['int16=>',Dat.precision];
     1091    prec = 2;
    10921092  end
    10931093 
     
    10991099 
    11001100  % Read the whole data including block headers etc...
    1101   tmp = fread(file_fid,inf,prec_str);
    1102   tmp=reshape(tmp,nVals+hdr.FileHeader.np*hdr.FileHeader.ntraces,[]);
     1101  kspace = fread(file_fid,inf,prec_str);
     1102  kspace=reshape(kspace,nVals+hdr.FileHeader.np*hdr.FileHeader.ntraces,[]);
    11031103 
    11041104  % Remove block headers from the data
    1105   tmp=tmp(nVals+1:end,:);
     1105  kspace=kspace(nVals+1:end,:);
    11061106 
    11071107  % Transform to complex values
    1108   kspace = reshape(tmp,hdr.FileHeader.np,...
     1108  kspace = reshape(kspace,hdr.FileHeader.np,...
    11091109        hdr.FileHeader.ntraces,hdr.FileHeader.nblocks);
    11101110 
    11111111  % Do DC-correction if necessary
    11121112  if ~Dat.DCcorrection || ( nt(1)>1 )
    1113         kspace=complex(kspace(1:2:end,:,:),kspace(2:2:end,:,:));
     1113    kspace=complex(kspace(1:2:end,:,:),kspace(2:2:end,:,:));
    11141114  else
    1115         kspace=complex(kspace(1:2:end,:,:)-hdr.BlockHeaders.lvl,...
    1116           kspace(2:2:end,:,:)-hdr.BlockHeaders.tlt);
     1115    kspace=complex(kspace(1:2:end,:,:)-hdr.BlockHeaders.lvl,...
     1116      kspace(2:2:end,:,:)-hdr.BlockHeaders.tlt);
    11171117  end
    11181118 
    11191119  %% Store and order k-space values
    11201120  if any(AcqType==[1 2])
    1121         switch seqcon(2:3)
    1122           case {'cc','sc'}
    1123                 %kspace(:,:,ii) = complex_block;
    1124           otherwise
    1125                 %kspace(:,ii,:) = complex_block;
    1126                 kspace = permute(kspace,[1 3 2]);
    1127         end
     1121    switch seqcon(2:3)
     1122      case {'cc','sc'}
     1123        %kspace(:,:,ii) = complex_block;
     1124      otherwise
     1125        %kspace(:,ii,:) = complex_block;
     1126        kspace = permute(kspace,[1 3 2]);
     1127    end
    11281128  else
    1129         %kspace(:,:,ii) = complex_block;
     1129    %kspace(:,:,ii) = complex_block;
    11301130  end
    11311131 
Note: See TracChangeset for help on using the changeset viewer.

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