Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility Query: Using PathML for X-Ray Images with Missing 'TotalPixelMatrixRows' Attribute #401

Open
xinyuejohn opened this issue Dec 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@xinyuejohn
Copy link

xinyuejohn commented Dec 13, 2023

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

  1. Download Data from https://www.visus.com/fileadmin/content/pictures/Downloads/JiveX_DICOME_Viewer/case1.zip (8 MB)
  2. 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'
@xinyuejohn xinyuejohn added the bug Something isn't working label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant