Re: creating stack containing only odd or even stack
Posted by
Daniel Kalthoff on
May 12, 2011; 5:51pm
URL: http://imagej.273.s1.nabble.com/creating-stack-containing-only-odd-or-even-stack-tp3684598p3684602.html
I agree, John's method is more elegant. Just take care about the order of dimensions in the hyperstack, it must be first frames and then slices.
This macro does the job, I guess:
// -------------------------------------------------------
// separate odd and even slices in a stack
getDimensions(w, h, c, z, t);
run("Stack to Hyperstack...", "order=xyctz channels=1 slices=" + (z/2) + " frames=2 display=Color");
ID = getImageID();
run("Duplicate...", "title=odd duplicate frames=1");
selectImage(ID);
run("Duplicate...", "title=even duplicate frames=2");
// -------------------------------------------------------
Regards,
Daniel
Am 12.05.2011 um 16:56 schrieb John Oreopoulos:
> I think you could do the same thing with the hyperstacks tools. Make your stack into a hyperstack using the "t" variable to separate the odd and even slices. Then you can use the reduce dimensionality hyperstacks function to separate into two sub-stacks.
>
> John Oreopoulos
>
>
> On 2011-05-12, at 10:35 AM, Daniel Kalthoff wrote:
>
>> Hi Srai,
>>
>> there might be a simple solution. Let's say your stack has 50 slices.
>>
>> 1. Use Image > Stacks > Make Montage ... with 2 columns and 25 rows
>> 2. Go the other way around with Image > Stacks > Tools > Montage to Stack ... and now use 1 column and 25 rows
>>
>> The resulting stack will consist of odd images on the left, even images on the right hand side.
>>
>> 3. You can use duplicate and crop to create two separate stacks for both.
>>
>> Best regards,
>>
>> Daniel
>>
>> Am 12.05.2011 um 16:29 schrieb Sahara Rai:
>>
>>> Hello everyone
>>>
>>> My image stack seems to have alternating high and low level of noise. Therefore I want to analyse the odd and the even numbered stacks individually.
>>>
>>> Is there a way I can duplicate only odd or even stacks to create a new image stack?
>>>
>>> Thanks
>>> Srai