Creating a Image from a text file

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

Creating a Image from a text file

Michael Grace
Dear Users

I would like to create an image from an outputted text file. The text file contains the following header information followed by comma separated data.

Line 1 File type and version
Line 2 The date and time the file was created, and the documentation number. The date format is
MMM DD YYYY. The time format is hh:mm:ss
Line 3 Patient Identifier
Line 4 Plane orientation (Transverse, Sagittal, Coronal) and
the slice location (cm)
Line 5 Dose units and normalized value
Line 6 NA
Line 7 NA
Line 8 NA
Line 9 Output area width and length (mm).
Line 10 NA
Line 11 NA
Line 12 NA
Line 13 The position of the upper left hand corner of the matrix, in calculation volume coordinates
Line 14 The resolution of the calculation matrix in mm (x, y, z)
Line 15 Number of points in the x and y directions
Line 16 2-D planar array resolution in mm

Line 17 onwards.... the image data.. eg. 100.2,100.4,98.6,92.1,.......

I am not sure how to create an image from a text file like this in image J, could anyone please  point me in the right direction?

Your help is greatly appreciated.

Regards

Michael





______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Creating a Image from a text file

dscho
Hi,

On Sun, 15 Aug 2010, Michael Grace wrote:

> I would like to create an image from an outputted text file. The text file contains the following header information followed by comma separated data.
>
> Line 1 File type and version
> Line 2 The date and time the file was created, and the documentation number. The date format is
> MMM DD YYYY. The time format is hh:mm:ss
> Line 3 Patient Identifier
> Line 4 Plane orientation (Transverse, Sagittal, Coronal) and
> the slice location (cm)
> Line 5 Dose units and normalized value
> Line 6 NA
> Line 7 NA
> Line 8 NA
> Line 9 Output area width and length (mm).
> Line 10 NA
> Line 11 NA
> Line 12 NA
> Line 13 The position of the upper left hand corner of the matrix, in calculation volume coordinates
> Line 14 The resolution of the calculation matrix in mm (x, y, z)
> Line 15 Number of points in the x and y directions
> Line 16 2-D planar array resolution in mm
>
> Line 17 onwards.... the image data.. eg. 100.2,100.4,98.6,92.1,.......

There is File>Import>Text Image..., but it expects a different format. So
I am afraid that you will have to do some coding to handle your exact
needs.

If your Java-fu is good, the source code for aforementioned menu item
might serve as an example:

http://rsbweb.nih.gov/ij/developer/source/ij/plugin/TextReader.java.html

Ciao,
Johannes