CHAP.tomo.models
¶
Tomography Pydantic model classes.
Module Contents¶
Classes¶
Detector class to represent the detector used in the experiment. The image origin is assumed to be in the top-left corner, with rows down (-z in lab frame) and columns sideways (+x in lab frame). |
|
Class representing the configuration for the tomography image reduction processor. |
|
Class representing the configuration for the tomography center axis finding processor. |
|
Class representing the configuration for the tomography image reconstruction processor. |
|
Class representing the configuration for the combined tomography stacks processor. |
|
Class representing the configuration for the tomography simulator. |
API¶
- class CHAP.tomo.models.Detector¶
Bases:
pydantic.BaseModel
Detector class to represent the detector used in the experiment. The image origin is assumed to be in the top-left corner, with rows down (-z in lab frame) and columns sideways (+x in lab frame).
- Variables:
prefix – Prefix of the detector in the SPEC file.
rows – Number of pixel rows on the detector.
columns – Number of pixel columns on the detector.
pixel_size – Pixel size of the detector in mm.
lens_magnification – Lens magnification for the detector, defaults to 1.0.
- prefix: constr(strip_whitespace=True, min_length=1)¶
None
- rows: conint(gt=0)¶
None
- columns: conint(gt=0)¶
None
- pixel_size: conlist(item_type=confloat(gt=0, allow_inf_nan=False), min_length=1, max_length=2)¶
None
- lens_magnification: confloat(gt=0, allow_inf_nan=False)¶
1.0
- class CHAP.tomo.models.TomoReduceConfig¶
Bases:
pydantic.BaseModel
Class representing the configuration for the tomography image reduction processor.
- Variables:
img_row_bounds – Detector image bounds in the row-direction (ignored for id1a3 and id3a).
delta_theta – Rotation angle increment in image reduction in degrees.
- img_row_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- delta_theta: Optional[confloat(gt=0, allow_inf_nan=False)]¶
None
- class CHAP.tomo.models.TomoFindCenterConfig¶
Bases:
pydantic.BaseModel
Class representing the configuration for the tomography center axis finding processor.
- Variables:
center_stack_index – Stack index of the tomography set to find the center axis.
center_rows – Row indices for the center finding processor.
center_offsets – Centers at the center finding row indices in pixels.
center_offset_min – Minimum value of center_offset in center axis finding search in pixels.
center_offset_max – Maximum value of center_offset in center axis finding search in pixels.
gaussian_sigma – Standard deviation for the Gaussian filter applied to image reconstruction visualizations, defaults to no filtering performed.
ring_width – Maximum width of rings to be filtered in the image reconstruction in pixels, defaults to no filtering performed.
- center_stack_index: Optional[conint(ge=0)]¶
None
- center_rows: Optional[conlist(item_type=conint(ge=0), min_length=2, max_length=2)]¶
None
- center_offsets: Optional[conlist(item_type=confloat(allow_inf_nan=False), min_length=2, max_length=2)]¶
None
- center_offset_min: Optional[confloat(allow_inf_nan=False)]¶
None
- center_offset_max: Optional[confloat(allow_inf_nan=False)]¶
None
- center_search_range: Optional[conlist(item_type=confloat(allow_inf_nan=False), min_length=1, max_length=3)]¶
None
- gaussian_sigma: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- ring_width: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- class CHAP.tomo.models.TomoReconstructConfig¶
Bases:
pydantic.BaseModel
Class representing the configuration for the tomography image reconstruction processor.
- Variables:
x_bounds – Reconstructed image bounds in the x-direction.
y_bounds – Reconstructed image bounds in the y-direction.
z_bounds – Reconstructed image bounds in the z-direction.
secondary_iters – Number of secondary iterations in the tomopy image reconstruction algorithm, defaults to 0.
gaussian_sigma – Standard deviation for the Gaussian filter applied to image reconstruction visualizations, defaults to no filtering performed.
remove_stripe_sigma – Damping parameter in Fourier space in tomopy’s horizontal stripe removal tool, defaults to no correction performed.
ring_width – Maximum width of rings to be filtered in the image reconstruction in pixels, defaults to no filtering performed.
- x_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- y_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- z_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- secondary_iters: conint(ge=0)¶
0
- gaussian_sigma: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- remove_stripe_sigma: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- ring_width: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- class CHAP.tomo.models.TomoCombineConfig¶
Bases:
pydantic.BaseModel
Class representing the configuration for the combined tomography stacks processor.
- Variables:
x_bounds – Combined image bounds in the x-direction.
y_bounds – Combined image bounds in the y-direction.
z_bounds – Combined image bounds in the z-direction.
- x_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- y_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- z_bounds: Optional[conlist(item_type=conint(ge=-1), min_length=2, max_length=2)]¶
None
- class CHAP.tomo.models.TomoSimConfig¶
Bases:
pydantic.BaseModel
Class representing the configuration for the tomography simulator.
- Variables:
station – The station name (in ‘idxx’ format).
detector – Detector used in the tomography experiment.
sample_type – Sample type for the tomography simulator.
sample_size – Size of each sample dimension in mm (internally converted to an integer number of pixels). Enter three values for sample_type ==
'hollow_pyramid'
, the height and the side at the respective bottom and the top of the pyramid.wall_thickness – Wall thickness for pipe, cube, and brick in mm (internally converted to an integer number of pixels).
mu – Linear attenuation coefficient in mm^-1, defaults to 0.05.
theta_step – Rotation angle increment in the tomography simulation in degrees.
beam_intensity – Initial beam intensity in counts, defaults to 1.e9.
background_intensity – Background intensity in counts, defaults to 20.
slit_size – Vertical beam height in mm, defaults to 1.0.
- station: Literal[id1a3, id3a, id3b]¶
None
- detector: Detector.model_construct()¶
None
- sample_type: Literal[square_rod, square_pipe, hollow_cube, hollow_brick, hollow_pyramid]¶
None
- sample_size: conlist(item_type=confloat(gt=0, allow_inf_nan=False), min_length=1, max_length=3)¶
None
- wall_thickness: Optional[confloat(ge=0, allow_inf_nan=False)]¶
None
- mu: Optional[confloat(gt=0, allow_inf_nan=False)]¶
0.05
- theta_step: confloat(gt=0, allow_inf_nan=False)¶
None
- beam_intensity: Optional[confloat(gt=0, allow_inf_nan=False)]¶
1000000000.0
- background_intensity: Optional[confloat(gt=0, allow_inf_nan=False)]¶
20
- slit_size: Optional[confloat(gt=0, allow_inf_nan=False)]¶
1.0