-
Notifications
You must be signed in to change notification settings - Fork 5
PCNG format not working for 2D pyramid generation from single image #30
Copy link
Copy link
Open
Description
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,
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels