from ij import IJ # Open an image file img = IJ.openImage("path/to/image.tif") # Set minimum and maximum display values img.setMinAndMax(img.getMin(), img.getMax()) # Display the image img.show()
from ij import IJ # Open an image file img = IJ.openImage("path/to/image.tif") # Stretch the contrast img.setMinAndMax(0, 500) # Display the image img.show()Package library: ImageJ is a Java-based image processing and analysis package. The setMinAndMax method and other related functions are part of the IJ Python scripting library, which provides a way to access ImageJ functions from within a Python environment.