Skip to content

Commit

Permalink
ADDED INTERNAL LAMBDA FN THRESHOLD
Browse files Browse the repository at this point in the history
Rounds slight variations above and below 0-1 range to limits
  • Loading branch information
gavinscode committed Jan 8, 2022
1 parent 9c9579c commit 5170b8f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions create_2d_cone_slice.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
voxScale = voxSize/newVoxSize; % Scale up factor on image for FDTD

writeImage = 0;
fileNameBase = 'Cone_EC'; %'Cylinder' 'Cone_EC' 'Cone_CinC' 'Cone_CinC_EC'
fileNameBase = 'Cone'; %'Cylinder' 'Cone_EC' 'Cone_CinC' 'Cone_CinC_EC'

% targetFolder = '/Users/gavintaylor/Desktop/AnalysisImages';
targetFolder = '/Users/gavintaylor/Documents/Company/Client Projects/Cones MPI/AnalysisVolumes/2 Micron';
Expand Down Expand Up @@ -43,7 +43,7 @@

% Note, these don't automatically adjust the filename
displayProfiles.CinC = 0;
displayProfiles.EpicorneaCone = 1;
displayProfiles.EpicorneaCone = 0;

%Can be from 1 - 4, can also be equal
interconeOnLeft = NaN;
Expand All @@ -60,7 +60,7 @@
if ~makeLabels
outerValue = 1.33;
innerValue = 1.34;
coneValue = 'radialTop'; %1.52 'cylinder', 'radialTop', 'radialBase', 'linear' 'both'
coneValue = 'radialBase'; %1.52 'cylinder', 'radialTop', 'radialBase', 'linear' 'both'
outerCorneaValue = 1.5;
epicorneaValue = 1.53;
interconeValue = -1; %1.47; -1;
Expand Down
15 changes: 11 additions & 4 deletions graded_RI_trace_and_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
scaleBarsOnRayDiagram = 1;
acceptanceUsingReceptor = 1;

testPlot = 1;
testPlot = 0;
testPlotSurface = 0;

loopLim = 10000;
Expand Down Expand Up @@ -1025,7 +1025,7 @@

timePerAngle = zeros(length(incidenceAngle),1);

for aAngle = 8; 1:length(incidenceAngle);
for aAngle = 1:length(incidenceAngle);

tic

Expand Down Expand Up @@ -1074,7 +1074,7 @@
periodSpotsArray = zeros(3, numPeriods, nOrigins);
end

for iOrigin = 2102; 1:nOrigins;
for iOrigin = 1:nOrigins;

tempTime = toc;
[aAngle iOrigin round(tempTime/60)]
Expand Down Expand Up @@ -2611,14 +2611,21 @@
% lambda = norm(intersectPoints(nearestInd,:)-x0)/norm(x1-x0);
lambda = nearestDist/norm(x1-x0);

% Seem to need a threshold here as well...
if lambda > 1 && lambda < 1 + 1e-9
lambda = 1;
elseif lambda < 0 && lambda > -1e-9
lambda = 0;
end

else
% points are equal, set to zero to break
lambda = 0;
% warning('Query points are equal in lambda')
end

if lambda > 1
[lambda inpolyhedron(surface, x1, 'tol', 0, 'flipNormals',true) ...
[lambda inpolyhedron(surface, x0, 'tol', 0, 'flipNormals',true) ...
inpolyhedron(surface, x1, 'tol', 0, 'flipNormals',true) norm(x1-x0) min(abs(intersectDistance))]

error('Large lambda step, intersect was triggered too early, check threshold in intersection function')
Expand Down
2 changes: 1 addition & 1 deletion plot_cone_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

exposedConeInds = find(coneProfileZ*voxelSize > coneTipZ - exposedHeight/1000);

for aAngle = 1:length(incidenceAngle);
for aAngle = 1:5; 1:length(incidenceAngle);

rayPathArray = rayPathCells{aAngle};
finalIntersect = finalIntersectCells{aAngle};
Expand Down
7 changes: 4 additions & 3 deletions runConditionsBatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

% metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_both.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_cylinder.mat'; graded_RI_trace_and_test
% metaFile = 'Cylinder_1000_nm_Cone_0_SD_GRIN_cylinder.mat'; graded_RI_trace_and_test
%%% REDO %%% metaFile = 'Cylinder_1000_nm_Cone_0_SD_GRIN_cylinder.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_linear.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test
metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_radialBase.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_1000_nm_Cone_0_SD_GRIN_radialTop_TipCorrection.mat'; graded_RI_trace_and_test

% internal structures
dataFolder = '/Users/gavintaylor/Documents/Company/Client Projects/Cones MPI/AnalysisVolumes/2 micron/Extra internal structures/Radial RI/';

metaFile = 'Cone_CinC_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test
metaFile = 'Cone_CinC_EC_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_CinC_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test
% metaFile = 'Cone_CinC_EC_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test
metaFile = 'Cone_EC_1000_nm_Cone_0_SD_GRIN_radialTop.mat'; graded_RI_trace_and_test

% % Uniform
Expand Down

0 comments on commit 5170b8f

Please sign in to comment.