Posted by
Michael Doube-2 on
Apr 18, 2007; 12:32pm
URL: http://imagej.273.s1.nabble.com/Open-unrecognised-stack-tp3699734p3699736.html
Thanks Michael, this worked:
--------------------
run("Raw...", "image=8-bit width=100 height=1 offset=0 number=1");
width = getPixel(1,0)*256 + getPixel(0,0);
height = getPixel(3,0)*256 + getPixel(2,0);
slices = getPixel(5,0)*256 +getPixel(4,0);
path = "'"+getDirectory("image")+getTitle+"'";
run("Close");
run("Raw...", "open="+path+" image=8-bit width="+width+"
height="+height+" offset=512 number="+slices);
-----------------------
Mike
Michael Schmid wrote:
> Hi Mike,
>
> Yes, there is such a trick:
>
> First open the file as single 16-bit raw image with offset = 0, 3 x 1
> pixels size.
>
> Read the first three pixel values - these are the first three 16-bit
> numbers.
>
> For an example of such a macro, see
>
http://rsb.info.nih.gov/ij/macros/OpenMacIPLab.txt>
> Michael
>
> On 18 Apr 2007, at 11:44, Michael Doube wrote:
>
>> Hi all
>>
>> I have some stacks that I'd like to open with ImageJ, more quickly
>> than having to go File->Import->Raw, and recovering stack dimensions
>> with a hex editor.
>>
>> The recorded macro command goes like this:
>> run("Raw...", "open="+imagename+" image=8-bit width=900 height=160
>> offset=512 number=496 gap=0");
>>
>> I can get the stack dimensions from the first 6 bytes of the header
>> (512 B header) e.g. hex 84 03 A0 00 F0 01 = 900 x 160 x 496 pixels.
>>
>> Is there a quick and dirty way to get the stack dimensions from the
>> header so that I can make a wee macro, or could a file opener plugin
>> be extended?
>>
>> Cheers,
>>
>> Mike
>>