Module ij
Package ij.plugin

Class ChannelArranger

  • All Implemented Interfaces:
    PlugIn, TextListener, EventListener

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

      • ChannelArranger

        public ChannelArranger()
    • Method Detail

      • run

        public void run​(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();