<div dir="ltr"><div>Hi Roger & everyone,</div><div><br></div><div>> <span style="font-size:13px;font-family:arial,sans-serif">getting the scale doesn't appear to be exposed in the macro language<br></span><br></div>

<div>See the getPixelSize function:</div><div><a href="http://imagej.net/developer/macro/functions.html#getPixelSize">http://imagej.net/developer/macro/functions.html#getPixelSize</a></div><div><br></div><div>HTH,<br>Curtis</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 4, 2013 at 4:06 AM, Roger Leigh <span dir="ltr"><<a href="mailto:r.leigh@dundee.ac.uk" target="_blank">r.leigh@dundee.ac.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 04/11/2013 06:26, Ralph Sperling wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dear all,<br>
<br>
if there is good reason to stick with microns everywhere, nanometers<br>
could be taken into account by just dividing the pixel size by 1000, I<br>
guess this is exactly what Stephane suggested.<br>
</blockquote>
<br></div>
In the short term, this is exactly what the reader should do if the unit<br>
is recorded as nm.  However, the complexity of doing this depends upon<br>
how the units are stored; for readers which store the unit as an<br>
enumeration, the conversions can be hardcoded.  But if it's a free text<br>
field, we would need to be able to do general unit interconversion,<br>
which is a bigger problem to tackle.<br>
<br>
In the longer term, we're looking at adding units to the data model so<br>
that we can store nm and other units natively.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At the moment I am doing similar things with a macro - is there a way to<br>
do custom adjustments automagically, e.g. always after importing .dm4<br>
files? This would be a convenient solution for the moment.<br>
</blockquote>
<br></div>
This is certainly possible.  If the image filename ends with ".dm4",<br>
then you just need to check for that and then after the image has been<br>
imported, call:<br>
<br>
  run("Set Scale...", "distance=x known=y pixel=1 unit=nm");<br>
<br>
but getting the scale doesn't appear to be exposed in the macro language<br>
from my reading of the documentation; you might need to call<br>
<br>
  toScaled(x,y)<br>
<br>
with some sample numbers, e.g. x=1000, y=1000, to compute the scale<br>
factor, then adjust it from µm to nm, before calling "Set Scale".<br>
<br>
There may be a better way of doing this; if so, I hope one of the ImageJ<br>
experts reading the list could suggest an alternative approach.<br>
<br>
<br>
Regards,<br>
Roger<br>
<br>
--<br>
Dr Roger Leigh -- Open Microscopy Environment<br>
Wellcome Trust Centre for Gene Regulation and Expression,<br>
College of Life Sciences, University of Dundee, Dow Street,<br>
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364<br>
<br>
The University of Dundee is a registered Scottish Charity, No: SC015096<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<u></u>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.<u></u>org.uk/mailman/listinfo/ome-<u></u>users</a><br>
</div></div></blockquote></div><br></div>