Skip to content

Commit

Permalink
Fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Aug 15, 2024
1 parent 76a1eaf commit 9764d53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract type RadonGeometry end
- `N` is the size of the first and second dimension of the input array for `radon`.
- `in_height` is a vector or a range indicating the positions of the detector with respect to the midpoint which is located at `N ÷ 2 + 1`. The rays travel along straight parallel paths through the array.
- `in_height` is a vector or a range indicating the positions of the detector with respect to the midpoint which is located at `N ÷ 2 + 1`. The rays travel along straight parallel paths through the array. Maximum and minimum values are `(N+1) ÷ 2 - 1` and `-(N+1) ÷ 2 + 1` respectively.
For example, for an array of size `N=10` the default definition is: `RadonParallelCircle(10, -4:4)`
So the resulting sinogram has the shape: `(9, length(angles), size(array, 3))`.
Expand All @@ -33,11 +33,13 @@ struct RadonParallelCircle{T, T2} <: RadonGeometry
weights::T2

function RadonParallelCircle(N, in_height)
@assert minimum(in_height) >= -(N+1) ÷ 2 + 1 && maximum(in_height) <= (N+1) ÷ 2 - 1 "The in_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
weights = in_height .* 0 .+ 1
return new{typeof(in_height), typeof(weights)}(N, in_height, weights)
end

function RadonParallelCircle(N, in_height, weights)
@assert minimum(in_height) >= -(N+1) ÷ 2 + 1 && maximum(in_height) <= (N+1) ÷ 2 - 1 "The in_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
return new{typeof(in_height),typeof(weights)}(N, in_height, weights)
end
end
Expand All @@ -47,8 +49,8 @@ end
RadonFlexibleCircle(N, in_height, out_height, weights)
- `N` is the size of the first and second dimension of the input for `radon`.
- `in_height` is a vector or range indicating the vertical positions of the rays entering the circle with respect to the midpoint which is located at `N ÷ 2 + 1`.
- `out_height` is a vector or range indicating the vertical positions of the rays exiting the circle with respect to the midpoint which is located at `N ÷ 2 + 1`.
- `in_height` is a vector or range indicating the vertical positions of the rays entering the circle with respect to the midpoint which is located at `N ÷ 2 + 1`. Maximum and minimum values are `(N+1) ÷ 2 - 1` and `-(N+1) ÷ 2 + 1` respectively.
- `out_height` is a vector or range indicating the vertical positions of the rays exiting the circle with respect to the midpoint which is located at `N ÷ 2 + 1`. Maximum and minimum values are `(N+1) ÷ 2 - 1` and `-(N+1) ÷ 2 + 1` respectively.
One definition could be: `RadonFlexibleCircle(10, -4:4, zeros((9,)))`
Expand All @@ -65,11 +67,15 @@ struct RadonFlexibleCircle{T, T2, T3} <: RadonGeometry
out_height::T2
weights::T3
function RadonFlexibleCircle(N, in_height, out_height)
@assert minimum(in_height) >= -(N+1) ÷ 2 + 1 && maximum(in_height) <= (N+1) ÷ 2 - 1 "The in_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
@assert minimum(out_height) >= -(N+1) ÷ 2 + 1 && maximum(out_height) <= (N+1) ÷ 2 - 1 "The out_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
weights = in_height .* 0 .+ 1
return new{typeof(in_height), typeof(out_height), typeof(weights)}(N, in_height, out_height, weights)
end

function RadonFlexibleCircle(N, in_height, out_height, weights)
@assert minimum(in_height) >= -(N+1) ÷ 2 + 1 && maximum(in_height) <= (N+1) ÷ 2 - 1 "The in_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
@assert minimum(out_height) >= -(N+1) ÷ 2 + 1 && maximum(out_height) <= (N+1) ÷ 2 - 1 "The out_height values are out of bounds. Limits are: $(-(N+1) ÷ 2 + 1) and $((N+1) ÷ 2 - 1)"
return new{typeof(in_height), typeof(out_height), typeof(weights)}(N, in_height, out_height, weights)
end
end

0 comments on commit 9764d53

Please sign in to comment.