<div dir="ltr">I found the problem and fixed it, although I doubt what I did is the best way.<div><br><div>I have the following lines of code in callback:</div><div><br></div><div>vtkCoordinate* lowerLeftCoordinate = static_cast<vtkBorderRepresentation*> (borderWidget->GetRepresentation())->GetPositionCoordinate();</div>
<div>double* lowerLeftPoint = lowerLeftCoordinate->GetComputedWorldValue(this->LeftRenderer);<br></div><div><br></div><div>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.</div>
<div><br></div><div>The question remained for me is that how I can make GetComputedWorldValue to consider Spacing without me hard coding it? </div><div><br></div><div>I appreciate any feedback on this,</div><div>Sam </div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 25, 2014 at 12:53 AM, Sam Raby <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.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">Hi,<div><br></div><div>I have modified the vtkBorderWidget example which has a moving window to show<span style="line-height:19.04166603088379px;font-size:12.666666984558105px;font-family:sans-serif"> </span><span style="line-height:19.04166603088379px;font-size:12.666666984558105px;font-family:sans-serif">the region that is selected by </span>vtkBorderWidget. I am using VTK6.</div>
<div><br></div><div>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. </div>
<div><br></div><div>I think the problem comes from the following line of code:</div><div><br></div><div> imageClip->SetOutputWholeExtent( dicomReader->GetOutputInformation(0)->Get( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT() ) );<br>
</div><div><br></div><div>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?<br></div><div><br></div><div>thanks</div><div>
sam</div>
<div><br></div><div><br></div><div>[1] <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ImageClip" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ImageClip</a></div></div>
</blockquote></div><br></div>