OpenGATE / Gate

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

Hounsfield density interpolation question #37

Open BishopWolf opened 9 years ago

BishopWolf commented 9 years ago

I have a question regarding how hounsfield density interpolation is actually implemented.

Current implementation expects user to gave the initial density for material, then Gate calculates following densities to reach the following material density. However, what users often have is not the initial density but the average density for material. So using the above procedure will raise in using those materials with densities higher than it is expected.

I have tried unsuccesfully to correct this behaviour but is quite difficult because of some mathematical complications: Let's take the following materials air: density 1e-3 g/cm3 lung: 8e-1 g/cm3 muscle: 1.04 g/cm3 soft_tissue: 1.04 g/cm3 bone: 1.92 g/cm3

So if we use current implementation we will obtain air materials from 1e-3 to 8e-1 g/cm3, lungs from 8e-1 to 1.04 and so on.

Using a correction new left bound densities would be: newD = oldD - 0.5*DDiff; but this way is also wrong because it would underestimate the mean: the example occurs for material muscle

So my question is what is wrong with the following code???

// This procedure is to put read densities as mean density for selected material
//FIXME: Current implementation underestimate the mean density
void GateHounsfieldDensityTable::RecalculateDensities()
{
    for (unsigned int i= 1; i<mD.size()-1; ++i)
       mD[i]-=0.5*(mD[i+1] - mD[i]);
}
BishopWolf commented 9 years ago

To explain my point an example is the best.

Let's take the following materials with the following ranges

air: density 1e-3 g/cm3; HU range -1000, -800 lung: 8e-1 g/cm3; -800, -300 muscle: 1.04 g/cm3; -300, -40 soft_tissue: 1.04 g/cm3; -40, 200 bone: 1.92 g/cm3; 200, 3091

Right now the code splits these materials into

-1000 -800 Air_0 -800 -383 Lung_1 -383 -300 Lung_2 -300 -40 Muscle_3 -40 -12 Tissue_Soft_4 -12 15 Tissue_Soft_5 15 43 Tissue_Soft_6 43 71 Tissue_Soft_7 71 99 Tissue_Soft_8 99 127 Tissue_Soft_9 127 155 Tissue_Soft_10 155 183 Tissue_Soft_11 183 200 Tissue_Soft_12 200 472 Bone_13 472 745 Bone_14 745 1018 Bone_15 1018 1290 Bone_16 1290 1563 Bone_17 1563 1836 Bone_18 1836 2109 Bone_19 2109 2381 Bone_20 2381 2654 Bone_21 2654 2927 Bone_22 2927 3091 Bone_23 3091 3092 Bone_24

This is ok, but let's take a look to densities

Air_0: d=1.205 mg/cm3; n=4; Lung_1: d=970 mg/cm3; n=13; Lung_2: d=1.03 g/cm3 ; n=13; Muscle_3: d=1.05 g/cm3 ; n=9; Tissue_Soft_4: d=1.11 g/cm3 ; n=9; Tissue_Soft_5: d=1.21 g/cm3 ; n=9; Tissue_Soft_6: d=1.31 g/cm3 ; n=9; ..... Tissue_Soft_11: d=1.81 g/cm3 ; n=9; Tissue_Soft_12: d=1.89 g/cm3 ; n=9; Bone_13: d=1.97 g/cm3 ; n=8; Bone_14: d=2.07 g/cm3 ; n=8; ... Bone_23: d=2.95 g/cm3 ; n=8; Bone_24: d=2.98 g/cm3 ; n=8;

Please compare these values to the reference densities for these materials stated before and you will see my point

example Soft_Tissue: reference density 1.06 (accordingly to a reference I have) and Gate splits this material in the range 1.11 to 1.89 g/cm3, so this behaviour overestimate the density.