text file as stack

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

text file as stack

Alex Mock-2
hi there,
is there a plugin that opens text files containing an image stack with a
small header and a line separting images?

thanks for your help, alex
Reply | Threaded
Open this post in threaded view
|

Re: text file as stack

dscho
Hi,

On Tue, 31 Jan 2006, Alex Mock wrote:

> is there a plugin that opens text files containing an image stack with a
> small header and a line separting images?

As the format of the images, as well as their dimensions, probably are
described in the small header, ImageJ would first have to know about the
syntax.

It is not hard to write a plugin: if you send me an example, I'll write
one for you.

Hth,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: text file as stack

junsheng
In reply to this post by Alex Mock-2
 Hello Dscho,

I'd like to get this kind of plugin as well. Can you show me a example
to add the header to the image stack?

Cheers,

Junsheng Wang

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Johannes Schindelin
Sent: 31 January 2006 10:24
To: [hidden email]
Subject: Re: text file as stack

Hi,

On Tue, 31 Jan 2006, Alex Mock wrote:

> is there a plugin that opens text files containing an image stack with

> a small header and a line separting images?

As the format of the images, as well as their dimensions, probably are
described in the small header, ImageJ would first have to know about the
syntax.

It is not hard to write a plugin: if you send me an example, I'll write
one for you.

Hth,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: text file as stack

dscho
Hi,

On Tue, 31 Jan 2006, Wang, Junsheng wrote:

> I'd like to get this kind of plugin as well. Can you show me a example
> to add the header to the image stack?

I just got an example file, which starts like this:

-- snip --
ascii
3 uc
100 100 100
0.0  1000.00  0.0  1000.00  0.0  1000.00
 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3
 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3
 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3
-- snap --

Evidently, "ascii" means that the pixel values are not raw, i.e. they are
written out as numbers.

"3 uc" probably means that it is 3-dimensional, and the values are
unsigned chars (0-255).

"100 100 100" probably means that the pixel dimension is 100x100x100, and

"0.0 1000.0 0.0 1000.0 0.0 1000.0" probably is the bounding box, i.e. the
real dimension.

I whipped up a small plugin to read that data, which is attached.

Note that I use StreamTokenizer, which does not care at all about line
breaks, but handles all white spaces (including line breaks) alike.

Note further that I only implemented an "UnsignedCharReader", as I am not
sure if anything else is needed at all.

Hth,
Dscho

RawAsciiReader_.java (4K) Download Attachment