Intensities histogram of a segmented area

I’ve also implemented this exact feature - see here: Histogram of volume in regions defined by segments

Probably it is very similar to what @drusmanbashir described above. Main difference is that I used SegmentEditorExtraEffects extension’s Mask Volume effect to do the masking, which is somewhat more complicated, but works even if the segmentation’s master volume is not the same as the volume where you need compute the histograms on. There is also a small difference in the blanking value computation: I retrieve scalar range from the volume and select a blanking value that lies just outside this range; then specify the valid range in np.histogram to make sure the histogram bin distribution is not affected by the blanking value.

1 Like