- 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
All Methods Static Methods Instance Methods Concrete Methods 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)
-
-
-
Method Detail
-
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.
-
run
public static ImagePlus run(ImagePlus img, int[] newOrder)
Changes the order of the channels in a hyperstack.- Parameters:
img
- source hyperstacknewOrder
- 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 interfacejava.awt.event.TextListener
-
-