Skip to content

Commit 6829eee

Browse files
committed
excess code cleanup heatmap sampler
1 parent dbdeab3 commit 6829eee

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

ext/HeatmapSampler.jl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ function sampleHeatmap(
124124
roi::AbstractMatrix{<:Real},
125125
x_grid::AbstractVector{<:Real},
126126
y_grid::AbstractVector{<:Real},
127-
thres::Real = 0,
127+
thres::Real = 1e-14,
128128
)
129129
#
130130

131131
# mask the region of interest above the sampling threshold value
132-
mask = thres .<= roi
132+
mask = thres .< roi
133133

134134
idx2d = findall(mask) # 2D indices
135135
pos = (v -> [x_grid[v[1]], y_grid[v[2]]]).(idx2d)
@@ -235,21 +235,7 @@ function LevelSetGridNormal(
235235
N::Int = 10000,
236236
)
237237
#
238-
239-
# select the support from raw data
240-
roi = data .- level
241-
# make Gaussian
242-
roi .^= 2
243-
roi .*= 0.5 / (sigma^2)
244-
roi .-= sigma_scale^2
245-
roi .*= -1
246-
# truncate sigma_scale*sigma below zero
247-
# h = heatmap; z = measurement
248-
# l = 1/2 (h-z/σ)^2
249-
# masked_roi = 0 .< κ^2 - l
250-
251238
hgd = HeatmapGridDensity(data, domain, hint_callback, bw_factor; N = N)
252-
253239
return LevelSetGridNormal(level, sigma, float(sigma_scale), hgd)
254240
end
255241

0 commit comments

Comments
 (0)