Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbinian Eckstein committed Jun 16, 2024
1 parent 985a609 commit 63bff64
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/intensitycorrection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function makehomogeneous!(mag; sigma, nbox=15)
if eltype(mag) <: AbstractFloat
mag ./= lowpass
else # Integer doesn't support NaN
lowpass[isnan.(lowpass) .| (lowpass .<= 0)] .= typemax(eltype(lowpass))
lowpass[isnan.(lowpass).|(lowpass.<=0)] .= typemax(eltype(lowpass))
mag .= div.(mag, lowpass ./ 2048) .|> x -> min(x, typemax(eltype(mag)))
end
mag
Expand All @@ -73,6 +73,8 @@ mm_to_vox(mm, pixdim) = mm ./ pixdim
Calculates the bias field using the `boxsegment` approach.
It assumes that there is a "main tissue" that is present in most areas of the object.
If not set, sigma_mm defaults to 7mm, with a maximum of 10% FoV. The sigma_mm value should
correspond to the bias field, for a faster changing bias field this needs to be smaller.
Published in [CLEAR-SWI](https://doi.org/10.1016/j.neuroimage.2021.118175).
See also [`makehomogeneous`](@ref)
Expand All @@ -85,7 +87,7 @@ function getsensitivity(mag, pixdim; sigma_mm=get_default_sigma_mm(mag, pixdim),
end
function getsensitivity(mag; sigma, nbox=15)
# segmentation
firstecho = view(mag,:,:,:,1)
firstecho = view(mag, :, :, :, 1)
mask = robustmask(firstecho)
segmentation = boxsegment(firstecho, mask, nbox)
# smoothing
Expand Down Expand Up @@ -121,7 +123,11 @@ end

#threshold(image) = threshold(image, robustmask(image))
function threshold(image, mask; width=0.1)
m = try quantile(skipmissing(image[mask]), 0.9) catch; 0 end
m = try
quantile(skipmissing(image[mask]), 0.9)
catch
0
end
return ((1 - width) * m .< image .< (1 + width) * m) .& mask
end

Expand Down

2 comments on commit 63bff64

@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/109119

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v3.1.4 -m "<description of version>" 63bff6460f5257c43f16a69c5a03814b3060ad24
git push origin v3.1.4

Please sign in to comment.