fepegar / resector

Algorithm to simulate resection surgery on brain MRI scans. Published in MICCAI 2020, extended in IJCARS.
https://doi.org/10.1007/s11548-021-02420-2
MIT License
13 stars 4 forks source link

Traceback error using resect tool #1

Closed GabriellaKamlish closed 4 years ago

GabriellaKamlish commented 4 years ago

Description

Attempted to use resect tool in terminal with inputs imported from a torchIO dataset and received the following error.

What I Did

Input:

resect /Users/gabriellakamlish/.cache/torchio/fpg/t1.nii.gz /Users/gabriellakamlish/.cache/torchio/fpg/t1_seg_gif.nii.gz t1_resected.nii.gz t1_resection_label.nii.gz

Error:

If you use TorchIO for your research, please cite the following paper:
Pérez-García et al., TorchIO: a Python library for efficient loading,
preprocessing, augmentation and patch-based sampling of medical images
in deep learning. Credits instructions: https://torchio.readthedocs.io/#credits

Traceback (most recent call last):                                                         
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/bin/resect", line 33, in <module>
    sys.exit(load_entry_point('resector', 'console_scripts', 'resect')())
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/gabriellakamlish/resector/resector/cli.py", line 46, in main
    resectable = resector.parcellation.get_resectable_hemisphere_mask(
  File "/Users/gabriellakamlish/resector/resector/parcellation.py", line 31, in get_resectable_hemisphere_mask
    mask = sitk.BinaryErode(mask, opening_radius)
  File "/Users/gabriellakamlish/anaconda3/envs/my_env/lib/python3.8/site-packages/SimpleITK/SimpleITK.py", line 7687, in BinaryErode
    return _SimpleITK.BinaryErode(*args, **kwargs)
TypeError: in method 'BinaryErode', argument 2 of type 'std::vector< unsigned int,std::allocator< unsigned int > >'
fepegar commented 4 years ago

Thanks! I've been able to reproduce. I'll investigate this and update you.

fepegar commented 4 years ago

This happens because of the recent update of SimpleITK to 2.0: https://simpleitk.readthedocs.io/en/master/migrationGuide2.0.html#morphology-radius