Histogram-matching with threshold



Hello,

I am trying to perform histogram-matching on medical images. I'd like
to ignore the background (dark) voxels, possibly with the use of an
intensity threshold.

Any help with this would be greatly appreciated.
.