AFL.automation.shared.samplecells#
Geometry and diagnostic plotting for shared sample-cell image pipelines.
Classes
|
Provide circular ROI, RGB, background, and turbidity processing. |
|
Describe the circular optical region of a neutron sample cell. |
|
PurePath subclass that can make system calls. |
|
Base interface for sample-cell image geometry. |
|
Describe the rectangular body of an upright cylindrical screw-cap vial. |
- class AFL.automation.shared.samplecells.SampleCell(overrides=None, **config)[source]#
Base interface for sample-cell image geometry.
Sample-cell configuration deliberately lives on the cell instead of on a camera or instrument driver. Subclasses should implement
extract_sample_image(); they may reuse the image-processing helpers inherited fromImageProcessing.- defaults = {}#
- save_geometry_plot(raw_image, sample_image, *, save_path, filename, title='Detected sample-cell region', color_order='RGB', overlay_mask=None, show_full_image_axes=True, full_image_x_label='px', full_image_y_label='py')[source]#
Save a reusable full-frame and extracted-region diagnostic plot.
A crop rectangle and circular outline are drawn when the corresponding metadata is present, so subclasses with non-circular geometry can use this routine without supplying neutron-cell-specific fields.
- class AFL.automation.shared.samplecells.NeutronSampleCell(overrides=None, **config)[source]#
Describe the circular optical region of a neutron sample cell.
This is deliberately not a
Driver. Instrument drivers hold a sample-cell instance so its crop, circular ROI, and geometry configuration remain independent of camera acquisition and measurement settings.- geometry_defaults = {'col_crop': [0, 479], 'hough_radii': 98, 'row_crop': [0, 479]}#
- defaults = {'col_crop': [0, 479], 'hough_radii': 98, 'row_crop': [0, 479]}#
- class AFL.automation.shared.samplecells.ScrewCapVial(overrides=None, **config)[source]#
Describe the rectangular body of an upright cylindrical screw-cap vial.
The configured row and column bounds first isolate the complete vial. A band at the top of that crop is then excluded from the sample mask so the screw cap does not contribute to image measurements.
cap_heightmay be supplied in pixels for a calibrated camera; otherwisecap_height_fractionis used relative to the cropped image height.- geometry_defaults = {'cap_height': None, 'cap_height_fraction': 0.2, 'col_crop': [0, 479], 'row_crop': [0, 479]}#
- defaults = {'cap_height': None, 'cap_height_fraction': 0.2, 'col_crop': [0, 479], 'row_crop': [0, 479]}#