<div>Hi,<br><br>I use vtkBorderWidget to select area of DICOM image on vtkImageViewer2. I want to set the initial left-bottom and right-top position of the vtkBorderWidget. Take the Coronal view for example, I get the display bounds of the image actor. These display bounds forms the left-bottom and right-top world coordinate. And then I call the vtkRenderer.WorldToView() to transform the world coordinate to view coordinate; with these 2 view coordinates, the vtkBorderWidget displays correctly. <br><br>The value of the display bounds is: MinX: 0, MaxX: 228.552734375, MinY: 114.052734375, MaxY: 114.052734375, MinZ: 0, MaxZ: 151.19<br><br>But, I use the methods of vtkBorderWidget to get the world coordinate of the left-bottom and right-top, the value is different from display bounds. The value is: x1 1.142763671875, x2 114.2763671875, y1 108.75879924706, y2 108.75879924706, z1 0.75595,   z2 75.595<br><br>Interesting thing is: x2 is half of MaxX, x1 is 1% of x2; z2 is half of MaxZ, z1 is 1% of z2. There might be some misunderstanding of VTK coordinate system.<br><br>My C# code is as follow. Where do I make mistake?<br><br>vtkImageActor actor = m_imageViewer.GetImageActor();<br>IntPtr boundsptr = actor.GetDisplayBounds();<br>double[] displaybounds= new double[ 6 ];<br>Marshal.Copy( boundsptr, displaybounds, 0, displaybounds.Length ); //Here I get the display bounds of vtkIamgeActor.<br><br>m_renderer.SetWorldPoint( displaybounds[ 1 ], displaybounds[ 3 ], displaybounds[ 5 ], 1 );<br>m_renderer.WorldToView();<br>double[] viewpint1 = m_renderer.GetViewPoint(); //Transform the world coordinate of right-top to view coordinate<br>m_renderer.SetWorldPoint( displaybounds[ 0 ], displaybounds[ 2 ], displaybounds[ 4 ], 1 );<br>m_renderer.WorldToView();<br>double[] viewpint = m_renderer.GetViewPoint(); //Transform the world coordinate of left-bottom to view coordinate<br>borderrep.GetPositionCoordinate().SetCoordinateSystemToView();<br>borderrep.GetPosition2Coordinate().SetCoordinateSystemToView();<br>borderrep.SetPosition( viewpint[ 0 ], viewpint[ 1 ] );<br>borderrep.SetPosition2( viewpint1[ 0 ], viewpint1[ 1 ] );<br><br>vtkCoordinate lowerleftCorr = borderrep.GetPositionCoordinate();<br>double[] lowerleft = lowerleftCorr.GetComputedWorldValue(m_renderer);<br>vtkCoordinate upperRightCorr = borderrep.GetPosition2Coordinate();<br>double[] upperright = upperRightCorr.GetComputedWorldValue(m_renderer);<br><br>displaybounds is: MinX: 0, MaxX: 228.552734375, MinY: 114.052734375, MaxY: 114.052734375, MinZ: 0, MaxZ: 151.19<br>lowerleft and upperright is: x1 1.142763671875, x2 114.2763671875, y1 108.75879924706, y2 108.75879924706, z1 0.75595, z2 75.595<br><br>Any tips on that? Thanks very much.<br><br>Liu Peng<br></div><br><br><span title="neteasefooter"><p> </p></span>