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

Support Philips DICOMs #576

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcupitt
Copy link
Contributor

@jcupitt jcupitt commented Mar 25, 2024

Philips DICOMs don't crop edge tiles, so we must compute downsample from the pixelspacing tag. Additionally, compute level pixel dimensions from the base levels size and the level downsample.

If pixelspacing is not defined, fall back to using level pixel dimensions.

See ImagingDataCommons/libdicom#79

Philips DICOMs don't crop edge tiles, so we must compute downsample from
the pixelspacing tag. Additionally, compute level pixel dimensions from
the base levels size and the level downsample.

If pixelspacing is not defined, fall back to using level pixel
dimensions.

See ImagingDataCommons/libdicom#79

Signed-off-by: John Cupitt <jcupitt@gmail.com>
@jcupitt jcupitt marked this pull request as draft March 25, 2024 15:16
@openslide-bot
Copy link
Member

DCO signed off ✔️

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

@jcupitt
Copy link
Contributor Author

jcupitt commented Mar 25, 2024

A quick POC hack, so a draft for now.

It seems to work, though we don't actually crop edge tiles, just report a smaller size.

@jcupitt
Copy link
Contributor Author

jcupitt commented Mar 25, 2024

Test Philips DICOM:

ftp://medical.nema.org/MEDICAL/Dicom/DataSets/WG26/WG26Connectathon2023_ECDP/DICOM/Philips/Case-E

With this PR I see:

openslide.level-count: 7
openslide.level[0].downsample: 1
openslide.level[0].height: 55296
openslide.level[0].tile-height: 1024
openslide.level[0].tile-width: 1024
openslide.level[0].width: 104448
openslide.level[1].downsample: 2
openslide.level[1].height: 27648
openslide.level[1].tile-height: 1024
openslide.level[1].tile-width: 1024
openslide.level[1].width: 52224
openslide.level[2].downsample: 4
openslide.level[2].height: 13824
openslide.level[2].tile-height: 1024
openslide.level[2].tile-width: 1024
openslide.level[2].width: 26112
openslide.level[3].downsample: 8
openslide.level[3].height: 6912
openslide.level[3].tile-height: 1024
openslide.level[3].tile-width: 1024
openslide.level[3].width: 13056
openslide.level[4].downsample: 16
openslide.level[4].height: 3456
openslide.level[4].tile-height: 1024
openslide.level[4].tile-width: 1024
openslide.level[4].width: 6528
openslide.level[5].downsample: 32
openslide.level[5].height: 1728
openslide.level[5].tile-height: 1024
openslide.level[5].tile-width: 1024
openslide.level[5].width: 3264
openslide.level[6].downsample: 64
openslide.level[6].height: 864
openslide.level[6].tile-height: 1024
openslide.level[6].tile-width: 1024
openslide.level[6].width: 1632

ie. all the levels are detected, cropped and downsampled correctly. vipsdisp is able to display the image quickly and without rendering errors during zoom.

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

Successfully merging this pull request may close these issues.

None yet

2 participants