Show segmentation only for specific volumes

Is there a way to programmatically show a segmentation only for some specific volumes in my scene?