Skip to content

Infinity value not parsed correctly in headless mode #111

Description

@Chenchao-is-CC

Hello,
First, I want to sincerely thank you for developing and maintaining this great utility — it has been extremely helpful, especially when working with large datasets.

Recently, I’ve been running it in headless mode to automatically crop datasets and save them in another image format such as .nrrd. The cropping works correctly in the GUI mode, but when running headlessly, the script fails to handle the value "Infinity". Specifically, the error occurs because Java attempts to execute Long.parseLong("Infinity") which throws a NumberFormatException.

As a temporary workaround, I replaced "Infinity" with a large number (for example, 9999999) that exceeds the z-stack depth, and it works fine. However, since N5-Utils can already read the dataset’s metadata, I wonder if there could be a strategy to automatically resolve "Infinity" to the actual dataset bounds during parsing.

This issue seems to stem from the parseCropParameters() function, where "Infinity" is not handled gracefully in headless mode. I just wanted to share this error message in case it helps improve robustness in future updates.

Lastly, thank you again for your excellent work. The N5/Zarr formats have made large-scale image processing much more manageable. However, since Zarr v3 currently does not support the N5 store, it can sometimes be inconvenient when working across environments that require Zarr v3 for compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions