Skip to content

Commit

Permalink
add parameter to phase-based-masking
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbinian Eckstein committed Jul 6, 2022
1 parent 80454b1 commit 3545d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MriResearchTools"
uuid = "557dad86-b9bd-4533-8525-1a39684d020f"
authors = ["Korbinian Eckstein"]
version = "1.0.0"
version = "1.0.1"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
4 changes: 2 additions & 2 deletions src/masking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ Original MATLAB algorithm:
PB=imclose(PB,se);
mask{2}=round(imopen(PB,se));
"""
function phase_based_mask(phase; filter=true)
function phase_based_mask(phase; filter=true, threshold=1.0)
strel = sphere(6, ndims(phase))
laplacian = imfilter(sign.(phase), Kernel.Laplacian(1:ndims(phase), ndims(phase)))
test = imfilter(abs.(laplacian), strel)
PB = test .< (500 * 6)
PB = test .< (500 * 6 * threshold)
if filter
PB = LocalFilters.closing(PB, strel)
PB = LocalFilters.opening(PB, strel)
Expand Down

2 comments on commit 3545d04

@korbinian90
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/64007

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" 3545d04500b56a611edcd302bbc344e68b5bfb70
git push origin v1.0.1

Please sign in to comment.