diff --git a/Project.toml b/Project.toml index 2165f60..f2db444 100644 --- a/Project.toml +++ b/Project.toml @@ -1,15 +1,20 @@ name = "ImageGeoms" uuid = "9ee76f2b-840d-4475-b6d6-e485c9297852" authors = ["Jeff Fessler and contributors"] -version = "0.10" +version = "0.10.1" [deps] FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" LazyGrids = "7031d0ef-c40d-4431-b2f8-61a8d2f650db" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" [compat] -FillArrays = "0.13, 1" +FillArrays = "1" LazyGrids = "0.4, 0.5" -Requires = "1.3" -julia = "1.8" +MIRTjim = "0.23" +julia = "1.10" + +[weakdeps] +MIRTjim = "170b2178-6dee-4cb0-8729-b3e8b57834cc" + +[extensions] +ImageGeoms_MIRTjim = "MIRTjim" diff --git a/README.md b/README.md index c3e0e3f..058fa2a 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ see the ### Compatibility -Tested with Julia ≥ 1.8. +Tested with Julia ≥ 1.10. [action-img]: https://github.com/JuliaImageRecon/ImageGeoms.jl/workflows/CI/badge.svg diff --git a/docs/lit/examples/2-mask.jl b/docs/lit/examples/2-mask.jl index ddd6465..383cfc6 100644 --- a/docs/lit/examples/2-mask.jl +++ b/docs/lit/examples/2-mask.jl @@ -12,10 +12,10 @@ This page explains the `mask` aspects of the Julia package # Packages needed here. -using MIRTjim: jim, prompt # must be first! using ImageGeoms: ImageGeom, MaskCircle, MaskAllButEdge -using ImageGeoms: maskit, embed, embed!, getindex!, jim #, size +using ImageGeoms: maskit, embed, embed!, getindex! # +jim +size using ImageGeoms: mask_outline +using MIRTjim: jim, prompt using Unitful: mm diff --git a/src/jim.jl b/ext/ImageGeoms_MIRTjim.jl similarity index 69% rename from src/jim.jl rename to ext/ImageGeoms_MIRTjim.jl index 524e000..8460286 100644 --- a/src/jim.jl +++ b/ext/ImageGeoms_MIRTjim.jl @@ -1,15 +1,14 @@ -# jim.jl +# ImageGeoms_MIRTjim.jl -import .MIRTjim: jim +module ImageGeoms_MIRTjim -#using ImageGeoms: ImageGeom - -export jim +using ImageGeoms: ImageGeom, axis, mask_or +import MIRTjim: jim """ jim(ig ; kwargs...) -Display the support mask. +Display the support mask (2D) or `mask_or` (3D). Requires package `MIRTjim` to be loaded first. """ jim(ig::ImageGeom{2} ; kwargs...) = @@ -18,3 +17,5 @@ jim(ig::ImageGeom{3} ; kwargs...) = jim(axis(ig,1), axis(ig,2), mask_or(ig.mask) ; title = "(dx,dy,dz)=$(ig.deltas)", kwargs...) jim(ig::ImageGeom ; kwargs...) = throw("unsupported $(typeof(ig))") + +end # module diff --git a/src/ImageGeoms.jl b/src/ImageGeoms.jl index de00718..2e9d0c0 100644 --- a/src/ImageGeoms.jl +++ b/src/ImageGeoms.jl @@ -4,8 +4,6 @@ Module for describing image geometries. """ module ImageGeoms -using Requires: @require - const RealU = Number # Union{Real, Unitful.Length} """ @@ -26,9 +24,4 @@ include("imresize.jl") include("makemask.jl") include("mask.jl") -function __init__() - # support MIRTjim iff user has loaded it - @require MIRTjim = "170b2178-6dee-4cb0-8729-b3e8b57834cc" include("jim.jl") -end - end # module diff --git a/src/mask.jl b/src/mask.jl index d6020a6..1945f7e 100644 --- a/src/mask.jl +++ b/src/mask.jl @@ -89,11 +89,11 @@ embed(v::AbstractVector{T}, mask::AbstractArray{Bool} ; array = embed(matrix::AbstractMatrix{<:Number}, mask::AbstractArray{Bool}) Embed each column of `matrix` into `mask` then `cat` along next dimension -In: +# In: * `matrix [count(mask) L]` * `mask [(N)]` -Out: +# Out: * `array [(N) L]` """ function embed(x::AbstractMatrix{<:Number}, mask::AbstractArray{Bool})