<div dir="ltr"><div class="markdown-here-wrapper" style="font-family:"Lucida Sans",Verdana,sans-serif;color:rgb(11,83,148)"><p style="margin:0px 0px 1.2em!important">There’s no direct API but you can calculate it. All you have to do is compute the length of the axis in world coordinates. </p>
<p style="margin:0px 0px 1.2em!important">Something like this:</p>
<pre style="font-size:0.95em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-cpp" style="font-size:0.95em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(218,218,218);background-color:rgb(232,232,232);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;background-color:rgb(255,255,255);color:black;background-position:initial initial;background-repeat:initial initial"><span class="hljs-keyword" style="color:rgb(170,13,145)">double</span> * leftPoint = axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);
<span class="hljs-keyword" style="color:rgb(170,13,145)">double</span> * rightPoint = axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);
<span class="hljs-keyword" style="color:rgb(170,13,145)">double</span> distance = vtkMath::<span class="hljs-built_in" style="color:rgb(92,38,153)">sqrt</span>(vtkMath::Distance2BetweenPoints(leftPoint, rightPoint));
<span class="hljs-comment" style="color:rgb(0,106,0)">// Scale is 1 : distance</span>
</code></pre>
<p style="margin:0px 0px 1.2em!important">Hope that helps.</p>
<p style="margin:0px 0px 1.2em!important">Best,<br>Sankhesh</p>
<div title="MDH:VGhlcmUncyBubyBkaXJlY3QgQVBJIGJ1dCB5b3UgY2FuIGNhbGN1bGF0ZSBpdC4gQWxsIHlvdSBo
YXZlIHRvIGRvIGlzIGNvbXB1dGUgdGhlIGxlbmd0aCBvZiB0aGUgYXhpcyBpbiB3b3JsZCBjb29y
ZGluYXRlcy7CoDxkaXY+PGJyPjwvZGl2PjxkaXY+U29tZXRoaW5nIGxpa2UgdGhpczo8L2Rpdj48
ZGl2Pjxicj48L2Rpdj48ZGl2PmBgYGNwcDwvZGl2PjxkaXY+ZG91YmxlICogbGVmdFBvaW50ID0g
YXhpcy0mZ3Q7R2V0UG9zaXRpb25Db29yZGluYXRlKCktJmd0O0dldENvbXB1dGVkV29ybGRWYWx1
ZShyZW5kZXJlcik7PC9kaXY+PGRpdj5kb3VibGUgKiByaWdodFBvaW50ID0gYXhpcy0mZ3Q7R2V0
UG9zaXRpb24yQ29vcmRpbmF0ZSgpLSZndDtHZXRDb21wdXRlZFdvcmxkVmFsdWUocmVuZGVyZXIp
OzwvZGl2PjxkaXY+ZG91YmxlIGRpc3RhbmNlID0gdnRrTWF0aDo6c3FydCh2dGtNYXRoOjpEaXN0
YW5jZTJCZXR3ZWVuUG9pbnRzKGxlZnRQb2ludCwgcmlnaHRQb2ludCkpOzwvZGl2PjxkaXY+Ly8g
U2NhbGUgaXMgMSA6IGRpc3RhbmNlPC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48
ZGl2PkhvcGUgdGhhdCBoZWxwcy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PkJlc3QsPC9kaXY+
PGRpdj5TYW5raGVzaDwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 7, 2017 at 4:30 AM K O ranjith <<a href="mailto:kor1581@gmail.com">kor1581@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>Thanks, it's  working.</div><div>Can I get the measured value (which is displayed as label axis) from vtkLegendScaleActor object.</div><div><br></div><div>Ranjith KO</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri <span dir="ltr"><<a href="mailto:sankhesh.jhaveri@kitware.com" target="_blank">sankhesh.jhaveri@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="m_9025589844434154047m_4607209742937058047markdown-here-wrapper" style="font-family:'Lucida Sans',Verdana,sans-serif;color:rgb(11,83,148)"><p style="margin:0px 0px 1.2em!important">Take a look at <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LegendScaleActor" target="_blank">vtkLegendScaleActor</a>. It uses <a href="http://www.vtk.org/doc/nightly/html/classvtkAxisActor.html" target="_blank">vtkAxisActor</a> internally.</p>
<p style="margin:0px 0px 1.2em!important">Hth,<br>Sankhesh</p>
<div title="MDH:VGFrZSBhIGxvb2sgYXQgW3Z0a0xlZ2VuZFNjYWxlQWN0b3JdKDxhIGhyZWY9Imh0dHA6Ly93d3cu
dnRrLm9yZy9XaWtpL1ZUSy9FeGFtcGxlcy9DeHgvVmlzdWFsaXphdGlvbi9MZWdlbmRTY2FsZUFj
dG9yIj5odHRwOi8vd3d3LnZ0ay5vcmcvV2lraS9WVEsvRXhhbXBsZXMvQ3h4L1Zpc3VhbGl6YXRp
b24vTGVnZW5kU2NhbGVBY3RvcjwvYT4pLiBJdCB1c2VzIFt2dGtBeGlzQWN0b3JdKDxhIGhyZWY9
Imh0dHA6Ly93d3cudnRrLm9yZy9kb2MvbmlnaHRseS9odG1sL2NsYXNzdnRrQXhpc0FjdG9yLmh0
bWwiPmh0dHA6Ly93d3cudnRrLm9yZy9kb2MvbmlnaHRseS9odG1sL2NsYXNzdnRrQXhpc0FjdG9y
Lmh0bWw8L2E+KSBpbnRlcm5hbGx5LjxkaXY+PGJyPjwvZGl2PjxkaXY+SHRoLDwvZGl2PjxkaXY+
U2Fua2hlc2g8L2Rpdj48ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div><br><div class="gmail_quote"><div><div class="m_9025589844434154047h5"><div dir="ltr">On Fri, Jun 23, 2017 at 1:55 AM K O ranjith <<a href="mailto:kor1581@gmail.com" target="_blank">kor1581@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_9025589844434154047h5"><div dir="ltr">I'm using vtk for developing a MRI DICOM Image viewer in Qt.<div>The viewer uses <span style="color:rgb(128,0,128)">vtkDICOMImageReader,  </span><span style="color:rgb(128,0,128)">vtkImageViewer2 & </span><span style="color:rgb(128,0,128)">QVTKWidget.</span></div><div><span style="color:rgb(128,0,128)">I need to show a zoom indicator line which varies </span><span style="color:rgb(128,0,128)">length</span><span style="color:rgb(128,0,128)"> </span><span style="color:rgb(128,0,128)">with zoom value and need not affect other operation like rotate, pan( which is used for DICOM image in same window). It's position should be fixed at side of viewer and should not alter with zoom, pan, rotate.</span></div><div><font color="#800080">I added an line as an vtkactor  to the renderer using vtkLineSource. </font></div><div><font color="#800080"> Its length altering  with zoom as I intended, but problem is its position also altering with the zoom, also rotate and Pan affecting on it.</font></div><div><font color="#800080">How can I make the position of the line fixed at side of the viewer.</font></div><div><font color="#800080">Have any option in vtk for visual indication of zoom factor something like </font><span style="color:rgb(128,0,128)">vtkOrientationMarkerWidget for orientation...</span></div><div><br></div><div><span style="color:rgb(128,0,128)"><br></span></div></div></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><span class="m_9025589844434154047HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="m_9025589844434154047HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div class="m_9025589844434154047m_4607209742937058047inbox-markdown-here-wrapper" style="font-family:'proza libre',sans-serif;color:rgb(0,56,107)"><h5 id="m_9025589844434154047m_4607209742937058047inbox-sankhesh-jhaveri" style="margin:1.3em 0px 1em;padding:0px;font-size:1.1em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-weight:bold;color:rgb(11,65,148)">Sankhesh Jhaveri</h5>
<h6 id="m_9025589844434154047m_4607209742937058047inbox--sr-research-development-engineer-kitware-http-www-kitware-com-518-881-4417" style="margin:1.3em 0px 1em;padding:0px;font-size:1em;color:rgb(11,83,148);font-family:'open sans',sans-serif;font-weight:normal"><em>Sr. Research & Development Engineer</em> | <a href="http://www.kitware.com/" target="_blank">Kitware</a> | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417</a></h6>
<div title="MDH:PGIgc3R5bGU9ImZvbnQtZmFtaWx5OiB2ZXJkYW5hLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDEx
LCA4MywgMTQ4KTsiPjxmb250IHNpemU9IjIiPiMjIyMjU2Fua2hlc2ggSmhhdmVyaTwvZm9udD48
L2I+PGRpdj48Zm9udCBjb2xvcj0iIzBiNTM5NCIgZmFjZT0idmVyZGFuYSwgc2Fucy1zZXJpZiIg
c2l6ZT0iMiI+PGI+PGJyPjwvYj48L2ZvbnQ+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6
IGFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDExLCA4MywgMTQ4KTsiPjxzcGFuIHN0eWxl
PSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsiPjxpPiMjIyMjIypTci4gUmVzZWFy
Y2ggJmFtcDsgRGV2ZWxvcG1lbnQgRW5naW5lZXIqPC9pPiZuYnNwO3wmbmJzcDs8L3NwYW4+PC9z
cGFuPjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsgY29sb3I6
IHJnYigxMSwgODMsIDE0OCk7Ij48YSBocmVmPSJodHRwOi8vd3d3LmtpdHdhcmUuY29tLyIgdGFy
Z2V0PSJfYmxhbmsiIHN0eWxlPSJjb2xvcjogcmdiKDE3LCA4NSwgMjA0KTsiPktpdHdhcmU8L2E+
Jm5ic3A7fCZuYnNwOzwvc3Bhbj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6IHZlcmRhbmEsIHNh
bnMtc2VyaWY7IGNvbG9yOiByZ2IoMTEsIDgzLCAxNDgpOyI+KDUxOCkgODgxLTQ0MTc8L3NwYW4+
PGJyPjwvZGl2PjxkaXY+PGRpdj48ZGl2PjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFu
YSwgc2Fucy1zZXJpZjsgY29sb3I6IHJnYigxMSwgODMsIDE0OCk7Ij48L3NwYW4+PC9kaXY+PC9k
aXY+PC9kaXY+PC9kaXY+" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px">​</div></div></div></div>
</font></span></blockquote></div><br></div>
</blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div class="inbox-markdown-here-wrapper" style="font-family:'proza libre',sans-serif;color:rgb(0,56,107)"><h5 id="inbox-sankhesh-jhaveri" style="margin:1.3em 0px 1em;padding:0px;font-size:1.1em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-weight:bold;color:rgb(11,65,148)">Sankhesh Jhaveri</h5>
<h6 id="inbox--sr-research-development-engineer-kitware-http-www-kitware-com-518-881-4417" style="margin:1.3em 0px 1em;padding:0px;font-size:1em;color:rgb(11,83,148);font-family:'open sans',sans-serif;font-weight:normal"><em>Sr. Research & Development Engineer</em> | <a href="http://www.kitware.com/">Kitware</a> | (518) 881-4417</h6>
<div title="MDH:PGIgc3R5bGU9ImZvbnQtZmFtaWx5OiB2ZXJkYW5hLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDEx
LCA4MywgMTQ4KTsiPjxmb250IHNpemU9IjIiPiMjIyMjU2Fua2hlc2ggSmhhdmVyaTwvZm9udD48
L2I+PGRpdj48Zm9udCBjb2xvcj0iIzBiNTM5NCIgZmFjZT0idmVyZGFuYSwgc2Fucy1zZXJpZiIg
c2l6ZT0iMiI+PGI+PGJyPjwvYj48L2ZvbnQ+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6
IGFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDExLCA4MywgMTQ4KTsiPjxzcGFuIHN0eWxl
PSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsiPjxpPiMjIyMjIypTci4gUmVzZWFy
Y2ggJmFtcDsgRGV2ZWxvcG1lbnQgRW5naW5lZXIqPC9pPiZuYnNwO3wmbmJzcDs8L3NwYW4+PC9z
cGFuPjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsgY29sb3I6
IHJnYigxMSwgODMsIDE0OCk7Ij48YSBocmVmPSJodHRwOi8vd3d3LmtpdHdhcmUuY29tLyIgdGFy
Z2V0PSJfYmxhbmsiIHN0eWxlPSJjb2xvcjogcmdiKDE3LCA4NSwgMjA0KTsiPktpdHdhcmU8L2E+
Jm5ic3A7fCZuYnNwOzwvc3Bhbj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6IHZlcmRhbmEsIHNh
bnMtc2VyaWY7IGNvbG9yOiByZ2IoMTEsIDgzLCAxNDgpOyI+KDUxOCkgODgxLTQ0MTc8L3NwYW4+
PGJyPjwvZGl2PjxkaXY+PGRpdj48ZGl2PjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFu
YSwgc2Fucy1zZXJpZjsgY29sb3I6IHJnYigxMSwgODMsIDE0OCk7Ij48L3NwYW4+PC9kaXY+PC9k
aXY+PC9kaXY+PC9kaXY+" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px">​</div></div></div></div>