ij.plugin
Class ChannelArranger

java.lang.Object
  extended by ij.plugin.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 23-sep-2012

Constructor Summary
ChannelArranger()
           
 
Method Summary
static ImagePlus run(ImagePlus img, int[] newOrder)
          Changes the order of the channels in a hyperstack.
 void run(String arg)
          This method is called when the plugin is loaded.
 void textValueChanged(TextEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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();
                

textValueChanged

public void textValueChanged(TextEvent e)
Specified by:
textValueChanged in interface TextListener


Copyright © 1997–2016 NIH. All rights reserved.