Skip to content

Commit

Permalink
Optional Strain Calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
bjack205 committed May 17, 2016
1 parent dadd0f8 commit f7e6f36
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
Binary file modified Code/AdvancedSettingsGUI.fig
Binary file not shown.
32 changes: 31 additions & 1 deletion Code/AdvancedSettingsGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

% Edit the above text to modify the response to help AdvancedSettingsGUI

% Last Modified by GUIDE v2.5 08-Sep-2015 16:21:32
% Last Modified by GUIDE v2.5 17-May-2016 08:16:51

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
Expand Down Expand Up @@ -66,6 +66,11 @@ function AdvancedSettingsGUI_OpeningFcn(hObject, eventdata, handles, varargin)
handles.PrevSettings = Settings;

%HROIM Method
if ~isfield(Settings,'DoStrain')
Settings.DoStrain = 1;
end
set(handles.DoStrain,'Value',Settings.DoStrain);

HROIMMethodList = {'Simulated-Kinematic','Simulated-Dynamic','Real-Grain Ref','Real-Single Ref'};
set(handles.HROIMMethod, 'String', HROIMMethodList);
if strcmp(Settings.HROIMMethod,'Simulated')
Expand Down Expand Up @@ -129,6 +134,7 @@ function AdvancedSettingsGUI_OpeningFcn(hObject, eventdata, handles, varargin)

%Update Components
HROIMMethod_Callback(handles.HROIMMethod,eventdata,handles);
DoStrain_Callback(handles.DoStrain, eventdata, handles);
handles = guidata(hObject);
DoDD_Callback(handles.DoDD, eventdata, handles);
handles = guidata(hObject);
Expand Down Expand Up @@ -602,5 +608,29 @@ function EnableProfiler_Callback(hObject, eventdata, handles)

% Hint: get(hObject,'Value') returns toggle state of EnableProfiler
handles.Settings.EnableProfiler = get(hObject,'Value');
guidata(hObject,handles);

% --- Executes on button press in DoStrain.
function DoStrain_Callback(hObject, eventdata, handles)
% hObject handle to DoStrain (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of DoStrain
if get(hObject,'Value')
set(handles.HROIMMethod,'Enable','on');
set(handles.HROIMedit,'Enable','on');
set(handles.StandardDeviation,'Enable','on');
set(handles.MisoTol,'Enable','on');
set(handles.GrainRefType,'Enable','on');
HROIMMethod_Callback(handles.HROIMMethod, eventdata, handles);
else
set(handles.HROIMMethod,'Enable','off');
set(handles.HROIMedit,'Enable','off');
set(handles.StandardDeviation,'Enable','off');
set(handles.MisoTol,'Enable','off');
set(handles.GrainRefType,'Enable','off');
end
handles.Settings.DoStrain = get(hObject,'Value');
guidata(hObject,handles);

1 change: 1 addition & 0 deletions Code/GetHROIMDefaultSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

%% Advanced Settings
%HROIM Settings
Settings.DoStrain = 1;
Settings.HROIMMethod = 'Real'; %{'Simulated', 'Real'}, %Someday will add Hybrid
Settings.IterationLimit = 6;
Settings.RefImageInd = 0;
Expand Down
14 changes: 10 additions & 4 deletions Code/HREBSDMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,18 @@

%% Run Analysis
%Use a parfor loop if allowed multiple processors.
tic
if ~isfield(Settings,'DoStrain')
Settings.DoStrain = 1;
end

%Initialize Variables
F = repmat({zeros(3)},1,Settings.ScanLength);
g = repmat({zeros(3,1)},1,Settings.ScanLength);
g = repmat({zeros(3)},1,Settings.ScanLength);
U = repmat({zeros(3)},1,Settings.ScanLength);
SSE = repmat({0},1,Settings.ScanLength);

XX = repmat({zeros(Settings.NumROIs,3)},1,Settings.ScanLength);
if Settings.DoStrain
tic
if Settings.DoParallel > 1
NumberOfCores = Settings.DoParallel;
try
Expand Down Expand Up @@ -301,6 +306,7 @@ commented out this (outputs strain matrix - I think - DTF 5/15/14)
end
Time = toc/60;
if Settings.DisplayGUI; disp(['Time to finish: ' num2str(Time) ' minutes']); end;
end

%% Save output and write to .ang file
for jj = 1:Settings.ScanLength
Expand Down Expand Up @@ -335,14 +341,14 @@ commented out this (outputs strain matrix - I think - DTF 5/15/14)
data.phi1rn{jj} = phi1;
data.PHIrn{jj} = PHI;
data.phi2rn{jj} = phi2;
Settings.XX = XX;

end

data.g{jj} = [phi1 PHI phi2];
Settings.NewAngles(jj,1:3) = [phi1 PHI phi2];

end
Settings.XX = XX;
if strcmp(Settings.ScanType,'L')

data.phi1rn = LFileVals{1};
Expand Down

0 comments on commit f7e6f36

Please sign in to comment.