Diameter Analysis¶
Diameter analysis estimates vessel diameter from line scan kymographs using intensity-profile measurements on a rectangular ROI.
Input data¶
Expects a line-scan kymograph. The ROI should cover the spatial region used to estimate vessel width. Diameter is reported in physical units when X calibration is correct (see AcqImage physical units).
Programmatic use¶
from acqstore.acq_image import AcqImage
from acqstore.acq_image.analysis import DiameterAnalysis
from acqstore.sample_data import ensure_sample_file
acq = AcqImage(str(ensure_sample_file('kymograph-diameter')))
channel = acq.images.channel_indices[0]
roi_ids = acq.rois.get_roi_ids()
roi_id = roi_ids[0] if roi_ids else acq.rois.create_rect_roi(name='diameter').roi_id
diameter = acq.analysis_set.create_and_run(
DiameterAnalysis,
channel=channel,
roi_id=roi_id,
detection_params={'diameter_method': 'threshold_width'},
replace_existing=True,
)
print(diameter.result.summary)
acq.save()
Detection parameters¶
Parameters control profile aggregation, polarity, thresholding, gradient-based edge detection, motion gating, and post-filtering.
| name | display_name | type | default | choices | unit | editable | visible | methods | description |
|---|---|---|---|---|---|---|---|---|---|
| window_rows_odd | Window Rows (Odd) | int | 5 | True | True | ('threshold_width', 'gradient_edges') | Odd number of time rows aggregated into each spatial profile. | ||
| stride | Stride | int | 1 | True | True | ('threshold_width', 'gradient_edges') | Center-row increment between successive measurements. | ||
| binning_method | Binning Method | enum | mean | ('mean', 'median') | True | True | ('threshold_width', 'gradient_edges') | Window reducer across rows before edge detection. | |
| polarity | Polarity | enum | bright_on_dark | ('bright_on_dark', 'dark_on_bright') | True | True | ('threshold_width', 'gradient_edges') | Intensity polarity; dark_on_bright inverts the profile. | |
| diameter_method | Detection Method | enum | threshold_width | ('threshold_width', 'gradient_edges') | True | True | Core detector implementation. | ||
| post_filter_kernel_size | Post-Filter Kernel Size | int | 3 | True | True | Odd median kernel applied to diameter after detection. Post-detection smoothing; re-run analysis to apply changes. | |||
| threshold_mode | Threshold Mode | enum | half_max | ('half_max', 'absolute') | True | True | ('threshold_width',) | Threshold rule for threshold_width. | |
| threshold_value | Threshold Value | float | 0.0 | True | True | ('threshold_width',) | Absolute threshold when threshold_mode='absolute'. | ||
| gradient_sigma | Gradient Sigma | float | 1.5 | True | True | ('gradient_edges',) | Gaussian smoothing sigma for gradient edge finding. | ||
| gradient_kernel | Gradient Kernel | enum | central_diff | ('central_diff',) | True | True | ('gradient_edges',) | Derivative kernel for gradient_edges. | |
| gradient_min_edge_strength | Min Edge Strength | float | 0.02 | True | True | ('gradient_edges',) | Minimum derivative magnitude for a confident edge. | ||
| enable_motion_gating | Enable Motion Gating | bool | True | True | True | ('gradient_edges',) | Apply frame-to-frame motion constraints for gradient_edges. | ||
| max_edge_shift_um | Max Edge Shift (um) | float | 2.0 | True | True | ('gradient_edges',) | Maximum allowed per-frame left/right edge shift. | ||
| max_diameter_change_um | Max Diameter Change (um) | float | 2.0 | True | True | ('gradient_edges',) | Maximum allowed per-frame diameter jump. | ||
| max_center_shift_um | Max Center Shift (um) | float | 2.0 | True | True | ('gradient_edges',) | Maximum allowed per-frame center shift. |
Results¶
For a source file my_file.tif:
my_file.tif.json
my_file.tif.diameter.csv
Typical summary fields include diameter_um_mean, diameter_um_median,
diameter_um_cv, num_rows, qc_score_mean, and quality-control violation
counts.
See the Diameter Analysis API and the Diameter Analysis notebook.