tomopy.sim.project
¶
Module for simulation of x-rays.
Functions:
|
Return uniformly distributed projection angles in radian. |
|
Project x-rays through a given 3D object. |
|
Convert fan-beam data to parallel-beam data. |
|
Convert parallel-beam data to fan-beam data. |
|
Add Gaussian noise. |
|
Add Poisson noise. |
|
Add salt and pepper noise. |
|
Add focal spot blur. |
- tomopy.sim.project.add_drift(tomo, amp=0.2, period=50, mean=1)[source]¶
Add illumination drift.
Illumination drift is caused by the beam instability as the object rotates.
This drift is modeled using a sinusoid. Which alters the illumination along the rotation dimension. The vertical dimension is constant.
- Parameters
tomo (ndarray) – 3D tomographic data.
amp (float) – The amplitude of the drift.
period (float) – The period of the drift.
- Returns
ndarray – Tomographic data with zingers added.
- tomopy.sim.project.add_focal_spot_blur(tomo, spotsize)[source]¶
Add focal spot blur.
Warning
Not implemented yet.
- Parameters
tomo (ndarray) – 3D tomographic data.
spotsize (float) – Focal spot size of circular x-ray source.
- tomopy.sim.project.add_gaussian(tomo, mean=0, std=None)[source]¶
Add Gaussian noise.
- Parameters
tomo (ndarray) – 3D tomographic data.
mean (float, optional) – Mean of the Gaussian distribution.
std (float, optional) – Standard deviation of the Gaussian distribution.
- Returns
ndarray – 3D tomographic data after Gaussian noise added.
- tomopy.sim.project.add_poisson(tomo)[source]¶
Add Poisson noise.
- Parameters
tomo (ndarray) – 3D tomographic data.
- Returns
ndarray – 3D tomographic data after Poisson noise added.
- tomopy.sim.project.add_rings(tomo, std=0.05)[source]¶
Add rings.
Rings are caused by inconsistent pixel sensitivity across the detector.
The sensitivity of the pixels is modeled as normally distributed with an average sensitivity of 1 and a standard deviation given.
- Parameters
tomo (ndarray) – 3D tomographic data.
std (float) – The standard deviation of the pixel sensitivity
- Returns
ndarray – Tomographic data with zingers added.
- tomopy.sim.project.add_salt_pepper(tomo, prob=0.01, val=None)[source]¶
Add salt and pepper noise.
- Parameters
tomo (ndarray) – 3D tomographic data.
prob (float, optional) – Independent probability that each element of a pixel might be corrupted by the salt and pepper type noise.
val (float, optional) – Value to be assigned to the corrupted pixels.
- Returns
ndarray – 3D tomographic data after salt and pepper noise added.
- tomopy.sim.project.add_zingers(tomo, f=0.01, sat=65536)[source]¶
Add zingers.
Zingers are caused by stray X-rays hitting the detector and causing pixels to saturate.
The zingers are uniformly distributed across the data set with the given frequency.
- Parameters
tomo (ndarray) – 3D tomographic data.
f (float) – The fraction of measurements that are zingers.
sat (float) – The pixel saturation value.
- Returns
ndarray – Tomographic data with zingers added.
- tomopy.sim.project.angles(nang, ang1=0.0, ang2=180.0)[source]¶
Return uniformly distributed projection angles in radian.
- Parameters
nang (int, optional) – Number of projections.
ang1 (float, optional) – First projection angle in degrees.
ang2 (float, optional) – Last projection angle in degrees.
- Returns
array – Projection angles
- tomopy.sim.project.fan_to_para(tomo, dist, geom)[source]¶
Convert fan-beam data to parallel-beam data.
Warning
Not implemented yet.
- Parameters
tomo (ndarray) – 3D tomographic data.
dist (float) – Distance from fan-beam vertex to rotation center.
geom (str) – Fan beam geometry. ‘arc’ or ‘line’.
- Returns
ndarray – Transformed 3D tomographic data.
- tomopy.sim.project.para_to_fan(tomo, dist, geom)[source]¶
Convert parallel-beam data to fan-beam data.
Warning
Not implemented yet.
- Parameters
tomo (ndarray) – 3D tomographic data.
dist (float) – Distance from fan-beam vertex to rotation center.
geom (str) – Fan beam geometry. ‘arc’ or ‘line’.
- Returns
ndarray – Transformed 3D tomographic data.
- tomopy.sim.project.project(obj, theta, center=None, emission=True, pad=True, sinogram_order=False, ncore=None, nchunk=None)[source]¶
Project x-rays through a given 3D object.
- Parameters
obj (ndarray) – Voxelized 3D object.
theta (array) – Projection angles in radian.
center (array, optional) – Location of rotation axis.
emission (bool, optional) – Determines whether output data is emission or transmission type.
pad (bool, optional) – Determines if the projection image width will be padded or not. If True, then the diagonal length of the object cross-section will be used for the output size of the projection image width.
sinogram_order (bool, optional) – Determines whether output data is a stack of sinograms (True, y-axis first axis) or a stack of radiographs (False, theta first axis).
ncore (int, optional) – Number of cores that will be assigned to jobs.
nchunk (int, optional) – Chunk size for each core.
- Returns
ndarray – 3D tomographic data.
- tomopy.sim.project.project2(objx, objy, theta, center=None, emission=True, pad=True, sinogram_order=False, axis=0, ncore=None, nchunk=None)[source]¶
Project x-rays through a given 3D object.
- Parameters
objx (ndarray) – (x, y) components of vector of a voxelized 3D object.
theta (array) – Projection angles in radian.
center (array, optional) – Location of rotation axis.
emission (bool, optional) – Determines whether output data is emission or transmission type.
pad (bool, optional) – Determines if the projection image width will be padded or not. If True, then the diagonal length of the object cross-section will be used for the output size of the projection image width.
sinogram_order (bool, optional) – Determines whether output data is a stack of sinograms (True, y-axis first axis) or a stack of radiographs (False, theta first axis).
ncore (int, optional) – Number of cores that will be assigned to jobs.
nchunk (int, optional) – Chunk size for each core.
- Returns
ndarray – 3D tomographic data.
- tomopy.sim.project.project3(objx, objy, objz, theta, center=None, emission=True, pad=True, sinogram_order=False, axis=0, ncore=None, nchunk=None)[source]¶
Project x-rays through a given 3D object.
- Parameters
objx (ndarray) – (x, y) components of vector of a voxelized 3D object.
theta (array) – Projection angles in radian.
center (array, optional) – Location of rotation axis.
emission (bool, optional) – Determines whether output data is emission or transmission type.
pad (bool, optional) – Determines if the projection image width will be padded or not. If True, then the diagonal length of the object cross-section will be used for the output size of the projection image width.
sinogram_order (bool, optional) – Determines whether output data is a stack of sinograms (True, y-axis first axis) or a stack of radiographs (False, theta first axis).
ncore (int, optional) – Number of cores that will be assigned to jobs.
nchunk (int, optional) – Chunk size for each core.
- Returns
ndarray – 3D tomographic data.