mcib3d / mcib3d-plugins

ImageJ plugins for 3D processing and analysis
https://imagej.net/3D_ImageJ_Suite
8 stars 9 forks source link

remove objects touching image edges #2

Closed tischi closed 8 years ago

tischi commented 8 years ago

I could not find a function to automatically remove all objects from a label image, which touch the image boundaries. I think this would be very important as in most of the cases such objects need to be discarded from the analysis.

mcib3d commented 8 years ago

Hi,

If you "add a image" into 3Dmanager if there is a ROI, only the objects having centers inside the ROI will be added.

mcib3d commented 8 years ago

Hi,

In 3DManager there is a option "Exclude objects on edges XY" and also "Z". The function is in Object3D

public boolean edgeImage(ImageHandler img, boolean edgeXY, boolean edgeZ)

You also have the function in 3DobjectsPopulation

public void removeObjectsTouchingBorders(ImagePlus img, boolean Z)

tischi commented 8 years ago

Hi, thank you for the answer! I checked the code but I am not sure how to use it for (jython) scripting. right now, I have code up to a point where I obtain a label image (imp_label), which for instance serves as an input to IJ.run(imp_label, "3D Geometrical Measure", ""), is is possible to somehow write a function like this imp_label_no_boundary_objects = remove_boundary_objects_from_label_image(imp_label) ?

mcib3d commented 8 years ago

Hi, Humm I would prefer to add a option to the 3D Analysis plugin like "remove objects on edges", like what we have in 3DManager. Sounds ok for you ?

tischi commented 8 years ago

Hi, I guess the input to this plugin would be a label image and the output would be a label image with the boundary objects removed, right? If so, then yes I think this would be great! In fact this is exactly what i meant to say above.

mcib3d commented 8 years ago

New plugin 3e433ce3b0744670d318c13bf2dbe89a329f65a8