Error
- 'Circularity' column not found
Solution
- Look at the ResultsTable column names
- Rename 'Circularity' by 'Circ.'
rt.getValue("Circularity")
becomes
rt.getValue("Circ.")
Error
- ArrayIndexOutOfBoundException
- Trying to access an invalid array index
Solution
- The loop goes from 0 to
nROIsincluded =nROIs+1 iterations - Replace the
<=by<in the for loop
for(int i = 0; i <= rois.length; i++)becomes
for(int i = 0; i < rois.length; i++)Error
- No error message but both output images are the same
Solution
Hint: Use the debugger and add a breakpoint to see the value of the variables
- Have a look to ImageProcessor
ip&ip2objects
imp2.setProcessor(ip);
imp3.setProcessor(ip);
becomes
imp2.setProcessor(ip2);
imp3.setProcessor(ip);
This kind of semantic errors could be avoided by naming variables with meaningful names !
imp2.setProcessor(ip2);
imp3.setProcessor(ip);
should becomes
circularityImp.setProcessor(ip2);
areaImp.setProcessor(ip);
Even better, when duplicate images, give them a meaningful title, by adding
circularityImp.setTitle("Circularity results")
areaImp.setTitle("Area results")