Skip to content

Commit

Permalink
Add kernel width keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljuerss committed Feb 28, 2024
1 parent 39bd244 commit 7d8a56b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Vessel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ function vesselPhantom(N::NTuple{3,Int}; oversampling=2, rng = GLOBAL_RNG, kargs
obs = [ sphere( Float32.(route[i]), Float32(diameter_route[i]), 1.0f0) for i=eachindex(route) ]
ranges = ntuple(d-> 1:N[d], 3)
img = phantom(ranges..., obs, oversampling)
# filter for smoothing, offset to ensure minimal filter width
filterWidth = (1.0-0.2)*rand(rng) + 0.2
kernelWidth = ntuple(_ -> filterWidth*N[1] / 20, 3)
if isnothing(kernelWidth)
# filter for smoothing, offset to ensure minimal filter width
filterWidth = (1.0-0.3)*rand(rng) + 0.3
kernelWidth = ntuple(_ -> filterWidth*N[1] / 20, 3)
end
img = imfilter(img, Kernel.gaussian(kernelWidth))
img[img .> 1] .= 1
return img
Expand Down

0 comments on commit 7d8a56b

Please sign in to comment.