Skip to content

PCNG format not working for 2D pyramid generation from single image #30

@liuji1031

Description

@liuji1031

Description

Error encountered when choosing "PCNG" as the format for generating a 2D pyramid from a single image. The console output suggests it seems related to the size of the image used in this example (376x281) and the chosen min_dim (128).

Console output

python produce_error.py
/project/build/temp.linux-x86_64-cpython-39/_deps/tensorstore-src/tensorstore/util/result.h:666: Status not ok: status(): INVALID_ARGUMENT: Error aligning dimensions: source dimension 0 "x": [0, 376) mismatch with target dimension 0 [0, 281), source dimension 1 "y": [0, 281) mismatch with target dimension 1 [0, 376)
terminate called without an active exception
Aborted (core dumped)

To Reproduce

The following code snippet will reproduce the error.

import requests
from pathlib import Path
from argolid import PyramidGenerartor

path = Path("./data")
path.mkdir(exist_ok=True)
URL = "https://github.com/usnistgov/WIPP/raw/master/data/PyramidBuilding/inputCollection/"
filename = "img_r001_c001.ome.tif"
if not (path / filename).exists():
    content = requests.get(URL + filename, timeout=10.0).content
    (path / filename).open("wb").write(content)

inp_dir = str(path / filename)
out_dir = str(path)
min_dim = 128
out_format = "PCNG"
ds_dict = {0: "mean"}
pg = PyramidGenerartor()
pg.generate_from_single_image(
        input_file=inp_dir,
        output_dir=out_dir,
        min_dim=min_dim,
        vis_type=out_format,
        ds_dict=ds_dict,
    )

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