[vtkusers] display vtkImageData with no interpolation

David Gobbi david.gobbi at gmail.com
Wed Jun 3 16:55:03 EDT 2015


On Wed, Jun 3, 2015 at 2:51 PM, Angela Noecker <noeckera at gmail.com> wrote:

> What if I don't use ImageViewer, but manage vtkImageActors "manually"?
>

That was the example I gave first, though I accidentally missed one part:

    actor->GetProperty()->SetInterpolationTypeToNearest();

This assumes you are using VTK 5.10 or later (VTK 6 works too).

 - David



> On Wed, Jun 3, 2015 at 2:32 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>
>> If you display the images with nearest-neighbor interpolation, it should
>> give you the results that you want.  In my own pedantic interpretation
>> (^_^), displaying an image with "no interpolation" would mean displaying
>> each pixel as an infinitesimal point, which isn't really possible.
>>
>> For a vtkImageActor object or a vtkImageSlice object, the following
>> method should work:
>>
>>     actor->SetInterpolationTypeToNearest();
>>
>> For vtkImageViewer2,
>>
>>
>> viewer->GetImageActor()->GetProperty()->SetInterpolationTypeToNearest();
>>
>>  - David
>>
>>
>> On Wed, Jun 3, 2015 at 12:00 PM, Angela Noecker <noeckera at gmail.com>
>> wrote:
>>
>>> Can someone help me figure out how to display vtkImageData such that
>>> when I zoom way in I see sharp voxel corners and edges instead of blurry
>>> ones.  Is this even possible?  I understand that the display of
>>> vtkImageData is "point-based" and not "voxel-based."
>>>
>>> Thanks,
>>>
>>> Angela
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150603/ca72dfd2/attachment.html>


More information about the vtkusers mailing list