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

Where does the formula for HU to density come from? #129

Open
eigenvivek opened this issue Apr 19, 2024 · 1 comment
Open

Where does the formula for HU to density come from? #129

eigenvivek opened this issue Apr 19, 2024 · 1 comment

Comments

@eigenvivek
Copy link
Contributor

eigenvivek commented Apr 19, 2024

I came across this function in the Volume code and was wondering where the piecewise linear formula came from? A quick lit review turned up a lot of different formulas to convert HU to density, so I was wondering if this function is specific to particular scanner / radiation dose. Thank you!

@staticmethod
def _convert_hounsfield_to_density(hu_values: np.ndarray, smooth_air: bool = False):
# Use two linear interpolations from data: (HU,g/cm^3)
# use for lower HU: density = 0.001029*HU + 1.03
# use for upper HU: density = 0.0005886*HU + 1.03
# set air densities
if smooth_air:
hu_values[hu_values <= -900] = -1000
# hu_values[hu_values > 600] = 5000;
densities = np.maximum(
np.minimum(0.001029 * hu_values + 1.030, 0.0005886 * hu_values + 1.03), 0
)
return densities

@NotF404
Copy link

NotF404 commented May 6, 2024

Have you solved this issue, can you give some info about this formula.

I found that bone and soft tissue dont have enough contrast, when I project spine volume. So I wonder if I cant change this factor to make bone more clear in drr image.

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