Test images
MartaCT.CTTestImages.ImageParams
— Typestruct ImageParams{T}
Hold information to construct the input test image.
MartaCT.CTTestImages.ImageParams
— MethodImageParams([T=Float32]; <keyword arguments>) where {T}
Construct ImageParams object.
Arguments:
width=200
: width of the rectangle gray scale image.height=40
: height of the rectangle gray scale image.pad=30
: padding around image.dist=10
: distance between images.radius=20
: radius of calibration circle.gray_scale=1000..1000
: interval of gray scale values.calibration_value=nothing
: value of the calibration circle. If not specified, isgray_scale[2]
.background=nothing
: value to be used as background.hounsfield=false
: whether the gray scale should be in Hounsfield units.
MartaCT.CTTestImages.background_position
— Functionbackground_position(imp::AbstractImageParams)
Return suitable position to calibrate background.
MartaCT.CTTestImages.calibration_position
— Functioncalibration_position(imp::AbstractImageParams)
Get the position for calibration (max value).
MartaCT.CTTestImages.circle_image
— Functioncircle_image(imp::AbstractImageParams)
Create a square image with a circle of given value from parameters imp
.
MartaCT.CTTestImages.circle_image
— Methodcircle_image([T=Float32]; radius=20, value=1) where {T}
Create a square image with a circle of given value.
Examples
julia> circle_image(30, 0.8)
30×30 Array{Float32,2}:
[...]
See also: gray_scale_image
, combine_images
MartaCT.CTTestImages.circle_polar_image
— Methodcircle_polar_image([T=Float32] nr, nϕ, radius; value=1) where {T}
Create a circle of radius radius
inside a nr×nϕ
image in polar coordinates .
Examples
julia> circle_polar_image(30, 30, 10)
30×30 Array{Float32,2}:
[...]
MartaCT.CTTestImages.circle_position
— Functioncircle_position(imp::AbstractImageParams)
Return circle position inside image given image parameters.
MartaCT.CTTestImages.combine_images
— Methodcombine_images(imp::ImageParams{T}, rect::AbstractMatrix{T}, circle::AbstractMatrix{T}) where {T}
Helper function to create a gray scale image.
Combine the rect
image with the circle
image for calibration. The circle image should be smaller than the gray scale image!
See also: gray_scale_image
, circle_image
MartaCT.CTTestImages.create_image
— Methodcreate_image(par::ImageParams)
Create gray scale image.
MartaCT.CTTestImages.create_pyramid_image
— Methodcreate_pyramid_image(par::ImageParams)
Create pyramid gray scale image.
MartaCT.CTTestImages.gray_scale_image
— Methodgray_scale_image(imp::ImageParams)
Create an image with a gray scale rectangle with given scale gray_scale from parameters imp
.
MartaCT.CTTestImages.gray_scale_image
— Methodgray_scale_image(
[T=Float32];
rows=40,
cols=200,
swidth=nothing,
sheight=nothing,
gray_scale=-1000..1000,
) where {T}
Create an image with a gray scale rectangle with given scale gray_scale.
Examples
julia> gray_scale_image(swidth=80, sheight=40, gray_scale=-1000..1000)
40×80 Array{Float32,2}:
[...]
See also: circle_image
, combine_images
MartaCT.CTTestImages.gray_scale_indices
— Methodgray_scale_indices(imp::ImageParams)
Return a tuple (row, column_range)
where row
is the row index of the scale and column_range
is the range of columns.
MartaCT.CTTestImages.pyramid_gray_scale_image
— Methodpyramid_gray_scale_image(imp::ImageParams)
Create an image with a pyramid gray scale rectangle with given scale gray_scale from parameters imp
.
Create an image with a pyramid gray scale rectangle with given scale gray_scale from parameters imp
.
MartaCT.CTTestImages.pyramid_gray_scale_image
— Methodpyramidgrayscaleimage([T=Float32]; swidth=200, sheight=40, grayscale=0..1, plateau = 0) where {T}
Create an image with a pyramid gray scale rectangle with given scale grayscale. The plateau
parameter denotes the percentage of the rectangle width that has the maximum value of `grayscale`.
Examples
julia> pyramid_gray_scale_image(swidth=80, sheight=40, gray_scale=-1000..1000)
40×80 Array{Float32,2}:
[...]
See also: gray_scale_image
, circle_image
, combine_images
MartaCT.CTTestImages.square_image
— Methodsquare_image([T=Float32] r, c; l=nothing) where {T}
Create a l×l
square inside a r×c
image.
Examples
julia> square_image(30, 30; l=10)
30×30 Array{Float32,2}:
[...]
MartaCT.CTTestImages.square_position
— Methodsquare_position(imp::SquareParams)
Return square position inside image given image parameters.