Hyperstack Reorder/Rename Channels

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hyperstack Reorder/Rename Channels

Francis
Hi ,

My hyperstack creates a stack that is alphabetical in order. Is there any
way to rearrange the channels according to the number and can this process
be scripted?

A100
B20
C12
D2
E17

D2
C12
E17
B20
A100

Any help would be really appreciated.

--
Regards,

Francis

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Hyperstack Reorder/Rename Channels

Rasband, Wayne (NIH/NIMH) [E]
On Mar 2, 2015, at 9:56 PM, Francis OBrien <[hidden email]> wrote:
>
> Hi ,
>
> My hyperstack creates a stack that is alphabetical in order. Is there any
> way to rearrange the channels according to the number and can this process
> be scripted?

You can use the Image>Colors>Arrange Channels command to rearrange the channels of a hyperstack, and this command is recordable. In this case, the recorded macro code would be

    run("Arrange Channels...", “new=43521);

-wayne

> A100
> B20
> C12
> D2
> E17
>
> D2
> C12
> E17
> B20
> A100
>
> Any help would be really appreciated.



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Hyperstack Reorder/Rename Channels

Francis
Wayne,

This could work but what if I have 16 channels to rearrange ImageJ seems to
have a 9 channel limit for the hyperstack?

-Francis

On Wed, Mar 4, 2015 at 12:34 AM, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:

> On Mar 2, 2015, at 9:56 PM, Francis OBrien <[hidden email]>
> wrote:
> >
> > Hi ,
> >
> > My hyperstack creates a stack that is alphabetical in order. Is there any
> > way to rearrange the channels according to the number and can this
> process
> > be scripted?
>
> You can use the Image>Colors>Arrange Channels command to rearrange the
> channels of a hyperstack, and this command is recordable. In this case, the
> recorded macro code would be
>
>     run("Arrange Channels...", “new=43521);
>
> -wayne
>
> > A100
> > B20
> > C12
> > D2
> > E17
> >
> > D2
> > C12
> > E17
> > B20
> > A100
> >
> > Any help would be really appreciated.
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Regards,

Francis

Research graduate,
New York School of Medicine
New York

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Hyperstack Reorder/Rename Channels

Rasband, Wayne (NIH/NIMH) [E]
On Mar 4, 2015, at 12:54 PM, Francis OBrien <[hidden email]> wrote:
>
> Wayne,
>
> This could work but what if I have 16 channels to rearrange ImageJ seems to
> have a 9 channel limit for the hyperstack?

The Image>Color>Arrange Channels command is limited to 9 channels. Upgrade to the latest ImageJ daily build (1.49q4) and you can use the new ChannelArranger.run() method to rearrange any number of channels. It uses an array of integers to represent the channels rather than a string of digits. The following JavaScript example creates a 16 channel hyperstack and then uses ChannelArranger.run() to reverse the order of the channels.

-wayne

  c=16; z=5; t=10;
  img = IJ.createImage("HS", "8-bit grayscale-mode label",400,300,c,z,t);
  order = new Array(c);
  for (i=0; i<c; i++)
     order[i] = c-i;
  img2 = ChannelArranger.run(img, order);
  img2.show();


> On Wed, Mar 4, 2015 at 12:34 AM, Rasband, Wayne (NIH/NIMH) [E] <
> [hidden email]> wrote:
>
>> On Mar 2, 2015, at 9:56 PM, Francis OBrien <[hidden email]>
>> wrote:
>>>
>>> Hi ,
>>>
>>> My hyperstack creates a stack that is alphabetical in order. Is there any
>>> way to rearrange the channels according to the number and can this
>> process
>>> be scripted?
>>
>> You can use the Image>Colors>Arrange Channels command to rearrange the
>> channels of a hyperstack, and this command is recordable. In this case, the
>> recorded macro code would be
>>
>>    run("Arrange Channels...", “new=43521);
>>
>> -wayne
>>
>>> A100
>>> B20
>>> C12
>>> D2
>>> E17
>>>
>>> D2
>>> C12
>>> E17
>>> B20
>>> A100
>>>
>>> Any help would be really appreciated.


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html