clij / clij2

GPU-accelerated image processing for everyone
https://clij.github.io/clij2
Other
48 stars 14 forks source link

generate parametric image output image issue #53

Closed biovoxxel closed 2 years ago

biovoxxel commented 2 years ago

generate parametric image from vector or results table column has the description of label image and vector inverted and the destination image is not created correctly but would rather need to be created as a copy of the input label image.

The following IJ macro should show that issue:

run("Set Measurements...", "area mean standard modal min centroid center perimeter bounding fit shape feret's integrated median skewness kurtosis area_fraction stack display redirect=None decimal=3");
run("Blobs (25K)");
setOption("BlackBackground", true);
run("Convert to Mask");
blobs = getTitle();
run("Analyze Particles...", "display clear");

run("CLIJ2 Macro Extensions", "device=");
Ext.CLIJ2_clear();

Ext.CLIJ2_push(blobs);
ccl = "connected_components_labeling";
Ext.CLIJ2_connectedComponentsLabelingDiamond(blobs, ccl);

//columName = getString("Column", "Perimeter");
columName = "Perim.";
columnContent = Table.getColumn(columName);
vectorArray = Array.concat(0,columnContent);

newImage("Vector_" + columName, "32-bit black", vectorArray.length, 1, 1);
vector = getTitle();

for (i = 0; i < vectorArray.length; i++) {
    setPixel(i, 0, vectorArray[i]);
}
resetMinAndMax;

Ext.CLIJ2_push(vector);

destination = "destination";
Ext.CLIJ2_generateParametricImage(ccl, vector, destination);

Ext.CLIJ2_pull(destination);