question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FillHoles produces unexpected results different from documentation?

See original GitHub issue

Describe the bug FillHoles produces unexpected results different from documentation:

To Reproduce Steps to reproduce the behavior:

    test_image_docu = np.array(
        [
            [1, 1, 1, 2, 2, 2, 3, 3],
            [1, 0, 1, 2, 0, 0, 3, 0],
            [1, 1, 1, 2, 2, 2, 3, 3],
        ]
    )
    print(test_image_docu)
    print(test_image_docu.shape)

    applied_labels = tuple(np.unique(test_image_docu[test_image_docu != 0]))

    hole_fill_tfs = Compose(
        [
            FillHoles(
                # applied_labels=applied_labels,
            ),
        ]
    )
    # print(np.unique(test_image))
    filled = np.array(hole_fill_tfs(test_image_docu))
    print(filled)

other test image with unexpected results:

    test_image = np.array(
        [
            [0, 0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 2, 2, 2, 3, 3],
            [0, 1, 1, 1, 2, 2, 2, 3, 3],
            [0, 1, 0, 1, 2, 0, 2, 3, 0],
            [0, 1, 1, 1, 2, 2, 2, 3, 3],
            [0, 1, 1, 1, 2, 2, 2, 3, 3],
            [0, 0, 0, 0, 0, 0, 0, 0, 0],
        ]
    )

Expected behavior A clear and concise description of what you expected to happen.

I expect it to follow the documentation

Screenshots If applicable, add screenshots to help explain your problem.

[[1 1 1 2 2 2 3 3]
 [1 0 1 2 0 0 3 0]
 [1 1 1 2 2 2 3 3]]

[[1 1 1 2 2 2 3 3]
 [1 1 1 1 1 1 1 0]
 [1 1 1 1 1 1 1 1]]

Environment

================================ Printing MONAI config…

MONAI version: 1.1.dev2250 Numpy version: 1.23.5 Pytorch version: 1.13.0+cu117 MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False MONAI rev id: 1d25ea145532319feb57647797ed3a8c2e7e9eb4 MONAI file: /home/florian/miniconda3/envs/emcaps/lib/python3.10/site-packages/monai/init.py

Optional dependencies: Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION. Nibabel version: 4.0.2 scikit-image version: 0.19.3 Pillow version: 9.3.0 Tensorboard version: 2.11.0 gdown version: 4.5.4 TorchVision version: NOT INSTALLED or UNKNOWN VERSION. tqdm version: 4.64.1 lmdb version: NOT INSTALLED or UNKNOWN VERSION. psutil version: 5.9.4 pandas version: 1.5.1 einops version: NOT INSTALLED or UNKNOWN VERSION. transformers version: NOT INSTALLED or UNKNOWN VERSION. mlflow version: NOT INSTALLED or UNKNOWN VERSION. pynrrd version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit: https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies

================================ Printing system config…

System: Linux Linux version: Ubuntu 20.04.5 LTS Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.31 Processor: x86_64 Machine: x86_64 Python version: 3.10.8 Process name: python Command: [‘python’, ‘-c’, ‘import monai; monai.config.print_debug_info()’] Open files: [popenfile(path=‘/home/florian/.vscode-server/data/logs/20221214T205439/remoteagent.log’, fd=19, position=2685, mode=‘a’, flags=33793), popenfile(path=‘/home/florian/.vscode-server/data/logs/20221214T205439/ptyhost.log’, fd=20, position=7104, mode=‘a’, flags=33793)] Num physical CPUs: 16 Num logical CPUs: 32 Num usable CPUs: 32 CPU usage (%): [9.8, 12.7, 9.7, 3.9, 7.9, 9.7, 8.7, 8.8, 7.9, 9.7, 8.8, 8.8, 99.0, 9.7, 9.7, 8.8, 10.6, 8.8, 9.8, 8.7, 9.7, 7.9, 100.0, 7.9, 15.7, 8.9, 8.8, 7.8, 9.7, 9.7, 7.9, 7.9] CPU freq. (MHz): 2095 Load avg. in last 1, 5, 15 mins (%): [5.8, 5.5, 12.7] Disk usage (%): 39.7 Avg. sensor temp. (Celsius): UNKNOWN for given OS Total physical memory (GB): 125.7 Available memory (GB): 118.4 Used memory (GB): 6.1

================================ Printing GPU config…

Num GPUs: 2 Has CUDA: True CUDA version: 11.7 cuDNN enabled: True cuDNN version: 8500 Current device: 0 Library compiled for CUDA architectures: [‘sm_37’, ‘sm_50’, ‘sm_60’, ‘sm_70’, ‘sm_75’, ‘sm_80’, ‘sm_86’] GPU 0 Name: NVIDIA RTX A5000 GPU 0 Is integrated: False GPU 0 Is multi GPU board: False GPU 0 Multi processor count: 64 GPU 0 Total memory (GB): 23.7 GPU 0 CUDA capability (maj.min): 8.6 GPU 1 Name: Quadro RTX 8000 GPU 1 Is integrated: False GPU 1 Is multi GPU board: False GPU 1 Multi processor count: 72 GPU 1 Total memory (GB): 47.5 GPU 1 CUDA capability (maj.min): 7.5

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wylicommented, Dec 15, 2022

a channel dim is needed

filled = np.array(hole_fill_tfs(test_image_docu[None])) 

closing this for now, but please help raise a pull request to improve the documentation if you are interested…

1reaction
wylicommented, Dec 16, 2022

Should this also throw an error/warning if fewer than three channels are supplied?

three channels? I don’t understand this question, do you mean number of dimensions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected Results of Degree Versus Kind—A Hair-Splitting ...
Evidence that the claimed invention yields an unexpectedly improved property or a property not present in the prior art may not be enough....
Read more >
37 CFR 1.132 Affidavits or declarations traversing rejections ...
Evidence of unexpected results must be weighed against evidence supporting prima facie obviousness in making a final determination of the obviousness of the ......
Read more >
Autodesk Maya Online Help: Troubleshoot hardware shadows ...
Troubleshoot hardware shadows produce unexpected results · Troubleshoot lights don't cast shadows · Troubleshoot shadows flicker over animations.
Read more >
ImageJ User Guide - IJ 1.46r | Process Menu - NIH
Generates a one pixel wide outline of foreground objects in a binary image. The line is drawn inside the object, i.e., on previous...
Read more >
rasterio Documentation - Read the Docs
disclaimer in the documentation and/or other materials provided with the ... Some formats are known to produce invalid results using the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found