[vtkusers] Re: Overwriting original data after using stencil with vtkVolumeProVG500Mapper?

David Netherway david.netherway at adelaide.edu.au
Fri Feb 8 03:05:04 EST 2002


Hello David,

I get the same behaviour with ImageMask.

Lisa, I have posted some example code to the forum that shows the problem.

Thanks, David

----- Original Message -----
From: "David Gobbi" <dgobbi at irus.rri.ca>
To: "David Netherway" <david.netherway at adelaide.edu.au>
Sent: Friday, February 08, 2002 6:20 PM
Subject: Re: Overwriting original data after using stencil with
vtkVolumeProVG500Mapper?


> Hi David,
>
> I don't have one of the volume rendering cards and don't have
> much experience with VTK volume rendering, so you should probably
> send this to the user's list and CC to Lisa Avila at Kitware
> <lisa.avila at kitware.com>.
>
> Another quick thing to test though: to ensure that the problem
> is with the volume mapper and not with the stencil, could you
> try replacing vtkImageStencil with vtkImageMask in your test
> script?  It would go something like this:
>
>   vtkImageMask imageMask
>     imageMask SetInput [reader GetOutput]
>     imageMask SetMaskInput [ellipsoid GetOutput]
>     imageMask SetMaskedOutputValue 0
>     imageMask NotMaskOn
>
>   volumeMapper SetInput [imageMask GetOutput]
>
> If changing to vtkImageMask fixes the problem, then I'll check
> through vtkImageStencil.cxx to make sure that nothing funny is
> going on.
>
>  - David
>
> --
>   David Gobbi, MSc                       dgobbi at irus.rri.ca
>   Advanced Imaging Research Group
>   Robarts Research Institute, University of Western Ontario
>
> On Fri, 8 Feb 2002, David Netherway wrote:
>
> > Hello David,
> >
> > I finally found the source of the problem but not the answer.
> >
> > It is associated with using the vtkVolumeProMapper. The test examples I
was
> > putting together with small data sets used the raycaster without
problems.
> >
> > Attached is my test code showing the problem. If executed without the
last
> > line then the slices appropriately do not have the stencil applied.
> > After executing  "volumeMapper SetInput [imageStencil GetOutput]" and
> > updating the volPro image the slices show the stencil applied.
> >
> > I am using vtk4 from Feb 1, 2002 and the VolumeProVG500 card.
> >
> > Thanks, David
> >
> > ----- Original Message -----
> > From: "David Gobbi" <dgobbi at irus.rri.ca>
> > To: "David Netherway" <david.netherway at adelaide.edu.au>
> > Sent: Friday, February 08, 2002 2:32 PM
> > Subject: Re: [vtkusers] Overwriting original data after using stencil ?
> >
> >
> > > Hi David,
> > >
> > > You might want to try cutting vtkImageClip out of the pipeline, it
> > > does some funny tricks to save memory that don't always work right.
> > > Instead of actually cropping the data, it just changes the
'WholeExtent'
> > > information of the data so that downstream filters are fooled into
> > > thinking that the data is cropped.
> > >
> > > Another problem with vtkImageClip is that if you ask it to it will
> > > give you an extent e.g. (10,250,10,250,0,0) that doesn't start at 0
> > > and that therefore won't display properly in a vtkImageWindow.
> > >
> > > Usually, if I want to crop data, I use vtkImageReslice to do it
> > > by setting the reslice OutputOrigin() to the lower-left corner
> > > of my desired crop region and by setting the OutputExtent to the
> > > dimensions of the crop region e.g. SetOutputExtent(0,100,0,100,0,0)
> > > but I always make my extents start at 0 just to keep things consistent
> > > (and to keep the vtkImageViewer/Window from screwing up the display
> > > of the output).
> > >
> > >  - David
> > >
> > > --
> > >   David Gobbi, MSc                       dgobbi at irus.rri.ca
> > >   Advanced Imaging Research Group
> > >   Robarts Research Institute, University of Western Ontario
> > >
> > > On Fri, 8 Feb 2002, David Netherway wrote:
> > >
> > > > All of my test examples that I have been working on do not show a
> > problem.
> > > > So I am still working on where the problem actually is. If not a
simple
> > > > programming error I will post the information.
> > > >
> > > > Thanks for the help.
> > > >
> > > > David
> > > >
> > > > ----- Original Message -----
> > > > From: "David Gobbi" <dgobbi at irus.rri.ca>
> > > > To: "David Netherway" <david.netherway at adelaide.edu.au>
> > > > Sent: Wednesday, February 06, 2002 12:52 PM
> > > > Subject: Re: [vtkusers] Overwriting original data after using
stencil ?
> > > >
> > > >
> > > > > Hi David,
> > > > >
> > > > > I took a quick glance through vtkImageStencil.cxx, and it doesn't
have
> > > > > any obvious mistakes in it that would make it overwrite its input.
> > > > >
> > > > > If you can put together a short test script that demonstrates the
> > problem
> > > > > (using either the new VTK 4.0 VTKData or the old VTK 3.x VTKData)
then
> > I
> > > > > can check it for you and either identify the VTK bugs or tell you
what
> > is
> > > > > wrong with the script.
> > > > >
> > > > >  - David
> > > > >
> > > > >
> > > > > On Wed, 6 Feb 2002, David Netherway wrote:
> > > > >
> > > > > > Hello David,
> > > > > >
> > > > > > Sorry, clip was created as below:
> > > > > > vtkImageClip clip
> > > > > >   clip ByPassOn
> > > > > >   clip SetInput [$reader GetOutput]
> > > > > >   clip SetOutputWholeExtent $xNMin $xNMax $yNMin $yNMax $zNMin
> > $zNMax
> > > > > >   clip ClipDataOff
> > > > > >  clip ReleaseDataFlagOff
> > > > > >
> > > > > > Actually for the data being processed clip was not needed so I
took
> > it
> > > > out
> > > > > > of the pipeline so that where clip appears in my original email
the
> > data
> > > > is
> > > > > > sourced from an vtkImageAppend. The same behaviour occurs.
> > > > > >
> > > > > > vtkImageAppend append
> > > > > >   ... appends data from a set of reslicers
> > > > > >
> > > > > > set reader append
> > > > > >
> > > > > > viewer SetInput [$reader GetOutput]
> > > > > > # the viewer displays the initial data of interest with the
> > following
> > > > using
> > > > > > the WindowLevelIntercface.tcl
> > > > > >
> > > > > > volumeMapper SetInput [$reader GetOutput]
> > > > > >
> > > > > > vtkVolume volume
> > > > > >   volume SetMapper volumeMapper
> > > > > >   volume SetProperty volumeProperty
> > > > > > vtkRenderer renderer
> > > > > >   renderer AddVolume volume
> > > > > >
> > > > > > vtkImageStencil imageStencil
> > > > > >   imageStencil SetInput [$reader GetOutput]
> > > > > >   imageStencil SetBackgroundValue 0
> > > > > >   imageStencil SetStencil [stencil GetOutput]
> > > > > >
> > > > > > volumeMapper SetInput [imageStencil GetOutput]
> > > > > > # display etc...
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "David Gobbi" <dgobbi at irus.rri.ca>
> > > > > > To: "David Netherway" <david.netherway at adelaide.edu.au>
> > > > > > Cc: <vtkusers at public.kitware.com>
> > > > > > Sent: Wednesday, February 06, 2002 12:06 PM
> > > > > > Subject: Re: [vtkusers] Overwriting original data after using
> > stencil ?
> > > > > >
> > > > > >
> > > > > > > Hi David,
> > > > > > >
> > > > > > > You are correct that the vtkImageViewer display should not
change
> > > > > > > (I'm guessing the 'viewer' is a vtkImageViewer) but I have no
idea
> > > > > > > what a 'vtkClip' is since there is no such class in VTK...
> > > > > > >
> > > > > > >  - David
> > > > > > >
> > > > > > >
> > > > > > > On Wed, 6 Feb 2002, David Netherway wrote:
> > > > > > >
> > > > > > > > I had some behaviour that I did not expect and would like
some
> > > > comments.
> > > > > > I
> > > > > > > > will try to reproducee the code flow removing all of the
> > extraneous
> > > > > > stuff.
> > > > > > > >
> > > > > > > > vtkClip clip
> > > > > > > > clip SetInput [reader GetOutput]
> > > > > > > > # set clip range etc...
> > > > > > > >
> > > > > > > > viewer SetInput [clip GetOutput]
> > > > > > > > # the viewer displays the initial data of interest with the
> > > > following
> > > > > > using
> > > > > > > > the WindowLevelIntercface.tcl
> > > > > > > >
> > > > > > > > volumeMapper SetInput [clip GetOutput]
> > > > > > > >
> > > > > > > > vtkVolume volume
> > > > > > > >   volume SetMapper volumeMapper
> > > > > > > >   volume SetProperty volumeProperty
> > > > > > > > vtkRenderer renderer
> > > > > > > >   renderer AddVolume volume
> > > > > > > >
> > > > > > > > vtkImageStencil imageStencil
> > > > > > > >   imageStencil SetInput [clip GetOutput]
> > > > > > > >   imageStencil SetBackgroundValue 0
> > > > > > > >   imageStencil SetStencil [stencil GetOutput]
> > > > > > > >
> > > > > > > > volumeMapper SetInput [imageStencil GetOutput]
> > > > > > > > # display etc...
> > > > > > > >
> > > > > > > > The stencil is applied appropriately but the clip output now
> > shows
> > > > the
> > > > > > > > effect of the stencil even though I have not changed the
viewer
> > > > input.
> > > > > > > > I was not expecting this. I expected the clip output data
would
> > be
> > > > stay
> > > > > > the
> > > > > > > > same.
> > > > > > > >
> > > > > > > > Does someone expect this behaviour? I would appreciate some
> > > > comments.
> > > > > > > >
> > > > > > > > Thanks, David
> > > > > > > >
> > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > This is the private VTK discussion list.
> > > > > > > > Please keep messages on-topic. Check the FAQ at:
> > > > > > <http://public.kitware.com/cgi-bin/vtkfaq>
> > > > > > > > Follow this link to subscribe/unsubscribe:
> > > > > > > > http://public.kitware.com/mailman/listinfo/vtkusers
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>




More information about the vtkusers mailing list