[vtkusers] vtk zoom indicator

Sankhesh Jhaveri sankhesh.jhaveri at kitware.com
Tue Nov 7 11:07:32 EST 2017


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.

Something like this:

double * leftPoint =
axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);double
* rightPoint = axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);double
distance = vtkMath::sqrt(vtkMath::Distance2BetweenPoints(leftPoint,
rightPoint));// Scale is 1 : distance

Hope that helps.

Best,
Sankhesh
​

On Tue, Nov 7, 2017 at 4:30 AM K O ranjith <kor1581 at gmail.com> wrote:

> Hello,
> Thanks, it's  working.
> Can I get the measured value (which is displayed as label axis) from
> vtkLegendScaleActor object.
>
> Ranjith KO
>
> On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri <
> sankhesh.jhaveri at kitware.com> wrote:
>
>> Take a look at vtkLegendScaleActor
>> <http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LegendScaleActor>.
>> It uses vtkAxisActor
>> <http://www.vtk.org/doc/nightly/html/classvtkAxisActor.html> internally.
>>
>> Hth,
>> Sankhesh
>>>>
>> On Fri, Jun 23, 2017 at 1:55 AM K O ranjith <kor1581 at gmail.com> wrote:
>>
>>> I'm using vtk for developing a MRI DICOM Image viewer in Qt.
>>> The viewer uses vtkDICOMImageReader,  vtkImageViewer2 & QVTKWidget.
>>> I need to show a zoom indicator line which varies length 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.
>>> I added an line as an vtkactor  to the renderer using vtkLineSource.
>>>  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.
>>> How can I make the position of the line fixed at side of the viewer.
>>> Have any option in vtk for visual indication of zoom factor something
>>> like vtkOrientationMarkerWidget for orientation...
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>
>> --
>> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
>> <http://www.kitware.com/> | (518) 881-4417
>>>>
>
> --
Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
<http://www.kitware.com/> | (518) 881-4417
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171107/eb01c2ac/attachment.html>


More information about the vtkusers mailing list