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

How to read a single frame from the Multi frame Dicom file #1263

Closed
AIVinci opened this issue Nov 19, 2020 · 9 comments · Fixed by #1998
Closed

How to read a single frame from the Multi frame Dicom file #1263

AIVinci opened this issue Nov 19, 2020 · 9 comments · Fixed by #1998
Labels

Comments

@AIVinci
Copy link

AIVinci commented Nov 19, 2020

I want to display single frame from multi frame Dicom file. It is huge file (1.4 gb) creating memory error if read as whole.The file is compressed in Jpeg Lossy format.

@darcymason
Copy link
Member

darcymason commented Nov 20, 2020

This has been brought up before, but no solution in pydicom yet - see e.g. #1243, #1035.

@hackermd
Copy link
Contributor

@Alvinci we are currently implementing a high-level interface for reading frames of a multi-frame Part10 file (see highdicom PR). We hope to get all the low-level functions ultimately into the pydicom pixel data handlers.

@hackermd
Copy link
Contributor

@Alvinci this is now available in highdicom (see highdicom.io.ImageFileReader).

@Franka-Med
Copy link

@hackermd Hi, I try to use highdicom. io. ImageFileReader to solve the problem of large file(ultrasound dicom 300+m) read slowly. When I use the example code, this error occurs: 'FileDataset' object has no attribute 'ICCProfile'

from highdicom.io import ImageFileReader
with ImageFileReader(r'C:\Users\UAX\Desktop\test\300m\1.dcm') as image:
print(image.metadata)
for i in range(image.number_of_frames):
frame = image.read_frame(i)
print(frame.shape)

Do you have similar problems? How can I solve it? Thank you~

@hackermd
Copy link
Contributor

hackermd commented Sep 7, 2021

@jnumingdeli we are currently working on including the ImageFileReader in pydicom via #1447. We have removed the image color management from the class, so the error you described should no longer occur.

@Franka-Med
Copy link

@hackermd Thank you very much~ Will this class be added to the next new version of pydicom? When will this feature be available?

@hackermd
Copy link
Contributor

hackermd commented Sep 7, 2021

I defer to @darcymason regarding release milestones and timeline.

@elams18
Copy link

elams18 commented Jan 24, 2022

Hi, are there any updates on this feature? I am working on a problem that requires the same.

@hackermd
Copy link
Contributor

@elams18 The class is currently available in highdicom: https://highdicom.readthedocs.io/en/latest/package.html#highdicom.io.ImageFileReader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants