[vtkusers] Only half of pixels shown on border of Image.

Lisa Avila lisa.avila at kitware.com
Wed May 18 23:19:28 EDT 2005


Hi Michal,

This is the expected behavior of vtkImageActor. The issue is that in VTK 
the image is considered to go from the location of the first sample to the 
location of the last sample along some axis (if you have N samples, and a 
spacing of D, you have a distance of (N-1)*D between the first and last 
sample). Each internal sample (other than the first and last) impacts a 
linear distance of D, with the first and last sample each impacting 1/2 D. 
This keeps the total distance (N-1)*D. This makes sense and looks correct 
for linear interpolation, but does look strange for nearest neighbor 
interpolation since the edge pixels look to be cut in half. However, 
vtkImageData has point scalars, not cell scalars - so the value is 
associated with the point, and not the cell (space between points). If you 
have such a small image and you want to display it using cell scalars, I 
would recommend using a set of quads with associated cell scalars.

Lisa


At 03:42 PM 5/18/2005, sandarak at wp.pl wrote:
>Hello!
>
>When I'm trying to show very small image ( 5 x 5 ), with vtkImageActor
>the pixels on the border of the image are half-cut (I can see that
>clearly because the interpolation is turned off). How can I show whole
>pixels on border? Does it have anything to do with clipping?
>
>Thank you in advance
>
>Michal
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list