-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add initial support for the DICOM format #21385
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
Changes from all commits
46f1b29
31f13c2
b588776
22319a1
09b9d08
2d31ca7
79f2544
d8e1b2d
f08ae16
24b2355
a156850
8c812e1
bcf27d7
1842d52
4c76831
6e0d82a
fadcf16
2f95de3
259af30
4483514
7f297f0
0b91971
32e21b3
017babf
09d6b2f
c0282e2
e020ad9
57970fc
b143d8f
e917233
75df743
21a1e08
96db3d0
af80ed8
b9f7d1f
2ef61f4
aced46f
96a647c
2c50f81
569174b
9042ad8
3d60cd6
11cf6fd
486e55e
c0f025b
28e3b1c
ca43aed
26bece8
1d7a944
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../test-data/highdicom/ct_image.dcm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../test-data/highdicom/seg_image_ct_binary.dcm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../test-data/highdicom/sm_image.dcm |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe move the dataset into https://github.com/galaxyproject/galaxy-test-data then we can keep the license file there and not pollute the repo here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, test data from that repo is not accessible within unit tests. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Copyright 2020 MGH Computational Pathology | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling this won't work for larger files where the image is larger than the
contents_header_bytes.Maybe you can use the
@disable_parent_class_sniffingdecorator fromlib/galaxy/datatypes/sniff.pyand restore the previoussniffmethod?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it (see kostrykin#4), but when I put the
@disable_parent_class_sniffingdecorator on theOMETiffclass, thesniffmethod does not get called. The decorator seems to disable sniffing.The
test/unit/data/datatypes/test_images.py::test_ome_tiff_snifffails withDespite that
OMETiff.sniffis implemented asthus,
OMETiff.sniffis not called when the@disable_parent_class_sniffingdecorator is in place.Here is the error from running the test: https://github.com/kostrykin/galaxy/actions/runs/19942920690/job/57185121231?pr=4#step:8:11238
That said, I think the current solution should work, because
tifffile.TiffFileonly reads the headers/metadata of the file. The pixel content only is read when the corresponding methods are used (they are not used here).On the other hand, since we do not know how large metadata can be, or how it is organized, if there is a possibility to get this working without
sniff_prefix, I'd go for that.