bactoscoop.plot

Classes and public operations

pick_representative_cell

bactoscoop.plot.pick_representative_cell(image_objects, margin_px=20)

Pick an interior, isolated, median-sized cell with valid geometry.

Parameters:
  • image_objects – Input image_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • margin_px – Input margin_px consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

(winner[0], winner[1])

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 40.

Original docstring (legacy wording may differ from the current signature)
Pick an interior, isolated, median-sized cell with valid geometry.

The rule is deterministic and uses geometry only, never fluorescence intensity.
Returns the image object and cell ID so the same cell can be revisited.

select_example_cell

bactoscoop.plot.select_example_cell(image_objects, field_id=None, cell_id=None)

Choose an existing field/cell, or a representative cell in the chosen field.

Parameters:
  • image_objects – Input image_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • field_id – Shared TIFF field stem before the channel suffix.

  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

Return expressions in source:

pick_representative_cell(objects)
(image, cell_id)

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 98.

Original docstring (legacy wording may differ from the current signature)
Choose an existing field/cell, or a representative cell in the chosen field.

plot_field_channels

bactoscoop.plot.plot_field_channels(dataset_dir, field_id, channel_labels, crop_size=650)

Preview the same pixel window across the named TIFF channels.

Parameters:
  • dataset_dir – Folder containing the channel TIFF files.

  • field_id – Shared TIFF field stem before the channel suffix.

  • channel_labels – Mapping from channel identifiers to human-readable signal labels.

  • crop_size – Displayed crop extent in pixels.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 133.

Original docstring (legacy wording may differ from the current signature)
Preview the same pixel window across the named TIFF channels.

plot_segmentation_review

bactoscoop.plot.plot_segmentation_review(image_objects, crop_size=500, mask_label=None, center=None)

Compare phase and mask outlines in a selectable cell-centered crop.

Parameters:
  • image_objects – Input image_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • crop_size – Displayed crop extent in pixels.

  • mask_label – Input mask_label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • center – Input center consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 160.

Original docstring (legacy wording may differ from the current signature)
Compare phase and mask outlines in a selectable cell-centered crop.

plot_C2_alignment

bactoscoop.plot.plot_C2_alignment(image_object, cell_id, window_px=110, channel='C2', channel_label=None, show_objects=False)

Compare the raw C2 signal with the phase-aligned C2 signal.

Parameters:
  • image_object – Image instance containing the selected field and cells.

  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • window_px – Cell plot window extent in pixels.

  • channel – Channel identifier for the selected signal, or None for phase/morphology where supported.

  • channel_label – Input channel_label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • show_objects – Input show_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 280.

Original docstring (legacy wording may differ from the current signature)
Compare the raw C2 signal with the phase-aligned C2 signal.

BEFORE: original fluorescence image, cropped around the cell.
AFTER:  fluorescence crop returned by u.crop_image(..., phase_img=...).

Cell contours are overlaid using the correct origin for each crop.
Detected object contours can optionally be shown on the aligned panel.

snapshot_cell_contours

bactoscoop.plot.snapshot_cell_contours(image_objects)

Copy cell IDs and contours before curation changes the collection.

Parameters:

image_objects – Input image_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

{image.image_name: {cell.cell_id: np.asarray(cell.contour).copy() for cell in image.cells} for image in image_objects}

View current source, line 430.

Original docstring (legacy wording may differ from the current signature)
Copy cell IDs and contours before curation changes the collection.

plot_curation_review

bactoscoop.plot.plot_curation_review(before_contours, image_objects, crop_size=700)

Show retained cells in green and removed cells in red on phase images.

Parameters:
  • before_contours – Input before_contours consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • image_objects – Input image_objects consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • crop_size – Displayed crop extent in pixels.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 440.

Original docstring (legacy wording may differ from the current signature)
Show retained cells in green and removed cells in red on phase images.

``before_contours`` is made by :func:`snapshot_cell_contours` before
curation. Cells are matched by image name and cell ID.

plot_object_area_vs_cell_area

bactoscoop.plot.plot_object_area_vs_cell_area(features, channel_labels)

Compare detected object area with cell area for each named channel.

Parameters:
  • features – Input features consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • channel_labels – Mapping from channel identifiers to human-readable signal labels.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 611.

Original docstring (legacy wording may differ from the current signature)
Compare detected object area with cell area for each named channel.

plot_feature_overview

bactoscoop.plot.plot_feature_overview(features, signal_column='C4_NC_ratio')

Exploratory overview of cell morphology, constriction, detected objects, and relative signal localization.

Parameters:
  • features – Input features consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • signal_column – Input signal_column consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig
pd.to_numeric(features[column], errors='coerce').to_numpy()
None

View current source, line 640.

Original docstring (legacy wording may differ from the current signature)
Exploratory overview of cell morphology, constriction,
detected objects, and relative signal localization.

C2 = outer membrane
C3 = inner membrane
C4 = RNA
C5 = DAPI

Missing features are indicated in their panels.
Nothing is saved.

plot_feature_histogram

bactoscoop.plot.plot_feature_histogram(df, feature, bins=40, xlabel=None, color='#197E89', figsize=(7, 4.5))

Plot a feature distribution with mean, median and interquartile range.

Parameters:
  • df – DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.

  • feature – Unprefixed shared feature name; corresponding channel-prefixed columns must exist.

  • bins – Input bins consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • xlabel – Input xlabel consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • color – Input color consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • figsize – Input figsize consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 866.

Original docstring (legacy wording may differ from the current signature)
Plot a feature distribution with mean, median and interquartile range.

plot_feature_scatter

bactoscoop.plot.plot_feature_scatter(df, x_feature, y_feature, color_by=None, xlabel=None, ylabel=None, trendline=True, figsize=(7, 5))

Plot two features against each other.

Parameters:
  • df – DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.

  • x_feature – Input x_feature consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • y_feature – Input y_feature consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • color_by – Input color_by consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • xlabel – Input xlabel consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • ylabel – Input ylabel consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • trendline – Input trendline consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • figsize – Input figsize consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 945.

Original docstring (legacy wording may differ from the current signature)
Plot two features against each other.

Optionally colour points by a third numeric feature.
A linear regression line and Pearson correlation can be shown.

plot_contour

bactoscoop.plot.plot_contour(cell_id, image, base_channel=None, verbose=False, add_scalebar=True, scalebar_um=1, um_per_px=0.065, scalebar_color='white', scalebar_lw=6, window_px=None, save_svg_path=None)

Plot the contour of a cell with optional scalebar.

Parameters:
  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • base_channel – Input base_channel consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • add_scalebar – Input add_scalebar consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_um – Input scalebar_um consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • um_per_px – Input um_per_px consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_color – Input scalebar_color consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_lw – Input scalebar_lw consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • window_px – Cell plot window extent in pixels.

  • save_svg_path – Input save_svg_path consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 1059.

Original docstring (legacy wording may differ from the current signature)
Plot the contour of a cell with optional scalebar.

Parameters
----------
window_px : int or None
    If provided, creates a fixed square window (in pixels) centered on the cell.
    If None, tight crop is used (default behavior).

plot_aligned_contours

bactoscoop.plot.plot_aligned_contours(cell_id, image, channel, verbose=False)

Plot the contour of a cell on an image.

Parameters:
  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • image – The image object on which to plot the cell contour.

  • channel – Channel identifier for the selected signal, or None for phase/morphology where supported.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 1360.

Original docstring (legacy wording may differ from the current signature)
Plot the contour of a cell on an image.

This function takes a cell object and an image object and plots the contour of the specified cell on the image.
It also displays the cell ID in the title of the plot.

Parameters
----------
cell : Cell
    The cell object to be plotted.
image : Image
    The image object on which to plot the cell contour.

plot_svm_controls

bactoscoop.plot.plot_svm_controls(frame_cell_pairs, image_objects, message=None)

Plot cells based on frame and cell ID pairs from SVM control analysis.

Parameters:
  • frame_cell_pairs – A list of (cell_id, frame) pairs for cells to be plotted.

  • image_objects – A list of image objects corresponding to the frames in frame_cell_pairs.

  • message – An optional message to be added to the title of the plot.

Returns:

None (no explicit return statement).

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 1400.

Original docstring (legacy wording may differ from the current signature)
Plot cells based on frame and cell ID pairs from SVM control analysis.

This function takes frame and cell ID pairs, along with a list of image objects, and plots the cells from SVM control analysis.
It allows adding an optional message to the title of the plot.

Parameters
----------
frame_cell_pairs : list of tuples
    A list of (cell_id, frame) pairs for cells to be plotted.
image_objects : list
    A list of image objects corresponding to the frames in frame_cell_pairs.
message : str, optional
    An optional message to be added to the title of the plot.

plot_mask

bactoscoop.plot.plot_mask(image_object, joined=False, dpi=400, alpha=0.4)

Plot the mask overlay on an image.

Parameters:
  • image_object – Image instance containing the selected field and cells.

  • joined – Whether to use the joined mask for overlay (default is False).

  • dpi – Dots per inch for the plot (default is 400).

  • alpha – Alpha (transparency) value for the mask overlay (default is 0.4).

Returns:

None (no explicit return statement).

View current source, line 1448.

Original docstring (legacy wording may differ from the current signature)
Plot the mask overlay on an image.

This function takes an image object and optionally a joined mask, and plots the mask overlay on the image.
The alpha parameter controls the transparency of the mask overlay.

Parameters
----------
image_object : Image object
    An image object containing the image and mask data.
joined : bool, optional
    Whether to use the joined mask for overlay (default is False).
dpi : int, optional
    Dots per inch for the plot (default is 400).
alpha : float, optional
    Alpha (transparency) value for the mask overlay (default is 0.4).

plot_random_contours

bactoscoop.plot.plot_random_contours(image, num_cells_to_plot=4, crop_size=200, scalebar=False)

Plot random cell contours within an image.

Parameters:
  • image – An image object containing the image and cell contour data.

  • num_cells_to_plot – Number of random cell contours to plot (default is 4).

  • crop_size – Displayed crop extent in pixels.

  • scalebar – Whether to add a scale bar to the plots (default is False).

Returns:

None (no explicit return statement).

View current source, line 1488.

Original docstring (legacy wording may differ from the current signature)
Plot random cell contours within an image.

This function selects and plots random cell contours within an image, showing a specified number of cells.

Parameters
----------
image : Image object
    An image object containing the image and cell contour data.
num_cells_to_plot : int, optional
    Number of random cell contours to plot (default is 4).
crop_size : int, optional
    Size of the cropped area around each cell (default is 200).
scalebar : bool, optional
    Whether to add a scale bar to the plots (default is False).

Returns
-------
None

plot_random_objects

bactoscoop.plot.plot_random_objects(image, chann, num_objects_to_plot=4, crop_size=300, scalebar=True)

Plot random objects.

Parameters:
  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • chann – Input chann consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • num_objects_to_plot – Input num_objects_to_plot consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • crop_size – Displayed crop extent in pixels.

  • scalebar – Input scalebar consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Returns:

None (no explicit return statement).

View current source, line 1565.

plot_random_axial

bactoscoop.plot.plot_random_axial(feature_dataframe, channels, method, num_objects_to_plot=2)

Plot random axial.

Parameters:
  • feature_dataframe – Input feature_dataframe consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • channels – Requested channel identifiers; for correlation, channel pairs are generated from this sequence.

  • method – Input method consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • num_objects_to_plot – Input num_objects_to_plot consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Returns:

None (no explicit return statement).

View current source, line 1633.

plot_normalized_axial_intensity

bactoscoop.plot.plot_normalized_axial_intensity(feature_dataframe, channels, selected_frame=None, selected_cell_id=None, show=True)

Plot normalized axial profiles for selected cells.

Parameters:
  • feature_dataframe – Input feature_dataframe consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • channels – Requested channel identifiers; for correlation, channel pairs are generated from this sequence.

  • selected_frame – Input selected_frame consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • selected_cell_id – Input selected_cell_id consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • show – Display generated plots when true; check the documented return expression for figures.

Return expressions in source:

figures

Explicitly raised exceptions: ValueError. Errors from called functions can also propagate or be recorded.

View current source, line 1688.

Original docstring (legacy wording may differ from the current signature)
Plot normalized axial profiles for selected cells.

plot_object_mesh

bactoscoop.plot.plot_object_mesh(cell_id, image, chann, verbose=False)

Plot object mesh.

Parameters:
  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • chann – Input chann consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 1728.

plot_object_contours

bactoscoop.plot.plot_object_contours(cell_id, image, contour_channels, shift=False, base_channel=None, verbose=False, add_scalebar=True, scalebar_um=1, um_per_px=0.065, scalebar_color='white', scalebar_lw=8, window_px=None, save_svg_path=None, save_tiff_path=None)

Plot the contours of a cell and its objects for multiple channels on a single base channel image.

Parameters:
  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • contour_channels – Input contour_channels consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • shift – Input shift consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • base_channel – Input base_channel consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • add_scalebar – Input add_scalebar consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_um – Input scalebar_um consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • um_per_px – Input um_per_px consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_color – Input scalebar_color consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • scalebar_lw – Input scalebar_lw consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • window_px – Cell plot window extent in pixels.

  • save_svg_path – Input save_svg_path consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • save_tiff_path – Input save_tiff_path consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 1782.

Original docstring (legacy wording may differ from the current signature)
Plot the contours of a cell and its objects for multiple channels on a single base channel image.

Behaves like your original version:
  - base_channel None -> uses image.image
  - shift True -> crop_image(... phase_img=image.image)
  - else -> crop_image(... phase_img=None)
  - plots cell contour + object contours from cropped_object_contour
  - adds scalebar the same way

Added:
  - window_px: optional fixed square window around cell center (bypasses crop_image).
  - save_svg_path: save editable SVG (scalebar/text/contours editable in Illustrator).

plot_mesh_scientific

bactoscoop.plot.plot_mesh_scientific(cell_id, image, crop_size=300, verbose=False)

Plot mesh scientific.

Parameters:
  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • crop_size – Displayed crop extent in pixels.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 1987.

plot_width

bactoscoop.plot.plot_width(cell, image, crop_size=70)

Plot width.

Parameters:
  • cell – Cell instance containing geometry and measurements.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • crop_size – Displayed crop extent in pixels.

Returns:

None (no explicit return statement).

View current source, line 2037.

plot_signal_profile

bactoscoop.plot.plot_signal_profile(cell, image)

Plot signal profile.

Parameters:
  • cell – Cell instance containing geometry and measurements.

  • image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Returns:

None (no explicit return statement).

View current source, line 2138.

plot_demograph_rotated

bactoscoop.plot.plot_demograph_rotated(cell_lengths, normalized_average_mesh_intensity, title='Demograph Plot', y_label='Normalized Distance From Midcell (µm)', x_label='Cell Length Percentile', cmap='rainbow', cbar_title='DnaN-msfGFP Normalized Intensity')

Plot demograph rotated.

Parameters:
  • cell_lengths – Input cell_lengths consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • normalized_average_mesh_intensity – Input normalized_average_mesh_intensity consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • title – Input title consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • y_label – Input y_label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • x_label – Input x_label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • cmap – Input cmap consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • cbar_title – Input cbar_title consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Returns:

None (no explicit return statement).

View current source, line 2171.

list_field_ids

bactoscoop.plot.list_field_ids(dataset_dir, phase_channel='C1')

List field ids.

Parameters:
  • dataset_dir – Folder containing the channel TIFF files.

  • phase_channel – TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.

Return expressions in source:

sorted({path.stem.rsplit('_', 1)[0] for path in dataset_dir.glob(f'*_{phase_channel}.tiff')})

View current source, line 2225.

plot_multichannel_overview

bactoscoop.plot.plot_multichannel_overview(dataset_dir, field_id, channel_labels, figsize=(14, 3.8))

Return aligned display crops for each channel in a field of view.

Parameters:
  • dataset_dir – Folder containing the channel TIFF files.

  • field_id – Shared TIFF field stem before the channel suffix.

  • channel_labels – Mapping from channel identifiers to human-readable signal labels.

  • figsize – Input figsize consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

fig

View current source, line 2235.

Original docstring (legacy wording may differ from the current signature)
Return aligned display crops for each channel in a field of view.

plot_mesh_overlay

bactoscoop.plot.plot_mesh_overlay(image_object, cell_id, crop_size=150, verbose=False)

Plot mesh overlay.

Parameters:
  • image_object – Image instance containing the selected field and cells.

  • cell_id – Cell identifier local to the selected image; check that it remains after curation/filtering.

  • crop_size – Displayed crop extent in pixels.

  • verbose – Input verbose consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 2244.

pick_detected_cell

bactoscoop.plot.pick_detected_cell(image_object, preferred_channels=('C4', 'C5'))

Choose an interior, isolated cell with a detected object when possible.

Parameters:
  • image_object – Image instance containing the selected field and cells.

  • preferred_channels – Input preferred_channels consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

max(candidates, key=score)[0]
pick_representative_cell([image_object])[1]
(item[2] >= 60, distance / max(item[3], 1), -abs(item[3] - median_length), item[2])

View current source, line 2283.

Original docstring (legacy wording may differ from the current signature)
Choose an interior, isolated cell with a detected object when possible.

plot_morphology_summary

bactoscoop.plot.plot_morphology_summary(df)

Plot morphology summary.

Parameters:

df – DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.

Returns:

None (no explicit return statement).

View current source, line 2315.

plot_signal_summary

bactoscoop.plot.plot_signal_summary(df)

Plot signal summary.

Parameters:

df – DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.

Returns:

None (no explicit return statement).

View current source, line 2356.

plot_pairwise_metric_heatmap

bactoscoop.plot.plot_pairwise_metric_heatmap(df, metric_suffix, channel_order=('C2', 'C3', 'C4', 'C5'))

Plot pairwise metric heatmap.

Parameters:
  • df – DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.

  • metric_suffix – Input metric_suffix consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • channel_order – Input channel_order consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

None

View current source, line 2410.

Internal helpers

_tutorial_contrast

bactoscoop.plot._tutorial_contrast(image)

Return a display range without changing the measured image.

Parameters:

image – Input image consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

(low, high if high > low else low + 1)

View current source, line 27.

Original docstring (legacy wording may differ from the current signature)
Return a display range without changing the measured image.

_tutorial_crop

bactoscoop.plot._tutorial_crop(shape, center, window_px)

tutorial crop.

Parameters:
  • shape – Input shape consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • center – Input center consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

  • window_px – Cell plot window extent in pixels.

Return expressions in source:

(slice(y, min(y + window_px, shape[0])), slice(x, min(x + window_px, shape[1])))

View current source, line 33.

_tutorial_channel_color

bactoscoop.plot._tutorial_channel_color(label)

tutorial channel color.

Parameters:

label – Input label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

'#197E89'
'#1DBCD3'
'#2BAE66'
'#D85755'

View current source, line 115.

_tutorial_channel_cmap

bactoscoop.plot._tutorial_channel_cmap(label)

tutorial channel cmap.

Parameters:

label – Input label consumed by this implementation; its exact use is visible in the linked source below. No maintained parameter description is present in the original docstring.

Return expressions in source:

LinearSegmentedColormap.from_list(f"bactoscoop_{label.replace(' ', '_')}", ['#000000', color])

View current source, line 126.