I'm exceptionally new to python/scripting and I'm having a problem. I'm writing the following in Fiji (shortened version of the script is below...)
from ij import IJ, ImagePlus
from java.lang import Runtime, Runnable
import os
filepaths = []
for folder, subs, files in os.walk('location/of/files/'):
for filename in files:
#the next part stops it appending DS files
if not filename.startswith('.'):
filepaths.append(os.path.abspath(os.path.join(folder, filename,)))
for i in filepaths:
IJ.open(i);
IJ.close();
Basically I want to open an image, do stuff, and then close the processed image using IJ.close()
. However it gives the following error:
AttributeError: type object 'ij.IJ' has no attribute 'close'
Any idea how to get around this?
Thanks!