Module ij
Package ij.plugin

Class ChannelArranger

java.lang.Object
ij.plugin.ChannelArranger
All Implemented Interfaces:
PlugIn, java.awt.event.TextListener, java.util.EventListener

public class ChannelArranger
extends java.lang.Object
implements PlugIn, java.awt.event.TextListener
This plugin implements the Image/Colors/Arrange Channels command, which allows the user to change the order of channels.
Author:
Norbert Vischer 23-sep-2012
  • Constructor Summary

    Constructors 
    Constructor Description
    ChannelArranger()  
  • Method Summary

    Modifier and Type Method Description
    static ImagePlus run​(ImagePlus img, int[] newOrder)
    Changes the order of the channels in a hyperstack.
    void run​(java.lang.String arg)
    This method is called when the plugin is loaded.
    void textValueChanged​(java.awt.event.TextEvent e)  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • run

      public void run​(java.lang.String arg)
      Description copied from interface: PlugIn
      This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.
      Specified by:
      run in interface PlugIn
    • run

      public static ImagePlus run​(ImagePlus img, int[] newOrder)
      Changes the order of the channels in a hyperstack.
      Parameters:
      img - source hyperstack
      newOrder - the new channel order
      Returns:
      a hyperstack with channels in the specified order

      The following example opens the FluorescentCells sample image and reverses the order of the channels.

                      ImagePlus img = IJ.openImage("http://imagej.nih.gov/ij/images/FluorescentCells.zip");
                      int[] order = {3,2,1};
                      ImagePlus img2 = ChannelArranger.run(img, order);
                      img2.setDisplayMode(IJ.COLOR);
                      img2.show();
                      
    • textValueChanged

      public void textValueChanged​(java.awt.event.TextEvent e)
      Specified by:
      textValueChanged in interface java.awt.event.TextListener