Icy ROI excel export – why do I get decimal pixel coordinates?

Hi all!

I’m new to image data processing and especially to Icy. I was wondering why is it that, even though the ROIs on the ROI tab appear as having integer pixel coordinates, when I try to export them to excel I obtain positions that have decimal precision. I’m working with polygon contour ROIs (from the Active Contours plugin).

Because I’ll be studying the trajectory of each ROI (which represents a nucleus) on a different platform, it’s important that I understand how the center coordinates (Center X and Center Y) of each ROI are calculated.

Thank you advance for your help! I couldn’t find the answer to this question anywhere.

Dear MTParreira,

I tried to reproduce what you did but I don’t see a change between the values in the ROI tab and the Excel file. Could you compare what I did below to what you did and give some precisions?

  1. I opened this test image in Icy, which contains some demo ROIs (put the .xml file in the same folder as the .tif file and drag and drop the .tif file in Icy): test_stack.tif (7.5 MB) test_stack.xml (3.4 KB)

  2. I looked at the ROI tab

  3. I exported the measurements as .xls file and compared the values with the ones in the ROI tab. I see integers for Position X, Y, Z and double, with the same decimal precision in the ROI tab and in the .xls file, for Center X, Y, Z.

Center X, Y, Z are the coordinates of the center of mass of the ROI, so I expect to have double. And according to the ROI Statistics documentation, Position X, Y, Z is the position of the upper left corner of the bounding box around the ROI.

Out of curiosity, which platform do you use to study the trajectories?

Best regards,
Marion

Hi Marion!
Thank you for your answer. I tested the files you sent and indeed ROI’s position don’t have decimal precision. However, when running the Active Contours plugin I get positions with decimal precision:

I expected the center to have decimal precision, yes, but I don’t understand which type of ROI is generating such positions.
I’m using this image: masks.tif (4.0 MB) masks.xml (11.5 MB)

In any case, the trajectories are studied taking into account only the center of each nucleus, but I do wonder if these coordinates are correct given that the position of the ROI has unrealistic precision. To answer your question, I’m exporting the excel data from the Active Contour ROIs and manipulating it using python, where I extract features with more “flexibility” than keeping the analysis solely on Icy.

Thank you once again!
Best,
Teresa

1 Like

Dear MTParreira

Are you using ROI Statistics to export the results from Active Contours or directly from the ROI table in Icy ?
As i think that something which is confusing you (and that’s indeed confusing) is that in the ROI table the Position X, Position Y give you the position of the bounding box of the ROI while Position X, Position Y in ROI statistics export give the mass center.
You can get the mass center in the ROI table by selecting Center X, Center Y fields, which should then correspond to your Position X, Position Y fields exported through ROI Statistics.

Best,

– Stephane

1 Like

Dear Teresa, Dear Stéphane,

Indeed @Stephane, you have a point, the names of the variables differ between the ROI tab and the ROI statistics plugin. I recently updated the online documentation. On top of that, they don’t compute values with the same decimal precision (with the plugin, you get a precision with more than 4 digits after the comma).

Below is an illustration of that:

However, I think the question of Teresa is rather why Position X, Y, Z, T, C (called Box X, box Y, box Z in the plugin interface), which in the documentation is “the position of the upper left corner of the bounding box around the ROIis a double and not an integer (this position is in pixels). Am I right?
If I draw a new ROI on her image, I also get doubles, whereas with my image, I always get integers. Now I am also wondering why I observe this :thinking:

Regarding your analyses in Python: if you plan to share them publicly on GitHub or elsewhere, I would be happy to add a link to it in the online documentation of the Active Contours plugin to give examples of downstream analyses to the users.

Best regards,
Marion

However, I think the question of Teresa is rather why Position X, Y, Z, T, C (called Box X, box Y, box Z in the plugin interface), which in the documentation is “ the position of the upper left corner of the bounding box around the ROIis a double and not an integer (this position is in pixels). Am I right?
If I draw a new ROI on her image, I also get doubles, whereas with my image, I always get integers. Now I am also wondering why I observe this

It’s just that polygon ROI has double precision coordinates as you can put a point at a specific position inside the pixel. If you zoom in a lot into your image and try to move your Polygon ROI point you will see you can control it freely over a pixel. And Active Contour does handle its contours as polygon internally and they can definitely has their points in the middle of a pixel for instance. Only Area 2D ROI cannot have double coordinates (for the bounding box) as they are bitmask type ROI with the same pixel resolution than the image.
Hope that clarify the troubles :slight_smile:

– Stephane

1 Like