Skip to content

Commit aa86285

Browse files
committed
Made HopTestPts and HopTests user adjustable parameters.
1 parent f235534 commit aa86285

6 files changed

Lines changed: 28 additions & 10 deletions

File tree

MATLAB/+smi_cluster/@ClusterInterface/ClusterInterface.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
% Called by singleConditionDriver.
4444
singleCondition(pathname, files, algorithm_range, E_range, ...
4545
minPts_range, Pixel2nm, base_name, A_ROI, ...
46-
doHopkins, doSigmaActual, Alpha)
46+
doHopkins, doSigmaActual, Alpha, SC)
4747

4848
% Called by Example_plotROIDriver.
4949
plotROIDriver(PixelSize, options, start_datadir, SaveDir, IncludeCell)

MATLAB/+smi_cluster/@ClusterInterface/singleCondition.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function singleCondition(pathname, files, algorithm_range, E_range, ...
22
minPts_range, Pixel2nm, base_name, A_ROI, ...
3-
doHopkins, doSigmaActual, Alpha)
3+
doHopkins, doSigmaActual, Alpha, SC)
44
% ---------- Statistics for a single condition
55
% Perform cluster analysis for comparison of experimental conditions. This is
66
% useful for performing parameter studies, especially over a range of E's
@@ -23,7 +23,8 @@ function singleCondition(pathname, files, algorithm_range, E_range, ...
2323
% avoid crashes due to lack of memory
2424
% Alpha [DEFAULT = 2] ratio of local density / overall density
2525
% for Voronoi clustering
26-
%
26+
% SC StatisticsClustering object containing certain
27+
% parameters such as HopTestPts and HopTests
2728
%
2829
% OUTPUTS:
2930
% A variety of plots are produced and are placed in a subdirectory of
@@ -52,8 +53,10 @@ function singleCondition(pathname, files, algorithm_range, E_range, ...
5253
end
5354

5455
c = smi_cluster.Clustering();
55-
SC = smi_cluster.StatisticsClustering();
5656
PC = smi_cluster.PairCorrelation();
57+
if ~exist('SC', 'var')
58+
SC = smi_cluster.StatisticsClustering();
59+
end
5760

5861
base_name_save = base_name;
5962
if ~startsWith(base_name, 'ALL')

MATLAB/+smi_cluster/@StatisticsClustering/StatisticsClustering.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
CSV = false; % If true, produce a CSV file of the data
5858

5959
% Properties below are used by various routines.
60+
HopTestPts = 10; % Number of test points to compute Hopkins' statistic
61+
HopTests =1000; % Number of tests to run to produce a Hopkins' stat.
6062
Rate = 20; % Sampling rate for statistical functions
6163
Dendro_cutoff = 50; % Cluster cutoff for Dendrogram analysis (nm)
6264
Ripley_cutoff = 200; % Ripley distance cutoff (nm)

MATLAB/+smi_cluster/@StatisticsClustering/hopkins.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
% BaseName name to identify saved plots, which will have various
1111
% descriptive suffixes attached
1212
% Rate [ 20] sampling rate for statistical functions
13+
% HopTestPts number of Hopkins' statistic test points
14+
% HopTests number of tests to run to produce a Hopkins' statistic
1315
% particle_types cell array of particle types (names)
1416
% e.g., particle_types = {'5', '10'};
1517
% are of the form {[n1 x 1], [n2 x 1]}
@@ -76,8 +78,10 @@
7678
D_nm = -1;
7779
end
7880

79-
test = 5; % The number of test points.
80-
ntests = 1000; % The number of Hopkins statistics to use.
81+
%test = 5; % The number of test points.
82+
%ntests = 1000; % The number of Hopkins statistics to use.
83+
test = obj.HopTestPts; % The number of test points.
84+
ntests = obj.HopTests; % The number of Hopkins statistics to use.
8185
bins = 100; % The number of bins for the probability graphs.
8286
fitting = false; % Gaussian fitting of the data.
8387

MATLAB/+smi_cluster/@StatisticsClustering/hopkins_ROIcombined.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
% descriptive suffixes attached
1111
% Xlim [] x-axis limits if defined
1212
% Ylim [] y-axis limits if defined
13+
% HopTestPts number of Hopkins' statistic test points
14+
% HopTests number of tests to run to produce a Hopkins' statistic
1315
% n_ROIs number of ROIs to combine
1416
% ROIs n_ROIs cell array containing the following fields (nm):
1517
% ROI ROI limits in the form
@@ -24,8 +26,10 @@
2426

2527
base_name = obj.BaseName;
2628

27-
test = 5; % The number of test points.
28-
ntests = 1000; % The number of Hopkins statistics to use.
29+
%test = 5; % The number of test points.
30+
%ntests = 1000; % The number of Hopkins statistics to use.
31+
test = obj.HopTestPts; % The number of test points.
32+
ntests = obj.HopTests; % The number of Hopkins statistics to use.
2933

3034
% Dimension (2D or 3D)
3135
dim = 2;

MATLAB/examples/singleConditionDriver.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,14 @@
132132
Alpha = 2;
133133

134134
CI = smi_cluster.ClusterInterface();
135-
%Alpha = 3;
135+
SC = smi_cluster.StatisticsClustering();
136+
C.HopTestPts = 10;
137+
C.HopTests = 1000;
138+
139+
%Alpha = 2;
136140
CI.singleCondition(pathname, files, algorithm_range, E_range, minPts_range,...
137-
Pixel2nm, base_name, A_ROI, doHopkins, doSigmaActual, Alpha);
141+
Pixel2nm, base_name, A_ROI, doHopkins, doSigmaActual, ...
142+
Alpha, SC);
138143

139144
%Alpha = 3;
140145
%CI.singleCondition(pathname, files, algorithm_range, E_range, minPts_range,...

0 commit comments

Comments
 (0)