[vtkusers] Slice through vtkImageStencilData

Jothybasu Selvaraj jothybasu at gmail.com
Wed Oct 3 11:18:05 EDT 2012


But I think we can convert vtkImageStencilData into a vtkImageData
using vtkImageStencil (if you have the original image data & image
stencil data).

Something like this

vtkSmartPointer<vtkImageStencil>stencil2=
            vtkSmartPointer<vtkImageStencil>::New();
    stencil2->SetStencil(stencilData);
    stencil2->SetInput(imgData);
    stencil2->ReverseStencilOff();
    stencil2->SetBackgroundValue(0);
    stencil2->Update();

Jothy

On Wed, Oct 3, 2012 at 4:11 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Vincent,
>
> The quick answer is no, you cannot use vtkImageReslice to slice
> through a vtkImageStencilData.  The image input is not optional, and
> cannot be faked.
>
> But I don't know what you mean by "slice through, and display later".
> A vtkImageStencilData is already stored as a stack of slices, more or
> less.  Do you mean to slice through it in different directions, i.e.
> with XZ or YZ slices instead of XY slices?
>
>  - David
>
>
> On Wed, Oct 3, 2012 at 8:20 AM, Vincent LEFORT
> <vincent.lefort at aquilab.com> wrote:
>> Hello,
>>
>> Is it possible to slice through a vtkImageStencilData ?
>>
>> I know is it possible to get the result of a slice operation using a
>> vtkImageReslice and an input vtkImageStencilData (using
>> GenerateStencilOutputOn), and get the output stencil, but i would like the
>> same thing without using an entry in vtkImageReslice (but the entry 0 is not
>> optional).
>>
>> Maybe, there is an other way to do this (or generate a fake vtkImageData
>> without allocation of fake data) ?
>>
>> The final goal, is to have a very light structure to embed a bit volume
>> representation for contours/structure (1 bit indicate if we are inside a
>> contour or outside by voxel), and slice through, and display it after.
>>
>> Regards,
>>
>> Vincent
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



-- 
Jothybasu Selvaraj
PhD Student
University of Liverpool
UK



More information about the vtkusers mailing list