[vtkusers] vtkDistanceWidget and Dicom Images

John Drescher drescherjm at gmail.com
Tue Oct 19 13:09:51 EDT 2010


On Tue, Oct 19, 2010 at 9:46 AM, Leonardo M. Ramé <l.rame at griensu.com> wrote:
> Hi, I use this code to add a vtkDistanceWidget to a scene showing a
> Dicom image:
>
> distanceWidget = vtkDistanceWidget::New();
> distanceWidget->SetInteractor(this->GetInteractor());
> static_cast<vtkDistanceRepresentation*>(distanceWidget->GetRepresentation())->SetLabelFormat("%-#6.2f mm");
> distanceWidget->On();
>
> The problem here is the measures I'm getting from the distance widget
> are not related to the real image. For example, when I measure one image
> with another Dicom viewer, it shows that I has 360mm width, and the
> vtkDistanceWidget says it has 1748,30mm.
>
> How can I define the relation between the size of the real image and the
> representation I'm showing on screen?
>

Is the spacing correct in the vtkImageData?

John



More information about the vtkusers mailing list