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

Elvis Stansvik elvis.stansvik at orexplore.com
Fri Sep 2 11:10:58 EDT 2016


2016-09-02 16:19 GMT+02:00 David Gobbi <david.gobbi at gmail.com>:

> 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.
>

Excellent, many thanks David.

Elvis


>
>  - 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/9d36a62c/attachment.html>


More information about the vtkusers mailing list