cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

contrast stretching

Open anupamme opened this issue 7 years ago • 3 comments

Hello,

I am interested in implementing the contrast stretching [1] feature on top of cornerstone.

Would you be able to give some high-level guidance on how I can go about doing the same.

Best, Anupam

http://what-when-how.com/embedded-image-processing-on-the-tms320c6000-dsp/contrast-stretching-image-processing/

anupamme avatar Oct 18 '18 06:10 anupamme

Windowing, also known as grey-level mapping, contrast stretching, histogram modification or contrast enhancement

It sounds like "Contrast Stretching" is what is commonly referred to as Window Leveling. This functionality is already supported. You can see a basic example of it in this repository, and as the WW/WC tool in cornerstone-tools.

If I've misunderstood your question, please feel free to continue the discussion.

dannyrb avatar Mar 24 '19 16:03 dannyrb

@dannyrb, Contrast stretching is not the same thing as window leveling. There are different ways to accomplish it. One, way as in the link, to determine the histogram and knock out the statistically bad pixels. In their case they used the data between the 5th and 95th percentiles. Other names I've seen are histogram stretching, histogram equalization, histogram normalization, and histogram flattening. See

  • https://slidetodoc.com/image-enhancement-in-the-spatial-domain-human-vision/
  • https://stackoverflow.com/questions/69595948/how-do-you-normalize-an-image-histogram-stretching-using-image-js-and-javascri

I have to use this technique on my current project because the WW/WC Dicom tags are incorrect.

clairestreb avatar Mar 05 '22 02:03 clairestreb

I appreciate the correction!

dannyrb avatar Mar 05 '22 03:03 dannyrb