[vtkusers] vtkImageReslice using stencil

David Gobbi david.gobbi at gmail.com
Mon Sep 20 10:09:55 EDT 2010


Hi Elias,

I recommend that you don't use vtkImageStencilData for what you are
doing.  Instead, you should first use reslice on just the region, and
then pad the output with vtkImagePadFilter:

 padFilter.SetInputConnection(reslice.GetOutputPort());
 reslice.SetOutputExtent(100, 300, 250, 300, 0, 0);
 padFilter.SetOutputExtent(0, 511,0,804,0,0);

With stencils, you cannot easily build a vtkImageStencilData from
scratch.  The vtkImageStencilData should be only be produced by a
source or filter.

  David






2010/9/20 E.R <frantic_tictoc83 at yahoo.gr>:
>  I have tried this..but I got a memory
>  error.."Attempted to read or write protected memory"...
>  What I am doing wrong????? :-|
>
>> --- Στις Δευτ., 20/09/10, ο/η Jim Peterson <jimcp at cox.net>
>> έγραψε:
>>
>> > Από: Jim Peterson <jimcp at cox.net>
>> > Θέμα: Re: [vtkusers] vtkImageReslice using
>> stencil
>> > Προς: "E.R" <frantic_tictoc83 at yahoo.gr>
>> > Κοιν.: vtkusers at vtk.org
>> > Ημερομηνία: Δευτέρα, 20
>> Σεπτέμβριος 2010, 15:15
>> > Elias,
>> > If I read that error message correctly, it sounds
>> like
>> > reslice.SetOutputExtent(100,300,250,300,0,0) ;
>> > would be accepted. The question is would it be the
>> desired
>> > result?
>> >
>> > HTH
>> > Jim
>> >
>> > E.R wrote:
>> > > Greetings!!
>> > >
>> > > I am using vtkImageReslice.setStencil() to limit
>> a
>> > specific area.
>> > > My code is like that:
>> > > vtkImageStencilData test = new
>> vtkImageStencilData();
>> > >
>> > > test.SetExtent(100, 300, 250, 300, 0, 0);
>> > >  reslice.SetStencil(test);
>> > >  reslice.SetOutputExtent(0, 511,0,804,0,0);
>> > >
>> > > but I am getting this error message:
>> > >
>> > > "The update extent specified in the information
>> for
>> > output port 0 on algorithm
>> vtkTrivialProducer(086731A0) is 0
>> > 511 0 804 0 0, which is outside the whole extent 100
>> 300 250
>> > 300 0 0."
>> > >
>> > > What I am doing wrong?? How I ll set the stencil
>> > inside my Image bounds?
>> > >
>> > > thanks in advance!
>> > >
>> > > Elias
>> > >
>> > >
>> > > _______________________________________________
>> > > 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
>> > >
>> > >
>> >
>> >
>>
>>
>>
>
>
> _______________________________________________
> 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
>



More information about the vtkusers mailing list