Hi,
I am trying to write a macro to analyse tiff stack dual channel files in a same folder.
From one channel I would like to get the number of objects (stainned cells); from the other one the total volume of all the objects (all cells stainned with generic stainning)
I am trying to use “3d simple segmentation”. The loop is working fine exepted when no GFP cells are found in the image (and that can happen…). It stop working when there are no objects found and teh command Ext.Manager3D_AddImage() is run
I have then this error and that in the log:
Adding image : min-max 2147483647 0
and in the console i have this exeption:
Exception in thread "Thread-82" java.lang.NegativeArraySizeException
at mcib_plugins.tools.RoiManager3D_2.addImage(RoiManager3D_2.java:1516)
at mcib_plugins.tools.RoiManager3D_2.lambda$buttonAddImageActionPerformed$3(RoiManager3D_2.java:1281)
at java.lang.Thread.run(Thread.java:748)
I hope somebody knows how to manage this kind of error. (like if no image then nb=0)
Thanks in advance for your help
cheers
Here is a part of my code
dir=getDirectory("Choose a Directory");
print(dir);
list = getFileList(dir);
// select measurments in Manager3D Options, select Plugins/Record to record
run("3D Manager Options", "volume integrated_density distance_between_centers=10 distance_max_contact=1.80 drawing=Contour");
// run the manager 3D
run("3D Manager");
for (i=0; i<list.length; i++) {
if (endsWith(list[i], ".tif")){
print(i + ": " + dir+list[i]);
open(dir+list[i]);
imgName=getTitle();
baseNameEnd=indexOf(imgName, ".tif");
baseName=substring(imgName, 0, baseNameEnd);
run("Split Channels");
//count GFP cells
selectWindow("C1-"+imgName);
run("3D Simple Segmentation", "low_threshold=30 min_size=50 max_size=-1");
//add image to 3D roi manager
Ext.Manager3D_SelectAll();
Ext.Manager3D_Delete();
Ext.Manager3D_AddImage();
// if list is not visible please refresh list by using Deselect
Ext.Manager3D_Select(0);
Ext.Manager3D_DeselectAll();
// number of results, and arrays to store results
Ext.Manager3D_Count(nb);
}}