function varargout = DoseMapperGUI(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @DoseMapperGUI_OpeningFcn, ...
'gui_OutputFcn', @DoseMapperGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function DoseMapperGUI_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
handles.data_loaded=0;
guidata(hObject, handles);
function varargout = DoseMapperGUI_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function source_type_Callback(hObject, eventdata, handles)
function source_type_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function source_strength_Callback(hObject, eventdata, handles)
function source_strength_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function detector_type_Callback(hObject, eventdata, handles)
function detector_type_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function scan_speed_Callback(hObject, eventdata, handles)
function scan_speed_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function scan_height_Callback(hObject, eventdata, handles)
function scan_height_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Plottype_Callback(hObject, eventdata, handles)
function Plottype_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function runmapper_Callback(hObject, eventdata, handles)
if (handles.data_loaded==0)
load('MCNPdata.mat');
handles.data_loaded=1;
end
STstr = get(handles.source_type,'String');
STval = get(handles.source_type,'Value');
switch STstr{STval};
case 'Single Point-source'
HeightMesh100=SingleHeightMesh100;
HeightMesh300=SingleHeightMesh300;
HeightMesh500=SingleHeightMesh500;
HeightMesh700=SingleHeightMesh700;
HeightMesh1000=SingleHeightMesh1000;
x = SingleSourceCoords(:,1);
y = SingleSourceCoords(:,2);
axes(handles.SourceAxes);
scatter(x,y,1,'filled');
xlim([0 3000])
ylim([0 3000])
case 'Multiple Point-sources'
HeightMesh100=MultiHeightMesh100;
HeightMesh300=MultiHeightMesh300;
HeightMesh500=MultiHeightMesh500;
HeightMesh700=MultiHeightMesh700;
HeightMesh1000=MultiHeightMesh1000;
x = MultiSourceCoords(:,1);
y = MultiSourceCoords(:,2);
axes(handles.SourceAxes);
scatter(x,y,6,'filled');
xlim([0 3000])
ylim([0 3000])
case 'Gaussian Distribution'
HeightMesh100=GaussHeightMesh100;
HeightMesh300=GaussHeightMesh300;
HeightMesh500=GaussHeightMesh500;
HeightMesh700=GaussHeightMesh700;
HeightMesh1000=GaussHeightMesh1000;
end
SHstr = get(handles.scan_height, 'String');
SHval = get(handles.scan_height,'Value');
switch SHstr{SHval};
case '100ft'
HeightMesh=HeightMesh100;
case '300ft'
HeightMesh=HeightMesh300;
case '500ft'
HeightMesh=HeightMesh500;
case '700ft'
HeightMesh=HeightMesh700;
case '1,000ft'
HeightMesh=HeightMesh1000;
end
SSstr = get(handles.source_strength, 'String');
SSval = get(handles.source_strength,'Value');
switch SSstr{SSval};
case '1Rem/hr'
Source_Mesh=3.7E+10*3.5*HeightMesh;
case '3Rem/hr'
Source_Mesh=3.7E+10*10*HeightMesh;
case '5Rem/hr'
Source_Mesh=3.7E+10*17*HeightMesh;
end
Scanstr = get(handles.scan_speed, 'String');
Scanval = get(handles.scan_speed,'Value');
switch Scanstr{Scanval};
case '12knots (20fps)'
scan_speed=1;
case '30knots (50fps)'
scan_speed=2;
case '59knots (100fps)'
scan_speed=3;
case '89knots (150fps)'
scan_speed=4;
case '118knots (200fps)'
scan_speed=5;
end
DTstr = get(handles.detector_type, 'String');
DTval = get(handles.detector_type,'Value');
switch DTstr{DTval};
case '3"x3" NaI'
detector_type=1;
case '2"x2" NaI'
detector_type=2;
case '1"x1" NaI'
detector_type=3;
case 'GM Tube'
detector_type=4;
end
if detector_type==1
DetEff=0.3;
DetSA=4*pi*(1.5*2.54)^2;
DetScale=DetEff*DetSA;
DetBG=200;
elseif detector_type==2
DetEff=0.25;
DetSA=4*pi*(1*2.54)^2;
DetScale=DetEff*DetSA;
DetBG=100;
elseif detector_type==3
DetEff=0.2;
DetSA=4*pi*(.5*2.54)^2;
DetScale=DetEff*DetSA;
DetBG=30;
elseif detector_type==4
DetEff=0.02;
DetSA=3;
DetScale=DetEff*DetSA;
DetBG=1;
end
NetCPSMesh=Source_Mesh*DetScale;
if scan_speed==1
mesh=3000/20;
gridspace=20;
axis_valsx=linspace(1,3000,mesh);
axis_valsy=flipud(axis_valsx);
elseif scan_speed==2
mesh=3000/50;
gridspace=50;
axis_valsx=linspace(1,3000,mesh);
axis_valsy=flipud(axis_valsx);
elseif scan_speed==3
mesh=3000/100;
gridspace=100;
axis_valsx=linspace(1,3000,mesh);
axis_valsy=flipud(axis_valsx);
elseif scan_speed==4
mesh=3000/150;
gridspace=150;
axis_valsx=linspace(1,3000,mesh);
axis_valsy=flipud(axis_valsx);
elseif scan_speed==5
mesh=3000/200;
gridspace=200;
axis_valsx=linspace(1,3000,mesh);
axis_valsy=flipud(axis_valsx);
end
IdealScanMesh=zeros(mesh,mesh);
for i=1:1:mesh
for j=1:1:mesh
amax=i*gridspace;
amin=amax-gridspace+1;
b=(j*gridspace)-(gridspace/2);
CPSIntegral=NetCPSMesh(amin:amax,b);
Counts=trapz(CPSIntegral/gridspace);
IdealScanMesh(i,j)=Counts;
end
end
PoissonMesh=zeros(mesh,mesh);
for i=1:1:mesh
for j=1:1:mesh
count=IdealScanMesh(i,j)+DetBG;
RealCount=poissrnd(count);
PoissonMesh(i,j)=RealCount;
end
end
Scanstr = get(handles.Plottype, 'String');
Scanval = get(handles.Plottype,'Value');
switch Scanstr{Scanval};
case 'Image'
axes(handles.axes);
imagesc(axis_valsx,axis_valsy,PoissonMesh);
colormap(hot);
colorbar;
title(colorbar,'Counts');
case '3D'
axes(handles.axes);
surface(axis_valsx,axis_valsy,PoissonMesh);
colormap(hot);
colorbar;
title(colorbar,'Counts');
end
function Untitled_1_Callback(hObject, eventdata, handles)