[vtkusers] Filter to label voxels which are (partially) inside a box

Bryn Lloyd lloyd at itis.ethz.ch
Fri Jan 6 12:27:11 EST 2012


Great, I didn't know those classes.

Thanks David!


On 1/6/2012 6:17 PM, David Gobbi wrote:
> Yes, although it is a two-step process.  The VTK imaging pipeline has
> a type called vtkImageStencilData that is an image mask stored with
> run-length compression.
>
> For boxes, spheres, cylinders, etc. you can use vtkROIStencilSource
> followed by vtkImageStencilToImage.
>
>   stencilSource->SetBounds(bounds); // bounds for box
>   stencilSource->SetOutputWholeExtent(extent); // extent of whole image
>   stencilToImage->SetInputConnection(stencilSource->GetOutputPort());
>   // output of stencilToImage is a binary image
>
> For implicit functions, you can use vtkImplicitFunctionToImageStencil
> followed by vtkImageStenclToImage.  This is not as efficient as the
> vtkROIStencilSource.
>
>   - David
>
> On Fri, Jan 6, 2012 at 9:50 AM, Bryn Lloyd<lloyd at itis.ethz.ch>  wrote:
>> Hi
>>
>> Is there a filter which would allow me to create a mask image from a box (or
>> general implicit function)?
>>
>> The output image would contain zeros and ones, for inside and outside the
>> box.
>>
>> Thanks
>> Bryn



More information about the vtkusers mailing list