Skip to content

Conversation

@ddelpiano
Copy link
Member

No description provided.

@ddelpiano ddelpiano requested a review from Copilot January 21, 2026 09:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two converter tools for preparing 3D image data for visualization in Neuroglancer: a TIFF to OME-Zarr converter and an NRRD to Neuroglancer Precomputed converter. Both converters support volumetric data processing, multichannel handling, and mesh generation for segmentation visualization.

Changes:

  • Added TIFF to OME-Zarr converter with multichannel support and diagnostic tools
  • Added NRRD to Precomputed converter with mesh generation and segment property management
  • Included utility scripts for data inspection, validation, and troubleshooting

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
converters/tif_to_omezarr/diagnose_tiff.py Diagnostic tool for visualizing TIFF files and checking for black image issues
converters/tif_to_omezarr/converter.py Main converter for TIFF to OME-Zarr with multichannel support and pyramid generation
converters/tif_to_omezarr/check_tiff_stats.py Utility to inspect TIFF metadata and data statistics
converters/tif_to_omezarr/README.md Documentation for TIFF to OME-Zarr converter usage
converters/nrrd_to_precomputed/meshes_generator_parallel.py Parallel mesh generation for precomputed segmentation volumes
converters/nrrd_to_precomputed/meshes_generator.py Mesh generation with physical coordinate transformation and merging options
converters/nrrd_to_precomputed/merge_segments.py Tool for merging fragmented segments using connected component analysis
converters/nrrd_to_precomputed/inspect_nrrd.py Utility to inspect NRRD file contents and identify segmentation issues
converters/nrrd_to_precomputed/converter.py Main converter for NRRD to Neuroglancer Precomputed format
converters/nrrd_to_precomputed/check_mesh_coords.py Debug tool for verifying mesh and volume coordinate spaces
converters/nrrd_to_precomputed/README.md Documentation for NRRD to Precomputed workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


zarrdir = Path(args.output_zarr_ome_dir)
if zarrdir.suffix != ".zarr":
print("Name of ouput zarr directory must end with '.zarr'")
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'ouput' to 'output'.

Suggested change
print("Name of ouput zarr directory must end with '.zarr'")
print("Name of output zarr directory must end with '.zarr'")

Copilot uses AI. Check for mistakes.
print(f"Successfully wrote {ds_name}")
print(f" Encoding: {encoding}")
print(
f" Compression: {'gzip (. gz files)' if compress else 'none (raw files)'}"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space in '. gz' should be '.gz'.

Suggested change
f" Compression: {'gzip (. gz files)' if compress else 'none (raw files)'}"
f" Compression: {'gzip (.gz files)' if compress else 'none (raw files)'}"

Copilot uses AI. Check for mistakes.
if not is_planar_ome:
if keep_channels:
print("Image is single-channel")
if channel is not None and channel != 0 and not is_planar_ome:
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition not is_planar_ome is checked twice in this block (lines 355 and 358). Consider restructuring to avoid redundancy.

Suggested change
if channel is not None and channel != 0 and not is_planar_ome:
if channel is not None and channel != 0:

Copilot uses AI. Check for mistakes.
Comment on lines +308 to +310
num_workers = min(
4, max(1, cpu_count() - 2)
) # Use max 4 workers, leave 2 cores free
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers 4 and 2 should be defined as named constants for better maintainability.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants