![fiji imagej fiji imagej](https://i.ytimg.com/vi/WF-WBiafQLA/maxresdefault.jpg)
#Fiji imagej how to
This script demonstrates how to median filter an image using ImageJ’s RankFilters class in Javascript. imp = IJ.getImage() ip = imp.getProcessor() filter = RankFilters() radius = 5 filter.rank(ip, radius, RankFilters.MEDIAN) imp.updateAndDraw() The below script demonstrates how to median filter an image using ImageJ’s RankFilters class. imp = IJ.getImage() ip = imp.getProcessor() width = ip.getWidth() height = ip.getHeight() stats = ip.getStatistics() for y in range(height): IJ.showProgress(y,height-1) for x in range(width): v = ip.getf(x,y) ip.setf(x, y, stats.max-(v-stats.min)) imp.updateAndDraw() The below python script inverts an image. width = height = 1024 ip = ShortProcessor(width,height) for y in range(height): IJ.showProgress(y,height-1) for x in range(width): ip.set(x, y, y) imp = ImagePlus(“Synthetic Image”, ip) imp.show() The below python script creates a synthetic image. imp = IJ.getImage() width = imp.getWidth() height = imp.getHeight() print(“”) print(“title:”, imp.getTitle()) print(“width:”, width) print(“height:”, height) print(“stack size:”, imp.getStackSize()) bitDepth = imp.getBitDepth() type = “RGB” if bitDepth != 24: type = str(bitDepth)+”-bit” print(“type:”, type) composite = imp.isComposite() hyperstack = imp.isHyperStack() print(“composite:”, composite) print(“hyperstack:”, hyperstack) if composite or hyperstack: print(“channels:”, imp.getNChannels()) print(“slices:”, imp.getNSlices()) print(“frames:”, imp.getNFrames()) cal = imp.getCalibration() scaled = cal.scaled() print(“scaled:”, scaled) if scaled: units = cal.units print(“pixel width:”, cal.pixelWidth) print(“pixel height:”, cal.pixelHeight) print(“pixel depth:”, cal.pixelDepth)
![fiji imagej fiji imagej](http://www.microscopist.co.uk/wp-content/uploads/2017/04/ImageJ-guide.jpg)
The python script below will access and show the properties of an image or a stack of images.