Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with 2D pyramid generator from single image #29

Open
liuji1031 opened this issue Jan 29, 2025 · 0 comments
Open

Bug with 2D pyramid generator from single image #29

liuji1031 opened this issue Jan 29, 2025 · 0 comments

Comments

@liuji1031
Copy link

Description

A TypeError is encountered when generating a 2D image pyramid from a single image.

Console output

python produce_error.py
Traceback (most recent call last):
  File "/home/ji-liu/Axle/image-tools/formats/pyramid-generator-2d-tool/produce_error.py", line 20, in <module>
    pg.generate_from_single_image(
  File "/home/ji-liu/Axle/image-tools/formats/pyramid-generator-2d-tool/venv/lib/python3.9/site-packages/argolid/pyramid_generator.py", line 43, in generate_from_single_image
    for c, ds in ds_dict:
TypeError: cannot unpack non-iterable int object

Files

The error stems from here. It should probably be "ds_dict.items()".

To Reproduce

The following code snippet reproduces 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 = 256
out_format = "NG_Zarr"
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,
    )
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

No branches or pull requests

1 participant