Importing x y coordinates

Hello,

My request is a simple one (i think).

I would like to import a list of x y coordinates (from a .csv file) into imagej to overlay the image from which they were derived. However, when i use “File>Import>x y coordinates…” a polygon linking all the points is instead drawn over the original image.

Is there a simple plugin or way to modify the way imagej draws these coordinates once imported so i instead just get all the coordinates as individual points?

Thanks,
Meri_stem

You are correct that File > Import > XY Coordinates is designed to load the boundary of a selection, rather than points. More info on the Import menu is in the user guide.

Instead, have a look at this thread from the ImageJ list archives (a macro to split a text file and convert to point ROIs), and this page from the docuwiki giving a similar macro to load points from a txt or csv file.

Using these macros you should be able to convert your text directly to point ROIs.

Hope this helps!

1 Like

Hi,

I have found those links on a google search previously, but really don’t help. The user guide just tells you that x y import will make a polygon and the macros do not recognise CSV. files.

Surely there must be a simple way to just read in 2 column file of x and y data and overlay it on an image?

Thanks,
Meri_stem

It seems to me that “Import Multi-point set” on the docuwiki page should be able to read a CSV file directly and display the points as point selections.
From the description:
“This macro import a set of points (e.g. landmarks, feature points) from TXT or CSV file.”

If the macro doesn’t work for your particular data, you could post the code you used and a sample data file, to help with diagnosing the problem.

1 Like