-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Dirac * add dirac3 * refine dirac2 * fix export * test dirc * hide xray1 * hide phantom1 * tests without xray1 phantom1 * v0.4
- Loading branch information
1 parent
2e4071d
commit c7bafc4
Showing
14 changed files
with
333 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "ImagePhantoms" | ||
uuid = "71a99df6-f52c-4da1-bd2a-69d6f37f3252" | ||
authors = ["Jeff Fessler <[email protected]> and contributors"] | ||
version = "0.3.0" | ||
version = "0.4.0" | ||
|
||
[deps] | ||
LazyGrids = "7031d0ef-c40d-4431-b2f8-61a8d2f650db" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ cylinder.jl | |
|
||
|
||
export Cylinder, cylinder | ||
export phantom, radon, spectrum | ||
|
||
|
||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#= | ||
dirac2.jl | ||
=# | ||
|
||
export Dirac2, dirac2 | ||
#export Dirac | ||
|
||
|
||
""" | ||
Dirac{D} <: AbstractShape{D} | ||
""" | ||
struct Dirac{D} <: AbstractShape{D} end | ||
|
||
const Dirac2 = Dirac{2} | ||
|
||
|
||
# constructor | ||
|
||
|
||
""" | ||
dirac2(...) | ||
Construct `Object2d{Dirac2}` from parameters; | ||
here `width` is a scale factor: `δ((x - c)/w) = w * δ(x - c)`. | ||
""" | ||
dirac2(args... ; kwargs...) = Object(Dirac2(), args...; kwargs...) | ||
# dirac(D::Int, args... ; kwargs...) = Object(Dirac{D}(), args...; kwargs...) | ||
|
||
|
||
# methods | ||
|
||
|
||
area1(::Dirac2) = 1 | ||
|
||
ℓmax1(::Dirac) = 1 # max line integral | ||
|
||
|
||
#= | ||
""" | ||
phantom1(ob::Object2d{Dirac2}, (x,y)) | ||
Evaluate Dirac at `(x,y)`, | ||
for unitless coordinates. | ||
Caution: this method is meaningless | ||
because the Dirac impulse is not a function! | ||
""" | ||
phantom1(ob::Object2d{Dirac2}, xy::NTuple{2,Real}) = (xy == (0,0)) ? 1 : 0 | ||
=# | ||
|
||
|
||
#= | ||
""" | ||
xray1(::Dirac2, r::Real, ϕ::RealU) | ||
X-ray transform (line integral) of Dirac. | ||
`r` should be unitless | ||
Caution: this method is meaningless | ||
because the Dirac impulse is not a function! | ||
""" | ||
xray1(::Dirac2, r::Real, ϕ::RealU) = (r == 0) ? 1 : 0 | ||
=# | ||
|
||
|
||
""" | ||
spectrum1(::Object2d{Dirac2}, (kx,ky)) | ||
Spectrum of Dirac2 at `(kx,ky)`, | ||
for unitless spatial frequency coordinates. | ||
""" | ||
spectrum1(::Object2d{Dirac2}, kxy::NTuple{2,Real}) = 1 | ||
#spectrum1(::Object{Dirac, D, V}, kxy::NTuple{D,Real}) where {D, V} = one(V) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#= | ||
dirac3.jl | ||
=# | ||
|
||
export Dirac3, dirac3 | ||
|
||
const Dirac3 = Dirac{3} | ||
|
||
|
||
# constructor | ||
|
||
|
||
""" | ||
dirac3(...) | ||
Construct `Object3d{Dirac3}` from parameters; | ||
here `width` is a scale factor: `δ((x - c)/w) = w * δ(x - c)`. | ||
""" | ||
dirac3(args... ; kwargs...) = Object(Dirac3(), args...; kwargs...) | ||
|
||
|
||
# methods | ||
|
||
|
||
volume1(::Dirac3) = 1 | ||
|
||
# ℓmax1(::Dirac) = 1 # max line integral | ||
|
||
|
||
#= | ||
""" | ||
phantom1(ob::Object3d{Dirac3}, (x,y)) | ||
Evaluate Dirac at `(x,y,z)`, | ||
for unitless coordinates. | ||
Caution: this method is meaningless | ||
because the Dirac impulse is not a function! | ||
""" | ||
phantom1(ob::Object3d{Dirac3}, xyz::NTuple{3,Real}) = (xyz == (0,0,0)) ? 1 : 0 | ||
=# | ||
|
||
|
||
#= | ||
""" | ||
xray1(::Dirac3, r::Real, ϕ::RealU) | ||
X-ray transform (line integral) of Dirac. | ||
`r` should be unitless | ||
Caution: this method is meaningless | ||
because the Dirac impulse is not a function! | ||
""" | ||
xray1(::Dirac3, u::Real, v::Real, ϕ::RealU, θ::RealU) = ((u,v) == (0,0)) ? 1 : 0 | ||
=# | ||
|
||
|
||
""" | ||
spectrum1(::Object3d{Dirac3}, (kx,ky,kz)) | ||
Spectrum of Dirac3 at `(kx,ky,kz)`, | ||
for unitless spatial frequency coordinates. | ||
""" | ||
spectrum1(::Object3d{Dirac3}, kxyz::NTuple{3,Real}) = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c7bafc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator() register
c7bafc4
There was a problem hiding this comment.
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/68567
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: