-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I was trying to load a chest X-ray image in DICOM format, but encountered an error. It seems my DICOM file lacks an attribute called 'TotalPixelMatrixRows,' which is part of the DICOM Whole Slide Microscopy Image Module (for more information, see: https://dicom.innolitics.com/ciods/vl-whole-slide-microscopy-image/whole-slide-microscopy-image/00480007).
Since PathML is primarily used for cell images captured by microscopy, I'm curious to know if it can also handle other types of medical images, such as X-ray images. Could you please advise on this?
To Reproduce
- Download Data from https://www.visus.com/fileadmin/content/pictures/Downloads/JiveX_DICOME_Viewer/case1.zip (8 MB)
- Read data
from pathml.core import HESlide
my_dcm_image = HESlide("case1/case1_008.dcm", backend = "DICOM")
Traceback
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-15-a1c013ee4f14> in <cell line: 1>()
----> 1 my_dcm_image = HESlide("./data/case1_008.dcm", backend = "DICOM")
3 frames
/usr/local/lib/python3.10/dist-packages/pathml/core/slide_data.py in __init__(self, *args, **kwargs)
510 def __init__(self, *args, **kwargs):
511 kwargs["slide_type"] = pathml.core.types.HE
--> 512 super().__init__(*args, **kwargs)
513
514
/usr/local/lib/python3.10/dist-packages/pathml/core/slide_data.py in __init__(self, filepath, name, masks, tiles, labels, backend, slide_type, stain, platform, tma, rgb, volumetric, time_series, counts, dtype)
166 backend_obj = pathml.core.BioFormatsBackend(filepath, dtype)
167 elif backend.lower() == "dicom":
--> 168 backend_obj = pathml.core.DICOMBackend(filepath)
169 elif backend.lower() == "h5path":
170 backend_obj = None
/usr/local/lib/python3.10/dist-packages/pathml/core/slide_backends.py in __init__(self, filename)
643 # can use frame shape, total shape to map between frame index and coords
644 self.frame_shape = (metadata.Rows, metadata.Columns)
--> 645 self.shape = (metadata.TotalPixelMatrixRows, metadata.TotalPixelMatrixColumns)
646 self.n_frames = int(metadata.NumberOfFrames)
647 # use ceiling division to account for padding (i.e. still count incomplete frames on edge)
/usr/local/lib/python3.10/dist-packages/pydicom/dataset.py in __getattr__(self, name)
906 return {}
907 # Try the base class attribute getter (fix for issue 332)
--> 908 return object.__getattribute__(self, name)
909
910 @property
AttributeError: 'FileDataset' object has no attribute 'TotalPixelMatrixRows'
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working