Home > fe > feSet.m

feSet

PURPOSE ^

Set fascicle evaluation parameters.

SYNOPSIS ^

function fe = feSet(fe,param,val,varargin)

DESCRIPTION ^

 Set fascicle evaluation parameters.

   fe = feSet(fe,param,val,varargin)

----------
 feSet(fe,'bvecsindices');
----------   
 Set the a second diffusion signla measuremnt (repeat).
 Image_vals is the image array with the dwi signal taken from all the
 voxels in the new dataset the fe.roi
 fe = feSet(fe,'diffusion signal repeat',image_vals);
----------
 Set the the s0 (no diffusion direction measurement) for a second
 diffusion signla measuremnt (repeat).
 Image_vals is the image array with the dwi signal taken from all the
 voxels in the new dataset the fe.roi
 fe = feSet(fe,'b0signalrepeat',image_vals);
----------


 Copyright (2013-2014), Franco Pestilli, Stanford University, pestillifranco@gmail.com.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fe = feSet(fe,param,val,varargin)
0002 % Set fascicle evaluation parameters.
0003 %
0004 %   fe = feSet(fe,param,val,varargin)
0005 %
0006 %----------
0007 % feSet(fe,'bvecsindices');
0008 %----------
0009 % Set the a second diffusion signla measuremnt (repeat).
0010 % Image_vals is the image array with the dwi signal taken from all the
0011 % voxels in the new dataset the fe.roi
0012 % fe = feSet(fe,'diffusion signal repeat',image_vals);
0013 %----------
0014 % Set the the s0 (no diffusion direction measurement) for a second
0015 % diffusion signla measuremnt (repeat).
0016 % Image_vals is the image array with the dwi signal taken from all the
0017 % voxels in the new dataset the fe.roi
0018 % fe = feSet(fe,'b0signalrepeat',image_vals);
0019 %----------
0020 %
0021 %
0022 % Copyright (2013-2014), Franco Pestilli, Stanford University, pestillifranco@gmail.com.
0023 
0024 % Check for input parameters
0025 if notDefined('fe'),    error('fe structure required'); end
0026 if notDefined('param'), error('param required'); end
0027 if ~exist('val','var'), error('Value required'); end
0028 
0029 % Squeeze out spaces and force lower case
0030 param = mrvParamFormat(param);
0031 
0032 %%
0033 switch param
0034   % Book-keeping
0035   case 'name'
0036     fe.name  = val;        % This one's name
0037   case 'type'
0038     fe.type  = 'faseval'; % Always fascicle evaluation
0039   case 'savedir'
0040     fe.path.savedir  = val; % Always fascicle evaluation
0041   
0042     % Set top level structure, not just single slot
0043   case 'life'
0044     fe.life  = val;  % Structure of parameters and results from LIFE analysis
0045     
0046   case 'fgfromacpc'
0047     % Fiber group candidate fascicles, Connectome.
0048     % Everything isin img coordinates in LiFE
0049     fe.fg  = dtiXformFiberCoords(val, fe.life.xform.acpc2img,'img');
0050     % Must clear when we change the fg
0051     fe = feSet(fe,'voxel 2 fiber node pairs',[]);
0052     
0053   case {'fgimg', 'fg'}
0054     % Fiber group candidate fascicles, Connectome.
0055     % Everything is in img coordinates in LiFE
0056     %
0057     fe.fg  = val;
0058     % Must clear when we change the fg
0059     fe = feSet(fe,'voxel 2 fiber node pairs',[]);
0060 
0061   case {'fgtensors','tensors','fgq','q'}
0062     % fe = feSet(fe, 'tensors', tensors);    - set the passed tensors
0063     fe.life.fibers.tensors = val;
0064 
0065   case 'roi'
0066     % Cell array of regions of interest where we evaluate
0067     % Must clear v2fnp
0068     fe.roi   = val;
0069     fe       = feSet(fe,'v2fnp',[]);
0070     
0071   case {'roifromfg','fgroi','roifg'}
0072     name   = sprintf('roi_%s',fe.fg.name); 
0073     randColor = rand(1,3);
0074     fe.roi = dtiNewRoi(name,randColor,fefgGet(feGet(fe,'fg img'),'unique image coords'));
0075     
0076   case 'xform'
0077     fe.life.xform = val;  % Transforms between coords for fg, roi, and dwi data
0078      
0079   %% Diffusion data related parameters
0080   case {'bvecs','diffusionbvecs'}
0081     % feSet(fe,'bvecs');
0082     fe.life.bvecs = val;
0083   case {'bvecsindices','diffusionimagesindicesindwivolume'}
0084     % feSet(fe,'bvecsindices');
0085     fe.life.bvecsindices = val;
0086   case {'bvals','diffusionbvals'}
0087     fe.life.bvals = val;    
0088   case {'diffusionsignalimage','dsi', 'diffusion_signal_img'}
0089     fe.life.diffusion_signal_img = val;
0090   case {'b0signalimage','b0img', 'diffusion_s0_im','s0image'}
0091     fe.life.diffusion_S0_img = val;
0092   case {'usedvoxels'}
0093     fe.life.usedVoxels = val;
0094   case {'modeltensor'}
0095     fe.life.modelTensor = val;
0096   case {'roivoxels','roicoords'}
0097     % What space?  What form for the coords?
0098     % Always in IMG coords in LiFE.
0099     fe.roi.coords = val;
0100   
0101     
0102     %% The LiFE model
0103   case 'mfiber'
0104     fe.life.Mfiber = val;             % Fiber portion of M matrix
0105   case {'measuredsignalfull', 'dsigmeasured'}      % Measured signal in ROI
0106     fe.life.dSig  = val;
0107   case 'fit'
0108     fe.life.fit = val;
0109   case 'voxfit'
0110     fe.life.voxfit = val;
0111   case 'xvalfit'
0112     fe.life.xvalfit = val;
0113   
0114     %% Connectome fibers information.
0115   case {'numberofuniquefibersineachvoxel','uniquefibersnum','numberofuniquefibers','numuniquef'}
0116     fe.life.fibers.unique.num = val;
0117   case {'indextouniquefibersineachvoxel','uniquefibersindex','uniqueindex','indexesofuniquefibers','indexuniquef','uniquefibers'}
0118     fe.life.fibers.unique.index = val;
0119   case {'numberoftotalfibersineachvoxel','totalfibernmber','fibersnum','numberoffibers','numf','numfibers'}
0120     fe.life.fibers.total.num = val;
0121   case {'indexoftotalfibersineachvoxel','totalfiberindex','fibersbyvox','fibersinvox'}
0122     fe.life.fibers.total.index = val;
0123   case {'voxel2fibernodepairs','v2fnp'}
0124     % This has to be cleared whenever we change fg or roi
0125     fe.life.voxel2FNpair = val;
0126     % Spatial coordinate transforms for voxels and fg to coordinate frames
0127   case {'xformimg2acpc','img2acpc','img2acpcxform'}
0128     fe.life.xform.img2acpc = val;
0129   case {'xformacpc2img','acpc2img','acpc2imgxform'}
0130     fe.life.xform.acpc2img = val;
0131   case {'size','imgsize','volumesize','dims','dim'}
0132     fe.life.imagedim = val;
0133     
0134     %% Diffusion data reapeted measure parameters
0135   case 'dwirepeatfile'
0136     fe.path.dwifilerep = val;  % Diffusion weighted file used for testing results
0137   case {'diffusionsignalimagerepeat'}
0138     % Set the a second diffusion signla measuremnt (repeat).
0139     %
0140     % Image_vals is the image array with the dwi signal taken from all the
0141     % voxels in the new dataset the fe.roi
0142     %
0143     % fe = feSet(fe,'diffusion signal repeat',image_vals);
0144     fe.rep.diffusion_signal_img = val;
0145   case {'s0imagerepeat'}
0146     % Set the the s0 (no diffusion direction measurement) for a second
0147     % diffusion signla measuremnt (repeat).
0148     %
0149     % Image_vals is the image array with the dwi signal taken from all the
0150     % voxels in the new dataset the fe.roi
0151     %
0152     % fe = feSet(fe,'b0signalrepeat',image_vals);
0153     fe.rep.diffusion_S0_img = val;
0154   case {'bvecsrepeat','diffusionbvecsrepeat'}
0155     % feSet(fe,'bvecsrepeat');
0156     fe.rep.bvecs = val;
0157   case {'bvecsindicesrepeat','diffusionimagesindicesindwivolumerepeat'}
0158     % feSet(fe,'bvecsindicesrepeat');
0159     fe.rep.bvecsindices = val;
0160   case {'bvalsrepeat','diffusionbvalsrepeat'}
0161     % fe = feSet(fe,'bvalsrepeat')
0162     fe.rep.bvals = val;
0163   case {'imgsizerepeat'}
0164     fe.rep.imagedim = val;
0165     
0166   case {'anatomyfile'}
0167     fe.path.anatomy = val;
0168   case 'dwifile'
0169     fe.path.dwifile = val;  % Diffusion weighted file used for testing results
0170   case 'dtfile'
0171     fe.path.dtfile = val;  % Diffusion weighted file used for testing results
0172 
0173   otherwise
0174     error('Unknown parameter %s\n',param);
0175 end
0176 
0177 end

Generated on Wed 16-Jul-2014 19:56:13 by m2html © 2005