Adjust window/level of the image

Hello, I want to change the window/level of the portal image to make it looks similar to the DRR image. Is there useful tools in ITK to achieve it? Or what can I do to make it?
The portal image and the DRR image are attached below:


the DRR image


the portal image

You could use ShiftScale filter to achieve W/L transformation. Then search for parameters which get you close to the desired result. Before attempting to write any code, I suggest you use 3D Slicer to experiment, both to see whether this would work at all, and if so what would be a good window and level.

Hello @suzume,

Based on how the DRR looks I suspect the problem is not with the visualization of the DRR (solvable with Window-Level) but with the DRR image itself.

The RayCastInterpolateImageFunction has a SetThreshold method which causes the interpolator to ignore voxels below this threshold, so you are only integrating boney structures and ignoring the soft tissue. Likely this is the reason for the significant difference between the DRR and actual x-ray image.

1 Like

Thanks for your reply! You are right; the DRR image is generated using the RayCastInterpolateImageFunction and the soft tissue is ignored. Is there a way to make the portal image also ignore the soft tissue?

Thanks for your reply! I try to change the window and level of the portal image in 3D slicer. The result is attached below:


What I want is that the portal image ignores the soft tissue and only leaves the boney structures visible. Changing the window and level of the portal image seems not to satisfy my need.

Hello @suzume,

The portal image is physical reality, the interaction between x-rays and the imaged object/person. You cannot really control this after the image was acquired. During imaging you can control this via the kv setting. Read more about the principles behind EPID here.

1 Like

Thank you very much!