http://imagej.273.s1.nabble.com/API-way-to-do-deinterleave-tp5021169p5021174.html
Thank you for your reply.
I made a mistake below, copying the wrong line. I meant the following:
which is the same as Image>Stacks>Tools>Deinterleave...
created from the original stack.
So I am looking for the Deinterleave method in the API, if it is available.
> Hi Aryeh,
>
> It’s not clear what you are trying to do. Are you trying to convert a stack with n channels into n stacks? It would help if you could provide a minimal working example. In the example, use
>
> imp = IJ.createImage("stack", "16-bit label", width, height, channels, slices, frames);
>
> to create a test hyperstack.
>
> -wayne
>
>
>
>
>> On Sep 12, 2018, at 8:26 AM, Aryeh Weiss <
[hidden email]> wrote:
>>
>> I need to deinterleave a stack, and this is how I currently do it.
>>
>> IJ.run(imp ,"Properties...", "channels=1 slices=1 frames="+str(timePoints)+" unit=pixel pixel_width=1.0000 pixel_height=1.0000 voxel_depth=1.0000")
>>
>> and this works fine. However, when IJ.run() commands open up window, I need to get a handle on those windows, and this requires knowing the names or id's of the windows that were opened. This is ok, but awkward, especially when more than one image windows is generated. Also, it means that the images are displayed, which is not always needed or desirable.
>>
>> In this case, I deinterleave nine fields,so it is awkward. So I close all image windows before deinterleaving, and then grab the entire image list and create a list of ImagPlus objects.
>>
>> Is there a stack deinterleave method (similar to reduce() and some other stack methods), that can be called and will return a list of the deinterleaved images.
>>
>> I can duplicate, reduce(), remove an image and repeat, but I am hoping that I do not have to reinvent it.
>>
>> tnx in advance
>> --aryeh
>>
>> --
>> Aryeh Weiss
>> Faculty of Engineering
>> Bar Ilan University
>> Ramat Gan 52900 Israel
>>
>> Ph: 972-3-5317638
>> FAX: 972-3-7384051
>>
>>
>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>