add option to allow out-of-bounds HU values #219
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please do not merge this until the questions below are answered.
This patch was made upon user request: CT images often have small
number of voxels with HU values that are way out of the range of the
HLUT, due to image reconstruction artifacts or small metal elements
in the couch. The user would like that GATE automatically clamps the
HU values to the range of the HLUT table, i.e. HU values that are too
large are mapped down to the maximum HU value (or "last" material
in the table) and HU values that are too low are mapped up to the
material with label 0. The patch allows this, if the user provides
a positive value for the fraction of the voxels that is allowed
to be "too large". The idea is that the user should decide whether
the anomalous voxels are irrelevant or that the HU table needs to
be extended.
While implementing this fix I discovered two things that I did not
expect:
the comment "FIXME: remove these two lines". So I removed these two
lines. They add a material to the table for the "outside value".
Apparently this is controversial, so I removed this.
ImageNestedParametrisedVolume
, theLoadImage(bool)
is called with the valuefalse
, which means thatno extra layer of voxels is added. For Regionalized images,
LoadImage
is called with
true
. I'm not sure how to deal with that case.If the "outside" of an image is air or vacuum, then using the lowest
material label for "outside" voxels is probably not very wrong.
But I guess it could also be water? Then it won't work.
Questions: