Reputation: 21
I need to preprocess some abdominal CT scans in order to segment the spleen. What contrast function do you usually use for soft tissues in abdominal CT scans? I am working in Python and I tried histogram equalization, contrast stretching, but I am not satisfied with the result. I would appreciate any help.
This is an example of how my CT looks like, although there are some CT that looks a little bit different as they have lower quality than this example:
Upvotes: 2
Views: 187
Reputation: 1050
You're looking for an abdominal soft tissue window. Typical values can be found here. If you need a function to window your array data, try this:
import numpy as np
import skimage.exposure
def window(data: np.ndarray, lower: float = -125., upper: float = 225., dtype: str = 'float32') -> np.ndarray:
""" Scales the data between 0..1 based on a window with lower and upper limits as specified. dtype must be a float type.
Default is a soft tissue window ([-125, 225] ≙ W 350, L50).
See https://radiopaedia.org/articles/windowing-ct for common width (WW) and center/level (WL) parameters.
"""
assert 'float' in dtype, 'dtype must be a float type'
clipped = np.clip(data, lower, upper).astype(dtype)
# (do not use in_range='image', since this does not yield the desired result if the min/max values do not reach lower/upper)
return skimage.exposure.rescale_intensity(clipped, in_range=(lower, upper), out_range=(0., 1.))
Upvotes: 1