Package inra.ijpb.plugins
Class ExpandLabelsPlugin
java.lang.Object
inra.ijpb.plugins.ExpandLabelsPlugin
- All Implemented Interfaces:
ij.plugin.PlugIn
public class ExpandLabelsPlugin
extends java.lang.Object
implements ij.plugin.PlugIn
Creates a new image larger than the original one, and copies each label identically
but shifted by a given dilation coefficient. This results in 2D or 3D images with
fewer labels touching each other, making them easier to visualize.
The idea is to transform a label image in the following way:
1 1 1 0 0 0 0 0
1 1 1 0 2 2 1 1 1 0 0 0 2 2
1 1 1 0 2 2 0 0 0 0 0 0 2 2
0 0 0 0 2 2 => 0 0 0 0 0 0 2 2
3 3 3 0 2 2 0 0 0 0 0 0 2 2
3 3 3 0 2 2 3 3 3 0 0 0 2 2
3 3 3 0 0 0 0 0
- Author:
- dlegland
-
Constructor Summary
Constructors Constructor Description ExpandLabelsPlugin()
-
Method Summary
Modifier and Type Method Description static ij.ImageStack
expandLabels(ij.ImageStack image, float ratio)
Expand labels by a given factorstatic ij.process.ImageProcessor
expandLabels(ij.process.ImageProcessor image, float ratio)
Expand labels by a given factorvoid
run(java.lang.String arg0)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExpandLabelsPlugin
public ExpandLabelsPlugin()
-
-
Method Details
-
run
public void run(java.lang.String arg0)- Specified by:
run
in interfaceij.plugin.PlugIn
-
expandLabels
public static final ij.process.ImageProcessor expandLabels(ij.process.ImageProcessor image, float ratio)Expand labels by a given factor- Parameters:
image
- input label imageratio
- percentage of expansion (values between 0 and 100)- Returns:
- expanded image
-
expandLabels
public static final ij.ImageStack expandLabels(ij.ImageStack image, float ratio)Expand labels by a given factor- Parameters:
image
- input label imageratio
- percentage of expansion (values between 0 and 100)- Returns:
- expanded image
-