Class ReplaceLabelValues

java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.label.edit.ReplaceLabelValues
All Implemented Interfaces:
Algo

public class ReplaceLabelValues
extends AlgoStub
Provides several methods for replacing label values within a label map (stored as 8-, 16- or 32-bits).

    ImagePlus imagePlus = IJ.getImage();
	int[] labelArray = new int[]{2, 3, 8};
	int finalValue = 0;
	// create algo for replacing values in original image
	ReplaceLabelValues algo = new ReplaceLabelValues();
	DefaultAlgoListener.monitor(algo);
	algo.process(imagePlus, labelArray, finalValue);
 
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    ReplaceLabelValues()  
  • Method Summary

    Modifier and Type Method Description
    void process​(ij.ImagePlus imagePlus, float[] labels, float newLabel)
    Replace all values specified in label array by the value 0.
    void process​(ij.ImageStack image, float[] labels, float newLabel)
    Replace all values specified in label array by the specified value.
    void process​(ij.ImageStack image, int[] labels, int newLabel)
    Replace all values specified in label array by a new value.
    void process​(ij.process.ImageProcessor image, float[] labels, float newLabel)
    Replace all values specified in label array by the value 0.
    void process​(ij.process.ImageProcessor image, int[] labels, int newLabel)
    Replace all values specified in label array by a new value.

    Methods inherited from class inra.ijpb.algo.AlgoStub

    addAlgoListener, removeAlgoListener

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReplaceLabelValues

      public ReplaceLabelValues()
  • Method Details

    • process

      public void process​(ij.ImagePlus imagePlus, float[] labels, float newLabel)
      Replace all values specified in label array by the value 0. This method changes directly the values within the image.
      Parameters:
      imagePlus - an ImagePlus containing a 3D label image
      labels - the list of labels to replace
      newLabel - the new value for labels
    • process

      public void process​(ij.process.ImageProcessor image, int[] labels, int newLabel)
      Replace all values specified in label array by a new value.
      Parameters:
      image - a label planar image
      labels - the list of labels to replace
      newLabel - the new value for labels
    • process

      public void process​(ij.process.ImageProcessor image, float[] labels, float newLabel)
      Replace all values specified in label array by the value 0.
      Parameters:
      image - a label planar image
      labels - the list of labels to replace
      newLabel - the new value for labels
    • process

      public void process​(ij.ImageStack image, int[] labels, int newLabel)
      Replace all values specified in label array by a new value.
      Parameters:
      image - a label 3D image
      labels - the list of labels to replace
      newLabel - the new value for labels
    • process

      public void process​(ij.ImageStack image, float[] labels, float newLabel)
      Replace all values specified in label array by the specified value.
      Parameters:
      image - a 3D label image
      labels - the list of labels to replace
      newLabel - the new value for labels