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

Dicom importer should modify the imported pixel data if DICOM tags specify this #10

Open
jmsmkn opened this issue Mar 8, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jmsmkn
Copy link
Member

jmsmkn commented Mar 8, 2021

See comic/grand-challenge.org#1140

@pkcakeout
Copy link
Member

Just on technical aspect to this. If we apply these during import, we can actually loose data when the voxel type that we write images as does not support a good enough resolution of the rescaled voxel value space. Example:

Input image type: int8 - contains value 3
Rescale Intercept: 0
Rescale Slope: 0.1 (I _think_ that float is supported here, but not sure - there are other scenarios with different values that we could think off to work purely in the int domain, but they are more complicated)
Target image type: any integer

If we pick an int datatype as target type, then we will loose a bunch of rounded off values that happen during the application of the slope/intercept. Converting everything to float is not a solution either, because some use the integer values to distinguish between classes of data, which does not translate well to floating point values.

I personally, do not like the Rescale-values in DICOM as well because it tends to complicate the interpretation of voxel data quite abit, but they are 100% supported in ITK, and if we pre-apply this, we need to be sure that the consequence, which is potential loss of data, is acceptable to us.

@jmsmkn
Copy link
Member Author

jmsmkn commented Mar 8, 2021

The RescaleSlope and Intercept modifiers have been being applied for the past year (comic/grand-challenge.org#1175). However, if they are applied then we switch to float, otherwise shorts are used covering the data class use case (comic/grand-challenge.org#1244).

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

No branches or pull requests

2 participants