[vtkusers] vtkImageHistogramStatistics but exclude values below a certain threshold?

David Gobbi david.gobbi at gmail.com
Fri Sep 2 10:19:31 EDT 2016


Hi Elvis,

Yes, by using a stencil.  It requires an extra step.

First, you need to make a stencil with vtkImageToImageStencil.  The API of
this filter is similar to vtkImageThreshold, but instead of outputting a
vtkImageData, it outputs a vtkImageStencilData.  The vtkImageStencilData
object is a run-length compressed binary image, i.e. it is a mask.

Second, you need to pass the stencil to vtkImageHistogramStatistics via the
SetStencilConnection() method or via the SetStencilData() method.

The result: the stats are only computed for the voxels that are inside the
stencil.

 - David



On Fri, Sep 2, 2016 at 8:10 AM, Elvis Stansvik <elvis.stansvik at orexplore.com
> wrote:

> I'd like to use vtkImageHistogramStatistics to compute min, max, mean, std
> et.c, but exclude values in the input image that fall below a certain
> threshold. Is this possible somehow?
>
> Thanks,
> Elvis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160902/56ec4068/attachment.html>


More information about the vtkusers mailing list