Handles image output logic: returning, saving to a file, or previewing.
handle_image_output(image, filename = NULL, preview = FALSE)If filename = NULL and preview = FALSE, returns the image array invisibly.
Otherwise, saves to file or displays the image.
3D array. The image data.
Default NULL. String specifying the file path to save the image.
If NULL, the image is returned or displayed.
Default FALSE. If TRUE, the image is displayed.