[vtkusers] vtkDistanceWidget and Dicom Images

Leonardo M. Ramé l.rame at griensu.com
Tue Oct 19 13:18:06 EDT 2010


On 2010-10-19 13:09:51 -0400, John Drescher wrote:
> 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

Thanks, if I apply a spacing of 0.20, got it from dicom tag (0028,0030),
it measures exactly as the other Dicom Viewer.

...but, now my image is rendered too small, I have to zoom it with the
mouse. Is there a way to render it to fill the QVTKWidget regardless of
its size?

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com



More information about the vtkusers mailing list