FillHoles produces unexpected results different from documentation?
See original GitHub issueDescribe 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:
- Created 9 months ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
a channel dim is needed
closing this for now, but please help raise a pull request to improve the documentation if you are interested…
three channels? I don’t understand this question, do you mean number of dimensions?