Importing XYZ coordinates

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

Importing XYZ coordinates

Neil Fazel
Is there a way to import into ImageJ a file containing XYZ values of an image, where X,Y are the pixel coordinates and Z is the pixel value?

ImageJ can export in this format (Analyze->Tools->Save XY Coordinates...), so I thought perhaps there is a way too import it too.

Thanks,
Neil

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Importing XYZ coordinates

Jerome Mutterer-3
Neil,
First create an image with sufficient resolution to host your data, then
you can import your values in it using the following macro:

f=split(File.openAsString(""),"\n");
for (i=0;i<f.length;i++) {
n = split(f[i],";");
setPixel(parseInt(n[0]),parseInt(n[1]),parseInt(n[2]));
}

You might also parse the text file a first time to find out the x and y
ranges and create an image of the right dimension.
Sincerely,

Jerome


On 21 June 2013 02:52, Neil Fazel <[hidden email]> wrote:
>
> Is there a way to import into ImageJ a file containing XYZ values of an
image, where X,Y are the pixel coordinates and Z is the pixel value?
>
> ImageJ can export in this format (Analyze->Tools->Save XY
Coordinates...), so I thought perhaps there is a way too import it too.
>
> Thanks,
> Neil
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Importing XYZ coordinates

Neil Fazel
In reply to this post by Neil Fazel
Thank you, Jerome. I'll create a little macro based on your code snippet.

Regards,
Neil

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html