Python API¶
Main functions¶
gitter: quantify one single-plate imagegitter_batch: quantify many imagesPlateSplitter: detect and extract plates from a multi-plate imageread_results_csv: load CSV outputwrite_results_csv: save CSV outputplot_results: visualize colony metricsplate_warnings: plate-level warningssummary_gitter: summary statistics
gitter(...) always returns a single DataFrame.
It accepts either a file path or an in-memory numpy.ndarray.
Single-image example¶
from gitter_py import gitter, plot_results, plate_warnings
df = gitter(
image_file="examples/extdata/sample.jpg",
plate_format=1536,
verbose="n",
)
print(plate_warnings(df))
fig = plot_results(df, kind="heatmap", title="Sample")
fig.savefig("sample.png", dpi=200)
Multi-plate split example¶
from gitter_py import PlateSplitter, gitter
splitter = PlateSplitter(min_confidence=0.95)
result = splitter.split(
"examples/scanomatic/250417_saltLBtest_35_35_Bran_0060_37101.4909.tiff"
)
splitter.save(result, "split_save")
plate_df = gitter(
image_file="split_save/250417_saltLBtest_35_35_Bran_0060_37101.4909.tiff__plate_01.tiff",
plate_format=1536,
verbose="n",
inverse=True,
autorotate=True,
)
for plate in result.plates:
plate_df = gitter(
image_file=plate.crop,
plate_format=1536,
verbose="n",
inverse=True,
autorotate=True,
)
By default, only detected plates with confidence >= 0.95 are extracted.
If extracted plate crops are portrait-oriented, pass autorotate=True to gitter(...)
to rotate them to landscape before you quantify them.
For scanomatic-style crops, pass inverse=True to gitter(...) when needed.
Useful PlateSplitResult fields include:
platesoverall_confidencedetector_name
Each ExtractedPlate contains:
plate_indexconfidencebboxpolygoncropcrop_rotation_degrees
Batch example¶
from gitter_py import gitter_batch
gitter_batch(
image_files=[
"examples/extdata/sample.jpg",
"examples/extdata/sample_dead.jpg",
],
plate_format=1536,
verbose="n",
)
DataFrame shape¶
Each result row represents one colony position and includes:
rowcolsizecircularityflags
Metadata is available in df.attrs (for example elapsed, format, file).