Changeset 129 for misclib


Ignore:
Timestamp:
Jun 10, 2010, 9:13:47 AM (9 years ago)
Author:
tjniskan
Message:
  • Added plugin for correlation mapping with filtering/other options
  • Added flipping of 3D ROIs in aedes.m
  • Added possibility of changing ROI color (in the ROI -uimenu)
  • Minor fixes/changes here and there...

M misclib/fmri_spm_volumes.m
M misclib/fmri_filter.m
M aedes_fitmaps.m
M aedes.m
M plugins/save_roi_as_mask.m
M plugins/calc_asl_cbf.m
A plugins/fmri_plugins/correlation_mapping.m
M plugins/fmri_plugins/resting_state_fc.m
M plugins/map_plugins/t1_inversion_recovery.m
M aedes_revision.m

Location:
misclib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • misclib/fmri_filter.m

    r80 r129  
    4545filtered_data = double(data);
    4646
    47 if isempty(hipass) && isempty(lowpass) && ~detrend
     47if isempty(hipass) && isempty(lowpass) && ~detrending
    4848  return
    4949end
     
    126126end
    127127
    128 
    129 
    130 
    131 
  • misclib/fmri_spm_volumes.m

    r80 r129  
    11function fmri_spm_volumes(infile,outdir,varargin)
     2% This function reads VNMR EPI data and writes volumes in separate NIfTI
     3% files for SPM analysis
    24%
    3 %
    4 %
     5
    56
    67if nargin<2
    78  error('Too few input arguments')
     9end
     10
     11% Defaults
     12if infile(end)==filesep
     13  infile = infile(1:end-1);
     14end
     15[fp,fn,fe] = fileparts(infile);
     16if strcmpi(fn,'fid')
     17  [fp,fn,fe] = fileparts(fp);
     18  filename = fn;
     19  indir = fp;
     20else
     21  filename = fn;
     22  indir = infile;
     23end
     24
     25% If the outout directory does not contain a path
     26% try to create the output directory into the input
     27% directory...
     28if ~any(outdir==filesep)
     29  [tmp,msg,msg_id] = mkdir(indir,outdir);
     30  outdir = [indir,filesep,outdir];
    831end
    932
     
    1235end
    1336
    14 % Defaults
    15 [fp,fn,fe] = fileparts(infile);
    16 if strcmpi(fn,'fid')
    17   [fp,fn,fe] = fileparts(fp);
    18   filename = fn;
    19 else
    20   filename = fn;
    21 end
    2237VoxelSize = [1 1 1.5 2.039];
    2338XYZUnits = 'mm';
     
    6378
    6479% Read the fMRI data
    65 data = aedes_readfid(infile,'FastRead','on');
     80[data,msg] = aedes_readfid(infile,'precision','single');
    6681if isempty(data)
    67   disp('FMRI_SPM_VOLUMES: Action canceled...')
     82  fprintf(1,'FMRI_SPM_VOLUMES: Error reading data from %s...\n',infile)
    6883  return
    6984end
     
    8095  end
    8196else
    82   error('No PROCPAR found!')
     97  fprintf(1,'FMRI_SPM_VOLUMES: No PROCPAR found (%s)\n',infile)
     98  return
    8399end
    84100
    85 if isEPI
    86   % Remove first slice from EPI data
    87   data.FTDATA = data.FTDATA(:,:,:,2:end);
    88 end
    89101
    90102if isempty(StartVolume)
    91103  StartVolume = 1;
    92104end
    93 
    94105if isempty(EndVolume)
    95106  EndVolume = size(data.FTDATA,4);
    96107end
    97108
     109% Number of volumes to write
    98110nVols = length(StartVolume:EndVolume);
    99111
     112% Initialize waitbar
    100113wbh = aedes_wbar(0,['Writing volumes...']);
    101114
     
    116129 
    117130  % Rotate and flip volumes VNMR EPI and RASER to right orientations
    118   if isEPI
    119     vol = flipdim(aedes_rot3d(vol,1,3),2);
    120   elseif isRASER
    121     vol = flipdim(vol,2);
    122   end
     131  %if isEPI
     132  %  vol = flipdim(aedes_rot3d(vol,1,3),2);
     133  %elseif isRASER
     134  %  vol = flipdim(vol,2);
     135  %end
    123136 
    124137  % Construct file name
     
    126139 
    127140  % Write the NIfTI file
    128   done=aedes_write_nifti(vol,[outdir,fname],...
     141  tmp=aedes_write_nifti(vol,[outdir,fname],...
    129142    'VoxelSize',VoxelSize,...
    130143    'XYZUnits',XYZUnits,...
    131144    'TimeUnits',TimeUnits);
    132   if ~done
    133     error('Could not write file')
     145  if ~tmp
     146    fprintf(1,'Could not write file %s\n',[outdir,fname])
     147    return
    134148  end
    135149end
     
    141155
    142156
     157
    143158 
Note: See TracChangeset for help on using the changeset viewer.

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