Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
82cac5e
Epson V700 Scanner: Replace deprecated skimage.io with imageio.v3
lanery May 8, 2026
2d16f8c
Epson V700 Scanner: Add plate detection and rename TIFFToJPEGConverte…
lanery May 9, 2026
0015ec5
Epson V700 Scanner: Review fixes for plate detection pipeline
lanery May 9, 2026
88e4a74
Make detect_plates an instance method
lanery May 11, 2026
9221dd3
Epson V700 Scanner: Clean up TiffProcessor API and edge cases
lanery May 11, 2026
b320b28
Epson V700 Scanner: Add colony detection and phenotyping pipeline
lanery May 11, 2026
8245899
Epson V700 Scanner: Add colony overlay visualization and CSV export
lanery May 11, 2026
ce086b7
Epson V700 Scanner: Draw colony contours on the main export JPEG
lanery May 11, 2026
8fe5c8e
Epson V700 Scanner: Use fixed pixel margin for colony detection crop
lanery May 11, 2026
198a3c5
Epson V700 Scanner: Source colony margin from single constant
lanery May 11, 2026
ec96c3f
Epson V700 Scanner: Use 99.5th percentile for colony presence check
lanery May 11, 2026
265793b
Epson V700 Scanner: Replace Gaussian smoothing with Difference-of-Gau…
lanery May 11, 2026
f60d136
Update colony_detection.py
lanery May 11, 2026
9b07bab
Fix colony detection tests broken by MARGIN_PX increase to 200
lanery May 11, 2026
4e9b9b5
Update colony_detection.py
lanery May 11, 2026
e2222a2
Update image_processing.py
lanery May 15, 2026
c9d5bf7
Colony detection: switch to physical units (mm) and collect RGB
lanery May 18, 2026
9464bf3
Colony detection: exclude border-touching colonies via clear_border
lanery May 18, 2026
1aa24f3
Revert "Colony detection: exclude border-touching colonies via clear_…
lanery May 18, 2026
57764a6
Colony detection: remove border-touching colonies with clear_border
lanery May 18, 2026
501fffb
Return cleaned mask from measure_colonies for contour overlay
lanery May 18, 2026
6d2f51a
Refactor colony overlay from contour drawing to labeled bounding boxes
lanery May 18, 2026
dad1f82
Colony detection: discard colonies smaller than 0.05 mm²
lanery May 18, 2026
26b3a53
Hide colony labels when plate has >300 colonies to reduce clutter
lanery May 18, 2026
84e27f1
Update colony_detection.py
lanery May 18, 2026
c2e93bf
Unify colony detection pipeline into single shared entry point
lanery May 18, 2026
0e3b19e
Merge branch 'staging' into rl/v700-plate-detection
lanery May 18, 2026
13d35e8
Fix RGBA conversion, cache RGB, harden parse_metadata, and add tests
lanery May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions lambda/src/data_hub_lambda/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,49 @@ def hina(file: Path, output_dir: Path | None) -> None:
default=None,
help="Directory for the exported JPG (default: same directory as FILE).",
)
def epson_scanner(file: Path, output_dir: Path | None) -> None:
@click.option(
"--detect-colonies",
is_flag=True,
default=False,
help="Run colony detection and phenotyping on each detected plate.",
)
def epson_scanner(file: Path, output_dir: Path | None, detect_colonies: bool) -> None:
"""Process an Epson V700 Scanner TIFF file.

Resizes the high-resolution scan to a web-friendly JPEG preview and
extracts TIFF metadata.
Detects agar plates inside gold frames, draws bounding-box overlays,
resizes to a web-friendly JPEG preview, and extracts TIFF metadata.
"""
from data_hub_lambda.epson_v700_scanner.image_processing import TIFFToJPEGConverter
from data_hub_lambda.epson_v700_scanner.image_processing import TiffProcessor

converter = TIFFToJPEGConverter(file)
converter.load()
jpg_path = converter.export_jpg()
processor = TiffProcessor(file)
processor.load()

pipeline = None
if detect_colonies:
from data_hub_lambda.epson_v700_scanner.colony_detection import (
export_colony_csv,
run_colony_pipeline,
)

processor.detect_plates()
plate_crops = processor.crop_plates()
if not plate_crops:
click.echo("No plates detected — skipping colony detection.")
else:
pipeline = run_colony_pipeline(plate_crops, dpi=processor.dpi)
for i, result in enumerate(pipeline.results):
click.echo(f"\nPlate {i + 1}:")
click.echo(json.dumps(result.summary(), indent=2))

dest_dir = output_dir or file.parent
dest_dir.mkdir(parents=True, exist_ok=True)
csv_path = dest_dir / f"{file.stem}_colonies.csv"
export_colony_csv(pipeline.to_dataframes(), csv_path)
click.echo(f"\nColony CSV: {csv_path}")

jpg_path = processor.export_jpg(
colony_results=pipeline.results if pipeline else None,
)

if output_dir is not None:
output_dir.mkdir(parents=True, exist_ok=True)
Expand All @@ -124,7 +156,7 @@ def epson_scanner(file: Path, output_dir: Path | None) -> None:

click.echo(f"Exported JPG: {jpg_path}")

metadata = converter.parse_metadata()
metadata = processor.parse_metadata()
click.echo(json.dumps(metadata, indent=2))


Expand Down
Loading