Parameter reference¶
Signature defaults are listed separately from settings chosen in the tutorials. The tables below are generated from the current source. Follow each method link for prerequisites, returned values, side effects, and source evidence.
ImageCollection¶
bactoscoop.imagecollection.ImageCollection
ImageCollection(image_folder_path=None, px=0.065, error_policy='continue', log_cell_errors=False)
image_folder_path— defaultNone. Dataset folder containing TIFFs and the masks subfolder; None delays path configuration.px— default0.065. Micrometres per pixel. Geometry arrays remain in pixel coordinates.error_policy— default'continue'. “continue” records independent item/cell failures; “raise” raises the recorded error. Setup failures can still stop work.log_cell_errors— defaultFalse. Print each recorded cell error when true; recording is independent of this flag.
processing_summary¶
bactoscoop.imagecollection.ImageCollection.processing_summary()
processing_summary()
load_masks¶
bactoscoop.imagecollection.ImageCollection.load_masks()
load_masks()
load_phase_images¶
bactoscoop.imagecollection.ImageCollection.load_phase_images()
load_phase_images(phase_channel='')
phase_channel— default''. TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.
load_channel_images¶
bactoscoop.imagecollection.ImageCollection.load_channel_images()
load_channel_images(channel_list)
channel_list— required. Sequence of channel suffixes to load or attach.
create_image_objects¶
bactoscoop.imagecollection.ImageCollection.create_image_objects()
create_image_objects(phase_channel='')
phase_channel— default''. TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.
add_channels¶
bactoscoop.imagecollection.ImageCollection.add_channels()
add_channels(img_objects, channel_list, load_data=True)
img_objects— required. Image objects to attach channel data to.channel_list— required. Sequence of channel suffixes to load or attach.load_data— defaultTrue. Load channel TIFFs before attaching them when true; false uses already loaded field-keyed data.
get_mesh_dataframe¶
bactoscoop.imagecollection.ImageCollection.get_mesh_dataframe()
get_mesh_dataframe(image_name)
image_name— required. See the linked implementation.
create_image_object¶
bactoscoop.imagecollection.ImageCollection.create_image_object()
create_image_object(image, image_name, index, mask, mesh_df, px)
image— required. See the linked implementation.image_name— required. See the linked implementation.index— required. See the linked implementation.mask— required. See the linked implementation.mesh_df— required. See the linked implementation.px— required. Micrometres per pixel. Geometry arrays remain in pixel coordinates.
segment_images¶
bactoscoop.imagecollection.ImageCollection.segment_images()
segment_images(mask_thresh, minsize, n, model_name='bact_phase_omni')
mask_thresh— required. Threshold passed as Omnipose mask_threshold.minsize— required. Minimum accepted segmentation-mask size in pixels.n— required. Selected image positions; wrapper accepts None for all. Indices must be nonempty, unique valid integers.model_name— default'bact_phase_omni'. Omnipose model identifier; default collection model is bact_phase_omni.
batch_detect_objects¶
bactoscoop.imagecollection.ImageCollection.batch_detect_objects()
batch_detect_objects(channels=None, reset_channels=True, align=False, smoothing=0.1, log_sigma=3, kernel_width=4, min_overlap_ratio=0.01, max_external_ratio=0.1)
channels— defaultNone. Requested channel identifiers; for correlation, channel pairs are generated from this sequence.reset_channels— defaultTrue. Clear loaded channel dictionaries and background/interpolation caches before loading requested channels.align— defaultFalse. Use the object-detection alignment path for the selected signal.smoothing— default0.1. Smoothing passed to the contour/mesh fitting path.log_sigma— default3. Laplacian-of-Gaussian sigma for signal-object detection.kernel_width— default4. Width of the square dilation kernel used for candidate object masks.min_overlap_ratio— default0.01. Minimum accepted overlap ratio under the utility implementation; inspect its denominator in source.max_external_ratio— default0.1. Maximum accepted outside-cell ratio under the utility implementation.
batch_process_mesh¶
bactoscoop.imagecollection.ImageCollection.batch_process_mesh()
batch_process_mesh(pkl_name=None, object_list=None, save_data=True, phase_channel='', join_thresh=4, split_thresh=0.35, CD_width=False, smoothing=0.1, neighbor_filter_max_neighbors=None, neighbor_filter_connectivity=1, max_daughter_cell_mesh_rows=800)
pkl_name— defaultNone. Mesh input filename or pickle output name. For feature output, .pkl means exact filename; a suffixless name is a legacy tag.object_list— defaultNone. Explicit image-object sequence to process; None selects collection targets.save_data— defaultTrue. Write the combined mesh table when true.phase_channel— default''. TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.join_thresh— default4. Maximum pole-to-pole joining distance in pixels.split_thresh— default0.35. Relative constriction threshold used by the splitting pipeline.CD_width— defaultFalse. Use the width-based constriction path when true; otherwise use the pipeline phase-signal path.smoothing— default0.1. Smoothing passed to the contour/mesh fitting path.neighbor_filter_max_neighbors— defaultNone. Maximum number of touching distinct labels allowed before meshing; None disables the prefilter.neighbor_filter_connectivity— default1. 1 or 4 for edge contact; 2 or 8 for edge and diagonal contact.max_daughter_cell_mesh_rows— default800. Maximum rebuilt mesh rows per daughter during cell splitting (default 800; integer >= 4). Rejects oversized predicted counts before reconstruction; both final daughters must have 4..limit rows. Does not limit unsplit parents and is separate from feature extraction max_mesh_size.
batch_load_mesh¶
bactoscoop.imagecollection.ImageCollection.batch_load_mesh()
batch_load_mesh(pkl_name, pkl_path=None, phase_channel='')
pkl_name— required. Mesh input filename or pickle output name. For feature output, .pkl means exact filename; a suffixless name is a legacy tag.pkl_path— defaultNone. Directory containing an input mesh file; None selects the image folder.phase_channel— default''. TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.
batch_mask2mesh¶
bactoscoop.imagecollection.ImageCollection.batch_mask2mesh()
batch_mask2mesh(pkl_name=None, object_list=None, save_data=True, phase_channel='', smoothing=0.1)
pkl_name— defaultNone. Mesh input filename or pickle output name. For feature output, .pkl means exact filename; a suffixless name is a legacy tag.object_list— defaultNone. Explicit image-object sequence to process; None selects collection targets.save_data— defaultTrue. Write the combined mesh table when true.phase_channel— default''. TIFF suffix identifying the phase images, such as “C1”. An empty suffix is the signature default.smoothing— default0.1. Smoothing passed to the contour/mesh fitting path.
batch_shift_correction¶
bactoscoop.imagecollection.ImageCollection.batch_shift_correction()
batch_shift_correction(shifted_channel, reset_channels=False, log_sigma=1.5, kernel_width=3, min_overlap_ratio=0.1, max_external_ratio=1, phase_log_sigma=0.5, phase_closing_level=2, signal_closing_level=12, max_shift_correction=15)
shifted_channel— required. See the linked implementation.reset_channels— defaultFalse. Clear loaded channel dictionaries and background/interpolation caches before loading requested channels.log_sigma— default1.5. Laplacian-of-Gaussian sigma for signal-object detection.kernel_width— default3. Width of the square dilation kernel used for candidate object masks.min_overlap_ratio— default0.1. Minimum accepted overlap ratio under the utility implementation; inspect its denominator in source.max_external_ratio— default1. Maximum accepted outside-cell ratio under the utility implementation.phase_log_sigma— default0.5. See the linked implementation.phase_closing_level— default2. See the linked implementation.signal_closing_level— default12. See the linked implementation.max_shift_correction— default15. See the linked implementation.
batch_calculate_features¶
bactoscoop.imagecollection.ImageCollection.batch_calculate_features()
batch_calculate_features(channel_method_pairs, all_data=True, reset=True, use_shifted_contours=False, shift_signal=False, max_mesh_size=600, retain_contour_on_object_mesh_failure_channels=None)
channel_method_pairs— required. Pairs of (channel list, feature method), for example [([None], “morphological”), ([“C2”], “profiling”)].all_data— defaultTrue. Feature-method-specific option; objects includes detailed per-object arrays when true.reset— defaultTrue. Clear stored feature dataframes when true; false retains other pairs while replacing each recalculated pair.use_shifted_contours— defaultFalse. Select stored shifted contour, midline, and mesh geometry; the correction must already exist.shift_signal— defaultFalse. Enable the method-specific optional signal cropping/shift path; this is not a universal object-coordinate shift.max_mesh_size— default600. Maximum accepted mesh row count; cells above this limit are removed from the image cell population.retain_contour_on_object_mesh_failure_channels— defaultNone. Channels whose object rows keep contour measurements and NaN mesh aggregates when object geometry fails.
batch_calculate_signal_correlation_features¶
bactoscoop.imagecollection.ImageCollection.batch_calculate_signal_correlation_features()
batch_calculate_signal_correlation_features(df, channels, feature_method_tuples)
df— required. DataFrame to inspect, transform, or augment. Correlation mutates it in place and returns it.channels— required. Requested channel identifiers; for correlation, channel pairs are generated from this sequence.feature_method_tuples— required. Pairs of (feature-name list, correlation-selector list) applied to each channel pair.
curate_dataset¶
bactoscoop.imagecollection.ImageCollection.curate_dataset()
curate_dataset(path_to_model, cols=4, control=False, save_curated_data=True)
path_to_model— required. Path to a serialized SVM carrying thefeature_names_in_training-column schema.cols— default4. Legacy curation argument retained for compatibility; unused by the current curation preparation.control— defaultFalse. Request visual examples of retained/rejected classes; random selection can be unavailable for small classes.save_curated_data— defaultTrue. Write curated mesh pickle when true; in-memory curation always occurs.
add_meshdata_to_dataframe¶
bactoscoop.imagecollection.ImageCollection.add_meshdata_to_dataframe()
add_meshdata_to_dataframe()
export_curated_masks¶
bactoscoop.imagecollection.ImageCollection.export_curated_masks()
export_curated_masks(output_subfolder='curated_masks', overwrite=True)
output_subfolder— default'curated_masks'. Destination for newly rasterized curated masks, relative to the dataset folder.overwrite— defaultTrue. Replace existing curated mask TIFFs when true; false raises for a file already present.
merge_dataframes¶
bactoscoop.imagecollection.ImageCollection.merge_dataframes()
merge_dataframes(include_metadata_tag=False, discard_morphological_nan=False)
include_metadata_tag— defaultFalse. Rename identity columns withMetadata_prefixes.discard_morphological_nan— defaultFalse. Drop merged rows missing cell_area or cell_length; these columns must exist.
dataframe_to_pkl¶
bactoscoop.imagecollection.ImageCollection.dataframe_to_pkl()
dataframe_to_pkl(pkl_name=None)
pkl_name— defaultNone. Mesh input filename or pickle output name. For feature output, .pkl means exact filename; a suffixless name is a legacy tag.
meshdata_to_parquet¶
bactoscoop.imagecollection.ImageCollection.meshdata_to_parquet()
meshdata_to_parquet(parquet_name=None)
parquet_name— defaultNone. Output filename ending in .parquet within the image folder; None chooses the dataset-based default.
dataframe_to_parquet¶
bactoscoop.imagecollection.ImageCollection.dataframe_to_parquet()
dataframe_to_parquet(parquet_name=None)
parquet_name— defaultNone. Output filename ending in .parquet within the image folder; None chooses the dataset-based default.