distance measurement and cropping behavior questions

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

distance measurement and cropping behavior questions

Cammer, Michael
I was wondering whether anybody else is having odd behaviors with ImageJ  1.52d8 with Java 1.8 on Windows 7?  One of them may be my fault and want to confirm; the other is something odd with the software.

1.
When I do a line profile plot and measure a distance on it, most of the time the distance returned is incorrect.
I thought that when the images were spatially calibrated, the plot also was supposed to return the calibrated length.  Am I mistaken about this or is this a bug?  What makes me puzzled is that the lengths reported are inconsistent.

2.
When I draw a rectangle on an image and then crop, the upper left of the image is cropped instead of the ROI.  The resultant image is the size of the ROI, but not the correct location.
When I duplicate, the correct region is duplicated.
These are 4096 x 4096 pixels 16 bit and 32bit images generated with a Talos TEM and Gatan camera.  When the images are converted to RGB or 8 bit, this problem does not happen.

Any help appreciated.

Thank you.

Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
[hidden email]<mailto:[hidden email]>  http://nyulmc.org/micros  http://microscopynotes.com/
Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================

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

Re: distance measurement and cropping behavior questions

Michael Schmid-3
Hi Michael,

(1) Plot profile: Yes, the x axis is calibrated length.
There is a small difference between the length reported by "measure" and
the length of the line section of a profile plot (corresponding to less
than one pixel):
Profile plots sample the image with a spacing of one pixel. If the
length of the line is not an integer number of pixels, the length of the
profile will still be an integer number of pixels (apart from rounding
errors).

Is it this (small) differences of profile lengths and actual line
lengths (given by 'measure') that you refer to?

If not, it would be good to have a sample image and test macro to trace
down the reason for the problem.


(2) Crop using the wrong place: Using Linux and Java 1.8, I have never
seen that (I'm working mostly with 32-bit images). Again a sample image
and test macro would help.


Michael
________________________________________________________________
On 31/05/2018 19:09, Cammer, Michael wrote:

> I was wondering whether anybody else is having odd behaviors with ImageJ  1.52d8 with Java 1.8 on Windows 7?  One of them may be my fault and want to confirm; the other is something odd with the software.
>
> 1.
> When I do a line profile plot and measure a distance on it, most of the time the distance returned is incorrect.
> I thought that when the images were spatially calibrated, the plot also was supposed to return the calibrated length.  Am I mistaken about this or is this a bug?  What makes me puzzled is that the lengths reported are inconsistent.
>
> 2.
> When I draw a rectangle on an image and then crop, the upper left of the image is cropped instead of the ROI.  The resultant image is the size of the ROI, but not the correct location.
> When I duplicate, the correct region is duplicated.
> These are 4096 x 4096 pixels 16 bit and 32bit images generated with a Talos TEM and Gatan camera.  When the images are converted to RGB or 8 bit, this problem does not happen.
>
> Any help appreciated.
>
> Thank you.
>
> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
> [hidden email]<mailto:[hidden email]>  http://nyulmc.org/micros  http://microscopynotes.com/
> Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
>

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

Re: distance measurement and cropping behavior questions

Cammer, Michael
The screenshot at the left shows the correct measurement on the original image.  (If not attached, see https://www.flickr.com/photos/mcammer/42499032731/ ) The screenshot at the right shows a line profile plot where the first measurement of the line segment is 1.05 um.  Then I dragged the endpoint a pixel or two and measured again and got what appears to be a correct 0.62 um.
Not shown, dragging it a few pixels again went to 1.82, 2.62, 8.55 um.   The length numbers in the status bar jump around and go to the results window if measured.
Also, the angle is reported wrong.

Thank you!

Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
[hidden email]  http://nyulmc.org/micros  http://microscopynotes.com/ 
Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



-----Original Message-----
From: Michael Schmid [mailto:[hidden email]]
Sent: Friday, June 1, 2018 4:56 AM
To: [hidden email]
Subject: Re: distance measurement and cropping behavior questions

Hi Michael,

(1) Plot profile: Yes, the x axis is calibrated length.
There is a small difference between the length reported by "measure" and
the length of the line section of a profile plot (corresponding to less
than one pixel):
Profile plots sample the image with a spacing of one pixel. If the
length of the line is not an integer number of pixels, the length of the
profile will still be an integer number of pixels (apart from rounding
errors).

Is it this (small) differences of profile lengths and actual line
lengths (given by 'measure') that you refer to?

If not, it would be good to have a sample image and test macro to trace
down the reason for the problem.


(2) Crop using the wrong place: Using Linux and Java 1.8, I have never
seen that (I'm working mostly with 32-bit images). Again a sample image
and test macro would help.


Michael
________________________________________________________________
On 31/05/2018 19:09, Cammer, Michael wrote:

> I was wondering whether anybody else is having odd behaviors with ImageJ  1.52d8 with Java 1.8 on Windows 7?  One of them may be my fault and want to confirm; the other is something odd with the software.
>
> 1.
> When I do a line profile plot and measure a distance on it, most of the time the distance returned is incorrect.
> I thought that when the images were spatially calibrated, the plot also was supposed to return the calibrated length.  Am I mistaken about this or is this a bug?  What makes me puzzled is that the lengths reported are inconsistent.
>
> 2.
> When I draw a rectangle on an image and then crop, the upper left of the image is cropped instead of the ROI.  The resultant image is the size of the ROI, but not the correct location.
> When I duplicate, the correct region is duplicated.
> These are 4096 x 4096 pixels 16 bit and 32bit images generated with a Talos TEM and Gatan camera.  When the images are converted to RGB or 8 bit, this problem does not happen.
>
> Any help appreciated.
>
> Thank you.
>
> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
> [hidden email]<mailto:[hidden email]>  https://urldefense.proofpoint.com/v2/url?u=http-3A__nyulmc.org_micros&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=IQJBKDQyf9pJJ2Xyr7E8_unF-qqJFrkq6n56m94c6Yg&s=A4IYO_4gSzK-x6uW7AZHCcvBYyFdSw-9OmxQTTzKtuE&e=  https://urldefense.proofpoint.com/v2/url?u=http-3A__microscopynotes.com_&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=IQJBKDQyf9pJJ2Xyr7E8_unF-qqJFrkq6n56m94c6Yg&s=rEsI6lG7KEwjD5s5vWnD6XRstmahy5rONbvMS7FfHag&e=
> Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
>
--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=IQJBKDQyf9pJJ2Xyr7E8_unF-qqJFrkq6n56m94c6Yg&s=e-KNKSz1byyrCjFNrd50Y7HiB6Xfw4O8R9Bqkiyi-Uw&e=

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================


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

IJ problem 20180601.png (268K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: distance measurement and cropping behavior questions

Michael Schmid-3
Hi Michael,

when measuring distances in a plot make sure you hold the shift key, so
the line is exactly horizontal (or vertical).
As an alternative, use the rectangle tool.

The plot has both an x and a y scale; in your case they are very
different. If the line is exactly horizontal, you get exactly the x
distance.
If the line is under an angle (even a small one), you will get a distance of
   d = sqrt(delta_x ^2 + delta_y ^2)

In your plot, 1 pixel in y direction corresponds to about 0.85 gray
scale units.
If the line is one pixel off from horizontal, you will have, e.g.,
delta_x = 0.62 and delta_y = 0.85, which results in a distance of 1.05
according to the equation. This is exactly what you see.
With two pixels off and the same scale (delta y = 2*0.85) the equation
gives 1.81.


Michael
________________________________________________________________

On 01/06/2018 19:42, Cammer, Michael wrote:
 > The screenshot at the left shows the correct measurement on the
original image.  (If not attached, see
https://www.flickr.com/photos/mcammer/42499032731/ )
 > The screenshot at the right shows a line profile plot where the first
measurement of the line segment is 1.05 um.  Then I dragged the endpoint
a pixel or two and measured again and got what appears to be a correct
0.62 um.
 > Not shown, dragging it a few pixels again went to 1.82, 2.62, 8.55
um.   The length numbers in the status bar jump around and go to the
results window if measured.
 >
 > Thank you!
 >
 > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
 > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York,
NY  10016
 > [hidden email]  http://nyulmc.org/micros 
http://microscopynotes.com/
 > Voice direct only, no text or messages:  1-914-309-3270 and
1-646-501-0567
 >
 >
 >
 > -----Original Message-----
 > From: Michael Schmid [mailto:[hidden email]]
 > Sent: Friday, June 1, 2018 4:56 AM
 > To: [hidden email]
 > Subject: Re: distance measurement and cropping behavior questions
 >
 > Hi Michael,
 >
 > (1) Plot profile: Yes, the x axis is calibrated length.
 > There is a small difference between the length reported by "measure" and
 > the length of the line section of a profile plot (corresponding to less
 > than one pixel):
 > Profile plots sample the image with a spacing of one pixel. If the
 > length of the line is not an integer number of pixels, the length of the
 > profile will still be an integer number of pixels (apart from rounding
 > errors).
 >
 > Is it this (small) differences of profile lengths and actual line
 > lengths (given by 'measure') that you refer to?
 >
 > If not, it would be good to have a sample image and test macro to trace
 > down the reason for the problem.
 >
 >
 > (2) Crop using the wrong place: Using Linux and Java 1.8, I have never
 > seen that (I'm working mostly with 32-bit images). Again a sample image
 > and test macro would help.
 >
 >
 > Michael
 > ________________________________________________________________
 > On 31/05/2018 19:09, Cammer, Michael wrote:
 >> I was wondering whether anybody else is having odd behaviors with
ImageJ  1.52d8 with Java 1.8 on Windows 7?  One of them may be my fault
and want to confirm; the other is something odd with the software.
 >>
 >> 1.
 >> When I do a line profile plot and measure a distance on it, most of
the time the distance returned is incorrect.
 >> I thought that when the images were spatially calibrated, the plot
also was supposed to return the calibrated length.  Am I mistaken about
this or is this a bug?  What makes me puzzled is that the lengths
reported are inconsistent.
 >>
 >> 2.
 >> When I draw a rectangle on an image and then crop, the upper left of
the image is cropped instead of the ROI.  The resultant image is the
size of the ROI, but not the correct location.
 >> When I duplicate, the correct region is duplicated.
 >> These are 4096 x 4096 pixels 16 bit and 32bit images generated with
a Talos TEM and Gatan camera.  When the images are converted to RGB or 8
bit, this problem does not happen.
 >>
 >> Any help appreciated.
 >>
 >> Thank you.
 >>
 >> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
 >> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New
York, NY  10016

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

Re: distance measurement and cropping behavior questions

Cammer, Michael
Thank you!!
This is an excellent explanation of the behavior.  Been using this for years and didn’t realize this.

Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
[hidden email]  http://nyulmc.org/micros  http://microscopynotes.com/ 
Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



-----Original Message-----
From: Michael Schmid [mailto:[hidden email]]
Sent: Friday, June 1, 2018 2:05 PM
To: [hidden email]
Subject: Re: distance measurement and cropping behavior questions

Hi Michael,

when measuring distances in a plot make sure you hold the shift key, so
the line is exactly horizontal (or vertical).
As an alternative, use the rectangle tool.

The plot has both an x and a y scale; in your case they are very
different. If the line is exactly horizontal, you get exactly the x
distance.
If the line is under an angle (even a small one), you will get a distance of
   d = sqrt(delta_x ^2 + delta_y ^2)

In your plot, 1 pixel in y direction corresponds to about 0.85 gray
scale units.
If the line is one pixel off from horizontal, you will have, e.g.,
delta_x = 0.62 and delta_y = 0.85, which results in a distance of 1.05
according to the equation. This is exactly what you see.
With two pixels off and the same scale (delta y = 2*0.85) the equation
gives 1.81.


Michael
________________________________________________________________

On 01/06/2018 19:42, Cammer, Michael wrote:
 > The screenshot at the left shows the correct measurement on the
original image.  (If not attached, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.flickr.com_photos_mcammer_42499032731_&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=y8Wx1LeqtjxkMK0qHMLM9SFH4WGmUx3q0kHxBY32tlU&s=IrTDxMlG3V59mnBq9S2FGErda4u6SWgHvQSh1j5vxEA&e= )
 > The screenshot at the right shows a line profile plot where the first
measurement of the line segment is 1.05 um.  Then I dragged the endpoint
a pixel or two and measured again and got what appears to be a correct
0.62 um.
 > Not shown, dragging it a few pixels again went to 1.82, 2.62, 8.55
um.   The length numbers in the status bar jump around and go to the
results window if measured.
 >
 > Thank you!
 >
 > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
 > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York,
NY  10016
 > [hidden email]  https://urldefense.proofpoint.com/v2/url?u=http-3A__nyulmc.org_micros&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=y8Wx1LeqtjxkMK0qHMLM9SFH4WGmUx3q0kHxBY32tlU&s=ycaKe6ndSkl0yb7XxCV4YsZrwc9RBcwGv-SUKmPNbyA&e= 
https://urldefense.proofpoint.com/v2/url?u=http-3A__microscopynotes.com_&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=y8Wx1LeqtjxkMK0qHMLM9SFH4WGmUx3q0kHxBY32tlU&s=GAuW3s0tSLXdFZAPYUEgfjEEFl2pIpz1FRs_fXu0-pI&e=
 > Voice direct only, no text or messages:  1-914-309-3270 and
1-646-501-0567
 >
 >
 >
 > -----Original Message-----
 > From: Michael Schmid [mailto:[hidden email]]
 > Sent: Friday, June 1, 2018 4:56 AM
 > To: [hidden email]
 > Subject: Re: distance measurement and cropping behavior questions
 >
 > Hi Michael,
 >
 > (1) Plot profile: Yes, the x axis is calibrated length.
 > There is a small difference between the length reported by "measure" and
 > the length of the line section of a profile plot (corresponding to less
 > than one pixel):
 > Profile plots sample the image with a spacing of one pixel. If the
 > length of the line is not an integer number of pixels, the length of the
 > profile will still be an integer number of pixels (apart from rounding
 > errors).
 >
 > Is it this (small) differences of profile lengths and actual line
 > lengths (given by 'measure') that you refer to?
 >
 > If not, it would be good to have a sample image and test macro to trace
 > down the reason for the problem.
 >
 >
 > (2) Crop using the wrong place: Using Linux and Java 1.8, I have never
 > seen that (I'm working mostly with 32-bit images). Again a sample image
 > and test macro would help.
 >
 >
 > Michael
 > ________________________________________________________________
 > On 31/05/2018 19:09, Cammer, Michael wrote:
 >> I was wondering whether anybody else is having odd behaviors with
ImageJ  1.52d8 with Java 1.8 on Windows 7?  One of them may be my fault
and want to confirm; the other is something odd with the software.
 >>
 >> 1.
 >> When I do a line profile plot and measure a distance on it, most of
the time the distance returned is incorrect.
 >> I thought that when the images were spatially calibrated, the plot
also was supposed to return the calibrated length.  Am I mistaken about
this or is this a bug?  What makes me puzzled is that the lengths
reported are inconsistent.
 >>
 >> 2.
 >> When I draw a rectangle on an image and then crop, the upper left of
the image is cropped instead of the ROI.  The resultant image is the
size of the ROI, but not the correct location.
 >> When I duplicate, the correct region is duplicated.
 >> These are 4096 x 4096 pixels 16 bit and 32bit images generated with
a Talos TEM and Gatan camera.  When the images are converted to RGB or 8
bit, this problem does not happen.
 >>
 >> Any help appreciated.
 >>
 >> Thank you.
 >>
 >> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
 >> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New
York, NY  10016

--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=y8Wx1LeqtjxkMK0qHMLM9SFH4WGmUx3q0kHxBY32tlU&s=62MrurQ1U0SBfZjSYQyXfQQFZpwSu21e8R_ejFrld3o&e=

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================


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