I am new to the use of scripting in ImageJ, and I am facing an issue when trying to load a nd2 file (from Nikon Elements software) with a Python script in ImageJ.
The nd2 file contains a sequence of images for 256 different positions, with 15 time points at each positions, and 3 channels. Each frame is 124x124 pixels.
The file loads fine using the usual “File/Open” in ImageJ, with just an extra window “Bio Format Series Options” popping up to ask me which of the 256 positions I would like to open.
from loci.plugins import BF file = "Z:/case_imagesc/test_1.nd2" imps = BF.openImagePlus(file) print(imps) for imp in imps: imp.show() stack = imp.getImageStack() print 'Number of frames in stack = ', stack.size()
The output of this short script is:
array(ij.ImagePlus, [img[“Z:/case_imagesc/test_1.nd2 - test_1.nd2 (series 001)” (-48), 16-bit, 124x124x3x1x15]])
Number of frames in stack = 45
So it seems that only the first position (series 001) is loaded in the object “imps”. And indeed, the corresponding stack contains only 3x15 frames corresponding to a single position, and the shown images correspond to a single position.
However, I would like to open all the positions into one or separate objects, to be able to apply plugins to all of them (256 positions x 15 time points x 3 channels).
Is there a way to do so?
Thank you for your help!