[vtkusers] vtkBorderWidget and vtkDICOMImageReader
Sam Raby
rabysam28 at gmail.com
Fri Apr 25 11:56:05 EDT 2014
I found the problem and fixed it, although I doubt what I did is the best
way.
I have the following lines of code in callback:
vtkCoordinate* lowerLeftCoordinate = static_cast<vtkBorderRepresentation*>
(borderWidget->GetRepresentation())->GetPositionCoordinate();
double* lowerLeftPoint =
lowerLeftCoordinate->GetComputedWorldValue(this->LeftRenderer);
BUT "lowerLeftPoint" does not consider the DICOM spacing. As the result, if
I divide the lowerLeftPoint by Spacing values, then the border totally
matches with the image coordinate.
The question remained for me is that how I can make GetComputedWorldValue
to consider Spacing without me hard coding it?
I appreciate any feedback on this,
Sam
On Fri, Apr 25, 2014 at 12:53 AM, Sam Raby <rabysam28 at gmail.com> wrote:
> Hi,
>
> I have modified the vtkBorderWidget example which has a moving window to
> show the region that is selected by vtkBorderWidget. I am using VTK6.
>
> As long as I use vtkJPEGReader, it works fine, but when I replace it with
> vtkDICOMImageReader to read a single file of DICOM, then the moving border
> does not show the exact region meaning that the region is a little off.
>
> I think the problem comes from the following line of code:
>
> imageClip->SetOutputWholeExtent(
> dicomReader->GetOutputInformation(0)->Get(
> vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT() ) );
>
> Would you hint me why jpg works just fine but for dicom reader (with a
> single file) the border and selected area are a little off and do not match?
>
> thanks
> sam
>
>
> [1] http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ImageClip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140425/94a4ef19/attachment.html>
More information about the vtkusers
mailing list