Retrieving channel Image Processors from Hyperstack
Posted by
Greg on
URL: http://imagej.273.s1.nabble.com/Retrieving-channel-Image-Processors-from-Hyperstack-tp5020342.html
Hello,
I found some odd/surprising behavior when trying to extract the image
processors from a Hyperstack, in jython:
from ij import IJ,ImagePlus
orig = IJ.getImage()
imps = []
for chan in range(1,4):
print chan
orig.setPosition(chan,1,1)
ip = orig.getProcessor()
print ip.getPixel(100,100)
imps.append( ImagePlus(str(chan),ip))
for imp in imps:
ip2 = imp.getProcessor()
print ip2.getPixel(100,100)
imp.show()
With this I get three times exactly the same extracted ImagePlus, as opposed
to the expected three different images: one for each channel. The first
'ip.getPixel' first shows different values indicating that I work indeed on
different processors, the 2nd 'ip2.getPixel' shows that it is the same for
every Image Plus; could that be a jython issue? I attach a minimal example
stack. IPChannelTest.tif
<
http://imagej.1557.x6.nabble.com/file/t380220/IPChannelTest.tif>
Best,
Greg
--
Sent from:
http://imagej.1557.x6.nabble.com/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html