Hello together,
I have some problems with my current small plugin in python/jython. I am iterating through all pixels of an given (binary) picture and try to determine the according ROI (if possible) to write a pixel and ROI based value into the results table. Therefore I used the "Set Scale.." and "Analyze Particles..." command, followed by adding three new columns including the column "S-values" to the results table (which works well). For the iteration I add the following code:
imp = IJ.getImage()
ip = imp.getProcessor().convertToFloat()
x = imp.getWidth()
y = imp.getHeight()
...
for j in range(x):
for i in range(y):
for roi in RoiManager.getInstance().getRoisAsArray():
if roi.contains(j, i):
pix_sap = rt.getValue("S-values", 1) #(line 46)
Unfortunatly I get the following exception:
Started IASF5+if.py at Mon Oct 14 15:03:34 CEST 2013
Traceback (most recent call last):
File "<iostream>", line 46, in <module>
at ij.measure.ResultsTable.getValue(ResultsTable.java:342)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Row out of range
Now I am not sure why I get this error here, while rt.getValue worked well some lines before even if I use a constant (here: 1) and not a variable to get the number of the ROI (what would be needed in the end). I would appreciate any help. Thanking you in advance.
Andreas Rzepecki
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html