if you are dealing with
ImgLabelings labeling in general and / or BigDataViewer or related viewers, have a look at the newest baby of the JugLab, the LabelEditor, and let us know what you think!
- update site: https://sites.imagej.net/LabelEditor
- github: https://github.com/juglab/LabelEditor
<dependency> <groupId>sc.fiji</groupId> <artifactId>labeleditor</artifactId> <version>0.5.1</version> </dependency>
Here are some technical details about the content of the repo:
The heart of this project is a mechanism to tag any label of an
ImgLabeling instance with tags. A tag is of type Object so it can be anything. One can assign colors to a tag. Renderers implementing
LabelEditorRenderer will be discovered via the SciJava Plugin mechanism and translate an
ImgLabeling into a
RandomAccessibleInterval<ARGBType> with reference to the assigned tags and tag colors. Viewers are represented as
LabelEditorInterfaces, so BDV is not baked into it.
This includes a face and a border renderer, the BDV interface bridge, the right click menu, a bunch of behaviours to deal with labels and tags, two different selection modes (the default one and a conflict mode where only labels which are in conflict with the focused one get deselected), and a model where each time slice is handled individually (crucial for bigger data).
See the usage post for more details and images.
There is also a BVV branch including the plugins to create a
LabelEditorBvvPanel which works rudimentarily.
Here lives the Objects Counter (see usage post).
This namespace contains the displays to be able to show an
ImgLabeling or a
LabelEditorModel with the LabelEditor via
ImgLabeling labeling = ij.op().labeling().cca( binary, ConnectedComponents.StructuringElement.EIGHT_CONNECTED); ij.ui().show(labeling);
I had to change the namespace so that the DefaultImageDisplay would not be chosen first and fail to display it. I will look into how to improve this (I don’t think the plugin priorities are used here).
The Objects Counter is calling two commands in a row - to not have multiple windows opening in between the workflow asking for input parameters, I made an
ImageWorkflowCommand which runs the commands first on a small part of the input image, collects the panels for harvesting the inputs and displays them in a joint window. It keeps the parameter choices the user selected in the first run and then executes the whole workflow again on the whole image without asking for parameters. My only test case so far was the Objects Counter class.
It currently looks quite ugly, but I think it is useful maybe also for others. Super interested in others opinions here!
Thank you for reading so far! Let us know how to make this useful to as many people as possible. Also happy to tear the repo apart.