Clear Outside Defined Sphere

This workflow illustrates use of a Java Snippet node to perform custom image processing using the ImgLib2 library. For demonstration purposes, the workflow first generates some random image data. The Java Snippet code then clears the image area outside a defined spherical region of interest (ROI) by copying the input image, then iterating over its samples, checking whether each sample lies within the sphere, and if not, setting its value to zero.

This is a companion discussion topic for the original entry at