[ome-users] dm4 imports with um scale instead of nm

Roger Leigh r.leigh at dundee.ac.uk
Mon Nov 4 10:06:51 GMT 2013


On 04/11/2013 06:26, Ralph Sperling wrote:
>
> Dear all,
>
> if there is good reason to stick with microns everywhere, nanometers
> could be taken into account by just dividing the pixel size by 1000, I
> guess this is exactly what Stephane suggested.

In the short term, this is exactly what the reader should do if the unit
is recorded as nm.  However, the complexity of doing this depends upon
how the units are stored; for readers which store the unit as an
enumeration, the conversions can be hardcoded.  But if it's a free text
field, we would need to be able to do general unit interconversion,
which is a bigger problem to tackle.

In the longer term, we're looking at adding units to the data model so
that we can store nm and other units natively.

> At the moment I am doing similar things with a macro - is there a way to
> do custom adjustments automagically, e.g. always after importing .dm4
> files? This would be a convenient solution for the moment.

This is certainly possible.  If the image filename ends with ".dm4",
then you just need to check for that and then after the image has been
imported, call:

   run("Set Scale...", "distance=x known=y pixel=1 unit=nm");

but getting the scale doesn't appear to be exposed in the macro language
from my reading of the documentation; you might need to call

   toScaled(x,y)

with some sample numbers, e.g. x=1000, y=1000, to compute the scale
factor, then adjust it from µm to nm, before calling "Set Scale".

There may be a better way of doing this; if so, I hope one of the ImageJ
experts reading the list could suggest an alternative approach.


Regards,
Roger

--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364

The University of Dundee is a registered Scottish Charity, No: SC015096



More information about the ome-users mailing list