OpenGATE / Gate

Official public repository of Gate
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
234 stars 263 forks source link

HU to material/density conversion needs to be more robust #178

Open djboersma opened 6 years ago

djboersma commented 6 years ago

When an input CT image has CT values out of the range of the Schneider table then Gate just crashes with an error. Normal behavior in a commercial Treatment Planning System is to truncate the HU values to a reasonable range.

We should do such a truncation also in Gate. Issue a warning about the number of out-of-range HU values. If we want to be really nice and careful then we could define a configurable threshold for the fraction of out of range voxels, if that threshold is exceeded then Gate still terminates with an error.

I am working on implementing this. Should be easy.

BishopWolf commented 5 years ago

If you want to make this change, please also consider adding start-end boundaries per range in the Materials Table, current behaviour is to read a Densities Table getting the initial value of next range as the end value of current which is a mistake since it artificially modifies density out of range. It also creates a separate HU2Mat table which is (initHu endHu matName). It is better to combine both tables into one as: initHu endHu matDescription matName initDens endDens ... ... ... ... I proposed this change in a pull request that was denied since it would modify too much the behaviour and it is too much intrusive for users. initDens corresponds to initHu (endDens -> endHu) for that material. But current behaviour (Hu matDescription matName) and separatedly (Hu dens) is not at all optimal since even when my comment (use dens as the density corresponding to that Hu) was included in wiki, many users still use density as the material density. This creates an artificial overestimation of density.