%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MRiLab auto generated file: DO NOT EDIT!     %
% Generated by MRiLab "DoWriteXML2m" Generator %
% MRiLab Version 1.3                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Obj, VObj]=VObj_SphereHead(flag)
%====================================
VObj.Gyro=[267538030.3797];
AttributeOpt={'Normal','MT','ME','GM'};
VObj.Model=AttributeOpt{1};
VObj.Name='VObj_SphereHead';
VObj.Notes='3D Sphere Head Object';
VObj.Type='Water';
VObj.TypeNum=[1];
VObj.XDim=[90];
VObj.XDimRes=[0.002];
VObj.YDim=[90];
VObj.YDimRes=[0.002];
VObj.ZDim=[90];
VObj.ZDimRes=[0.002];
[x,y,z]=meshgrid(((-(VObj.XDim-1)/2):((VObj.XDim-1)/2))*VObj.XDimRes,((-(VObj.YDim-1)/2):((VObj.YDim-1)/2))*VObj.YDimRes,((-(VObj.ZDim-1)/2):((VObj.ZDim-1)/2))*VObj.ZDimRes);
rho=zeros([size(x) VObj.TypeNum]);
t1=zeros([size(x) VObj.TypeNum]);
t2=zeros([size(x) VObj.TypeNum]);
t2star=zeros([size(x) VObj.TypeNum]);
chemshift=zeros(1,VObj.TypeNum);
typeflag=zeros(1,VObj.TypeNum);
lineshapeflag=zeros(1,VObj.TypeNum);
k=zeros([size(x) VObj.TypeNum^2]);
econ=zeros([size(x) 3]);
massden=zeros(size(x));
%====================================
Alpha=[1];
Color='b';
Notes='Cube Object';
p.CenterX=[0.015];
p.CenterY=[0.015];
p.CenterZ=[0.015];
p.Length=[0.03];
ChemShift=[0];
ECon=[0.5 0.5 0.5];
K=[10];
LineShapeFlag=[0];
MassDen=[1000];
Rho=[1];
T1=[1];
T2=[0.1];
T2Star=[0.01];
TypeFlag=[0];
TypeIdx=[1];
[mask, fvc]=VObjCube(p,x,y,z,flag);
Obj{1,1}=fvc;
Obj{2,1}=Color;
Obj{3,1}=Alpha;
rho(:,:,:,TypeIdx)=rho(:,:,:,TypeIdx)+mask.*Rho;
t1(:,:,:,TypeIdx)=t1(:,:,:,TypeIdx)+mask.*T1;
t2(:,:,:,TypeIdx)=t2(:,:,:,TypeIdx)+mask.*T2;
t2star(:,:,:,TypeIdx)=t2star(:,:,:,TypeIdx)+mask.*T2Star;
massden=massden+mask.*MassDen;
econ(:,:,:,1)=econ(:,:,:,1)+mask.*ECon(1);
econ(:,:,:,2)=econ(:,:,:,2)+mask.*ECon(2);
econ(:,:,:,3)=econ(:,:,:,3)+mask.*ECon(3);
chemshift(TypeIdx)=ChemShift;
typeflag(TypeIdx)=TypeFlag;
lineshapeflag(TypeIdx)=LineShapeFlag;
if ~strcmp(VObj.Model,'Normal')
for i=1:VObj.TypeNum
k(:,:,:,(TypeIdx-1)*VObj.TypeNum+i)=k(:,:,:,(TypeIdx-1)*VObj.TypeNum+i)+mask.*K(i);
end
end
p=[];
%--------------------
Alpha=[1];
Color='r';
Notes='Sphere Object';
p.CenterX=[0];
p.CenterY=[-0.04];
p.CenterZ=[0];
p.FaceNum=[20];
p.Radius=[0.04];
ChemShift=[0];
ECon=[0.5 0.5 0.5];
K=[10];
LineShapeFlag=[0];
MassDen=[1000];
Rho=[1];
T1=[1];
T2=[0.1];
T2Star=[0.01];
TypeFlag=[0];
TypeIdx=[1];
[mask, fvc]=VObjSphere(p,x,y,z,flag);
Obj{1,2}=fvc;
Obj{2,2}=Color;
Obj{3,2}=Alpha;
rho(:,:,:,TypeIdx)=rho(:,:,:,TypeIdx)+mask.*Rho;
t1(:,:,:,TypeIdx)=t1(:,:,:,TypeIdx)+mask.*T1;
t2(:,:,:,TypeIdx)=t2(:,:,:,TypeIdx)+mask.*T2;
t2star(:,:,:,TypeIdx)=t2star(:,:,:,TypeIdx)+mask.*T2Star;
massden=massden+mask.*MassDen;
econ(:,:,:,1)=econ(:,:,:,1)+mask.*ECon(1);
econ(:,:,:,2)=econ(:,:,:,2)+mask.*ECon(2);
econ(:,:,:,3)=econ(:,:,:,3)+mask.*ECon(3);
chemshift(TypeIdx)=ChemShift;
typeflag(TypeIdx)=TypeFlag;
lineshapeflag(TypeIdx)=LineShapeFlag;
if ~strcmp(VObj.Model,'Normal')
for i=1:VObj.TypeNum
k(:,:,:,(TypeIdx-1)*VObj.TypeNum+i)=k(:,:,:,(TypeIdx-1)*VObj.TypeNum+i)+mask.*K(i);
end
end
p=[];
%--------------------
VObj.Rho=rho;
VObj.T1=t1;
VObj.T2=t2;
VObj.T2Star=t2star;
VObj.ECon=econ;
VObj.MassDen=massden;
VObj.ChemShift=chemshift;
if strcmp(VObj.Model,'GM')
k=reshape(k,[size(x), VObj.TypeNum, VObj.TypeNum]);
VObj.TypeFlag=typeflag;
VObj.LineShapeFlag=lineshapeflag;
end
if ~strcmp(VObj.Model,'Normal')
VObj.K=k;
end
end
