Hey folks and @haesleinhuepf,
I’m having some issues with the bounding box in the resultsTable output from clij2.statisticsOfLabelledPixels and clij2.statisticsOfBackgroundAndLabelledPixels . On 2D images, such as blobs.gif, I get correct bounding box statistics. On stacks no matter what I do, I always get BOUNDING_BOX_X/Y/Z values of zero. This means the BOUNDING_BOX_WIDTH/HEIGHT/DEPTH values are always just BOUNDING_BOX_END_X/Y/Z +1. I’m pretty sure this isn’t expected behaviour.
Minimal example (edited from a CLIJxAssistant script )
# To make this script run in Fiji, please activate
# the clij and clij2 update sites in your Fiji
# installation. Read more: https://clij.github.io
# Generator version: 0.4.2.18
from ij import IJ
from ij import WindowManager
from net.haesleinhuepf.clij2 import CLIJ2
from ij.measure import ResultsTable
# Init GPU
clij2 = CLIJ2.getInstance()
# Load image from disc
imp = IJ.getImage()
# Push temp1612966471976.tif to GPU memory
image1 = clij2.push(imp);
# Copy
image2 = clij2.create(image1)
clij2.copy(image1, image2)
result = clij2.pull(image2)
result.setDisplayRange(16.0, 248.0)
result.show()
# Gaussian Blur2D
image3 = clij2.create(image2)
sigma_x = 2
sigma_y = 2
clij2.gaussianBlur2D(image2, image3, sigma_x, sigma_y)
image2.close()
result = clij2.pull(image3)
result.setDisplayRange(26.0, 247.0)
result.show()
# Threshold Otsu
image4 = clij2.create(image3)
clij2.thresholdOtsu(image3, image4)
image3.close()
result = clij2.pull(image4)
result.setDisplayRange(0.0, 1.0)
result.show()
# Connected Components Labeling Box
image5 = clij2.create(image4.getDimensions(), clij2.Float )
clij2.connectedComponentsLabelingBox(image4, image5)
image4.close()
results=ResultsTable()
clij2.statisticsOfLabelledPixels(image1, image5, results)
image1.close()
results.show("results")
result = clij2.pull(image5)
result.setDisplayRange(0.0, 61.0)
IJ.run(result, "glasbey_on_dark", "")
result.show()
image5.close()
Thanks!
Jim Rowe