How can I remove channels from ImagePlus object?

Hi there,

I am trying to remove one of the three channels (second one) from my ImagePlus object. There seems to be no dedicated functions for it. So I have recorded macro in fiji, where I have rearranged the channels while leaving one out:

IJ.run(imp, "Arrange Channels...", "new=13");

Then I have adapted this to my own java code, which uses ImageJ libraries. But whenever I run this, ImageJ window disappears and nothing happens. Apparently in 1.49o version there is setActiveChannels function. However, I am using Maven to import and I only have 1.49c. How can I make one of the channels unvisible or remove it?

Thanks a lot!

Edit: There is also ChannelArranger plugin, but my in my installation ImageJ does not have the run method with the ImagePlus parameter.

It seems to be my maven references were old. Now that I have updated my libraries, I can use ChannelArranger.

1 Like