Skip to content

Commit

Permalink
Replace Requires with ext/
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffFessler committed Jan 2, 2024
1 parent 9d01fed commit 5f315fe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
15 changes: 10 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name = "ImageGeoms"
uuid = "9ee76f2b-840d-4475-b6d6-e485c9297852"
authors = ["Jeff Fessler <[email protected]> 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"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ see the

### Compatibility

Tested with Julia ≥ 1.8.
Tested with Julia ≥ 1.10.

<!-- URLs -->
[action-img]: https://github.com/JuliaImageRecon/ImageGeoms.jl/workflows/CI/badge.svg
Expand Down
13 changes: 7 additions & 6 deletions src/jim.jl → ext/ImageGeoms_MIRTjim.jl
Original file line number Diff line number Diff line change
@@ -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...) =
Expand All @@ -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
7 changes: 0 additions & 7 deletions src/ImageGeoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Module for describing image geometries.
"""
module ImageGeoms

using Requires: @require

const RealU = Number # Union{Real, Unitful.Length}

"""
Expand All @@ -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
4 changes: 2 additions & 2 deletions src/mask.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 5f315fe

Please sign in to comment.