LabelMap creation from torchio.Image
See original GitHub issue🐛Bug Sorry if I miss something here, but we used to declare LabelMap, from the torchio.Image function
To reproduce
# Your code here
import torchio as tio
sujbad = tio.Image(type=tio.LABEL, path='/mypath/mask.nii.gz')
sujok = tio.LabelMap(path='/mypath/mask.nii.gz')
Expected behavior
I expect those 2 declaration to be equivalent (since the type can be specify in the Image constructor)
Actual behavior
type(sujbad)
torchio.data.image.Image
System info
Output of python <(curl -s https://raw.githubusercontent.com/fepegar/torchio/master/print_system.py)
:
Platform: Linux-4.15.0-139-generic-x86_64-with-glibc2.10
TorchIO: 0.18.39
PyTorch: 1.7.1
NumPy: 1.20.2
Python: 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Image - TorchIO - Read the Docs
An instance of Image can be created using a filepath, a PyTorch tensor, ... The instance of LabelMap contains a brain parcellation of...
Read more >torchio/image.rst at main - GitHub
Subclasses are used to indicate specific types of images, such as :class:`ScalarImage` and :class:`LabelMap`, which are used to store, e.g., CT scans and ......
Read more >TorchIO tutorial.ipynb - Colaboratory - Google Colab
LabelMap . The image class will be used by the transforms to decide whether or not to perform the operation. For example, spatial...
Read more >Using data augmentation to generate new data for deep ...
Contribute to fepegar/SlicerTorchIO development by creating an account on GitHub. ... I exported an image as a volume (.nii) and volume label map...
Read more >TorchIO: A Python library for efficient loading ... - arXiv
and LabelMap, which are used to store, e.g., CT scans and segmentations, respectively. An instance of Image can be created using a filepath, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
At the moment, I’m not sure. I would need to look into it. But please do move to
ScalarImage
, as in the examples and tutorials, as this is now considered the standard way and usingImage
for scalar images will be removed in the future.I understand, that creating a torico.Image with type=‘label’ is not a good idea, (because in other part of the code like for instance https://github.com/fepegar/torchio/blob/af86828360353dbe127d8195567ea4b9e83f238b/torchio/transforms/transform.py#L432, it will not be consider as a LabelMap
but is it also the case for intensity type ? should I also switch
tio.Image(type='intensity', path=path)
totio.ScalarImage(path=path)
will it makes a difference somewhere ?