Login  Register

Re: Create rectangle with known size

Posted by Stefan Helfrich-2 on Nov 10, 2016; 11:25am
URL: http://imagej.273.s1.nabble.com/Create-rectangle-with-known-size-tp5013429p5017559.html

Hi Ben,

you should be able to do the following:

     widthInMM = 100;
     heightInMM = 200;

     widthInPixel = toUnscaled(widthInMM);
     heightInPixel = toUnscaled(heightInMM);

     run("Specify...", "width="+widthInPixel+" height="+heightInPixel+"
x=128 y=70");

You can do a similar thing with toUnscaled(xInMM, yInMM) for the x- and
y-coordinates.

Hope that helps,

Stefan


On 11/10/2016 10:00 AM, rettl wrote:

> Hi Ben,
> I am sorry but since I have a new job I don't have access to the old macros
> any more...
> All the best.
>
> 2016-11-09 16:55 GMT+01:00 BenS [via ImageJ] <
> [hidden email]>:
>
>> Hi rettl,
>>
>> I'm facing the same problem as you did, however, I could not integrate it
>> into my macro yet. Would you mind sharing your macro?
>>
>> Many thanks,
>>
>> Ben
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://imagej.1557.x6.nabble.com/Create-rectangle-with-
>> known-size-tp5013429p5017545.html
>> To unsubscribe from Create rectangle with known size, click here
>> <
>> .
>> NAML
>> <
http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>

--
Dr. Stefan Helfrich
Bioimaging Center (L931)
University of Konstanz

PO Box 604
78457 Konstanz
Germany

Tel +49-7531-884666
Fax +49-7531-884005

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