function result=translate2struct(position,attenuation,detectorSize,density)
%% res=translate2struct(position,attenuation,detectorSize)
% position is a point in the middle of the base of the cylindrical detector 
% position is expected in a form of [x1,x2,...xn;y1,y2,...yn;z1,z2...zn]
% where n is a number of sources
% attenuation represents linear attenuation coefficient of the detecor in a
% form of a vector
% detetorSize represents size of a cylindrical detector. detectorSize
% expects input in a form of [D1,D2,...Dn;H1,H2,...Hn] where D1 is a
% diameter of the first detector and H1 is a height of the first detector
%
% result returns structure used as an detector input for function runModel




if ~all(all(isnumeric(position)))||~size(position,1)==3
    error('Wrong position - correct is [x1,x2..;y1,y2...;z1,z2...].')
end
if ~isnumeric(attenuation)
    error('Wrong attenuation - correct is [\mu_1,\mu_2...].')
end
if size(detectorSize,1)~=2||~all(all(isnumeric(detectorSize)))
   error('Sizes of detectors must be in form of [diameter1,diameter2...;height1,height2...].')  
end    
if size(detectorSize,2)~=size(position,2) 
   error('Number of sizes of detectors must be the same as number of positions.')  
end 


result=struct('position',[],'attenuation',[],'size',[],'density',[]);
result.position=position;
result.attenuation=attenuation;
result.size=detectorSize;
result.density=density;




end