Login  Register

Re: Automatically set scale

Posted by Andrew Sanchez on Aug 28, 2015; 5:55pm
URL: http://imagej.273.s1.nabble.com/Automatically-set-scale-tp5014169p5014184.html

Hi Kees,

Thanks for the snippet.

I actually do need to measure the distance in pixels for each picture.   The object used to set the scale will be the same color and size (1  square mm) and in the same location.  The size of this object in pixels will vary from picture I picture but will represent 1 square mm, so I need to get the measurement each time .  I'm looking for a way to automate this.  

I plan on running the images through a color threshold and then run analyze particles to get the scale for 1 square mm and then take the square root of that number to get the distance in pixels of 1 mm.  Unless somebody has any suggestions for a more elegant solution

Andrew 



On Aug 28, 2015, at 12:38 AM, "Straatman, Kees (Dr.) [via ImageJ]" <[hidden email]> wrote:

Hi Andrew,

The code snippet below allows the user to insert the distance in pixels without measuring it.

Dialog.create("Pixel distance");
Dialog.addNumber("Give distance in pixels for 1 mm" , 0);
Dialog.show();
pixel = Dialog.getNumber();
run("Set Scale...", "distance="+pixel+" known=1 pixel=1 unit=mm");

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Andrew Sanchez
Sent: 28 August 2015 05:19
To: [hidden email]
Subject: Re: Automatically set scale

Hi Ved,

The problem is that the distance in pixels which equals 1 mm will be different in every image, so I can't set it to a constant number like you suggested.

I need to set it to a variable which I can automatically fill with the correct distance in pixels for each unique image, based on an object of known size which we are using to set the scale.

I hope that makes sense.

Andrew



--
View this message in context: http://imagej.1557.x6.nabble.com/Automatically-set-scale-tp5014169p5014178.html
Sent from the ImageJ mailing list archive at Nabble.com.

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

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



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/Automatically-set-scale-tp5014169p5014180.html
To unsubscribe from Automatically set scale, click here.
NAML