0001 function fe = feSet(fe,param,val,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
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
0030 param = mrvParamFormat(param);
0031
0032
0033 switch param
0034
0035 case 'name'
0036 fe.name = val;
0037 case 'type'
0038 fe.type = 'faseval';
0039 case 'savedir'
0040 fe.path.savedir = val;
0041
0042
0043 case 'life'
0044 fe.life = val;
0045
0046 case 'fgfromacpc'
0047
0048
0049 fe.fg = dtiXformFiberCoords(val, fe.life.xform.acpc2img,'img');
0050
0051 fe = feSet(fe,'voxel 2 fiber node pairs',[]);
0052
0053 case {'fgimg', 'fg'}
0054
0055
0056
0057 fe.fg = val;
0058
0059 fe = feSet(fe,'voxel 2 fiber node pairs',[]);
0060
0061 case {'fgtensors','tensors','fgq','q'}
0062
0063 fe.life.fibers.tensors = val;
0064
0065 case 'roi'
0066
0067
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;
0078
0079
0080 case {'bvecs','diffusionbvecs'}
0081
0082 fe.life.bvecs = val;
0083 case {'bvecsindices','diffusionimagesindicesindwivolume'}
0084
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
0098
0099 fe.roi.coords = val;
0100
0101
0102
0103 case 'mfiber'
0104 fe.life.Mfiber = val;
0105 case {'measuredsignalfull', 'dsigmeasured'}
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
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
0125 fe.life.voxel2FNpair = val;
0126
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
0135 case 'dwirepeatfile'
0136 fe.path.dwifilerep = val;
0137 case {'diffusionsignalimagerepeat'}
0138
0139
0140
0141
0142
0143
0144 fe.rep.diffusion_signal_img = val;
0145 case {'s0imagerepeat'}
0146
0147
0148
0149
0150
0151
0152
0153 fe.rep.diffusion_S0_img = val;
0154 case {'bvecsrepeat','diffusionbvecsrepeat'}
0155
0156 fe.rep.bvecs = val;
0157 case {'bvecsindicesrepeat','diffusionimagesindicesindwivolumerepeat'}
0158
0159 fe.rep.bvecsindices = val;
0160 case {'bvalsrepeat','diffusionbvalsrepeat'}
0161
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;
0170 case 'dtfile'
0171 fe.path.dtfile = val;
0172
0173 otherwise
0174 error('Unknown parameter %s\n',param);
0175 end
0176
0177 end