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

Meta data conversion to density #72

Open
wallematthias opened this issue Mar 9, 2023 · 5 comments
Open

Meta data conversion to density #72

wallematthias opened this issue Mar 9, 2023 · 5 comments

Comments

@wallematthias
Copy link

I have a problem converting loaded AIMs to density

after reading an aim file (XCT 1), the image data is in hounsfield units. I seem to be missing the density intercept and density slope. Is there any way these can be added to the meta data? Thank you for your help!

{'CalibrationData': '60kVp, BH: 200 mg HA/ccm, Scaling 8192',
 'CreationDate': 'XXXXXX', #blinded
 'DataRange': (-1314.0, 10451.0),
 'Energy': 59.4,
 'Intensity': 0.9,
 'MeasurementIndex': 0000, #blinded
 'ModificationDate': 'XXXXX', #blinded
 'MuScaling': 8192.0,
 'MuWater': 0.2415,
 'NumberOfProjections': 750,
 'NumberOfSamples': 1536,
 'PatientIndex': 0000, #blinded
 'PatientName': 'XXXXXX', #blinded
 'ReconstructionAlg': 3,
 'ReferenceLine': 0.0,
 'RescaleIntercept': -1000.0,
 'RescaleSlope': 0.505467132505176,
 'RescaleType': 2,
 'RescaleUnits': 'mg HA/ccm',
 'SampleTime': 100.0,
 'ScanDistance': 125.952,
 'ScannerID': 3330,
 'ScannerType': 9,
 'Site': 20,
 'SliceIncrement': 0.0820000022649765,
 'SliceThickness': 0.0820000022649765,
 'Version': 'AIMDATA_V020   ',
 'origin': array([ 0.        , 51.65999985, 46.49399948]),
 'spacing': array([0.082, 0.082, 0.082]),
 'direction': array([[1., 0., 0.],
        [0., 1., 0.],
        [0., 0., 1.]])}
@dzenanz
Copy link
Member

dzenanz commented Mar 9, 2023

Already in metadata?

'RescaleIntercept': -1000.0,
'RescaleSlope': 0.505467132505176,

@wallematthias
Copy link
Author

These seem to be the conversions from raw scanner to hounsfield units, for the density separate conversion factors are required. I am looking for slope and intercept for calibrated mg HA/ccm

@dzenanz
Copy link
Member

dzenanz commented Mar 9, 2023

@mkuczyns do you have some suggestion?

@wallematthias
Copy link
Author

In /src/itkScancoImageIO.cxx it looks like density slope and intercept are being pulled

else if (skey == "Density: slope")
{
this->m_RescaleSlope = strtod(value, nullptr);
}
else if (skey == "Density: intercept")
{
this->m_RescaleIntercept = strtod(value, nullptr);

but then again overwritten later on when the image is read
// This code causes rescaling to Hounsfield units
if (this->m_MuScaling > 1.0 && this->m_MuWater > 0)
{
// mu(voxel) = intensity(voxel) / m_MuScaling
// HU(voxel) = mu(voxel) * 1000/m_MuWater - 1000
// Or, HU(voxel) = intensity(voxel) * (1000 / m_MuWater * m_MuScaling) - 1000
this->m_RescaleSlope = 1000.0 / (this->m_MuWater * this->m_MuScaling);
this->m_RescaleIntercept = -1000.0;
}

@dzenanz
Copy link
Member

dzenanz commented Mar 10, 2023

Then we should introduce new metadata members to hold DensitySlope and DensityIntercept? Could you propose a PR?

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

No branches or pull requests

2 participants