[vtkusers] Bug in vtkImageStencil

David Gobbi david.gobbi at gmail.com
Wed Nov 26 11:25:55 EST 2008


Hi Michael, Kevin,

I was the one who committed the new vtkPolyDataToImageStencil so I'll
take a look at the bounds issue.  Having the polydata outside of the
image bounds should not make this filter misbehave and it should
definitely not cause a crash.  Thanks for the example.

These days I only read the vtkusers list sporadically, and it's
probably the same for many developers, so please try to report bugs to
the bugtracker.  Otherwise your reports might go unnoticed.

   David


On Wed, Nov 26, 2008 at 4:32 AM, Michael Knopke <Michael.Knopke at gmx.de> wrote:
> Hi Kevin,
>
>
>
> Thanks for the example, but still no luck. If the stencil should cover both
> the image_data and the poly_data (that is used for stenciling) shouldn't it
> calculated like this?:
>
>   double max_bounds[6];
>
>   int sign =1;
>
>   for(int i=0;i<6;i++)
>
>     {
>
>      sign = sign*(-1);
>
>     if(sign<0)
>
>       {
>
>       if(poly_bounds[i]<image_bounds[i])max_bounds[i]=poly_bounds[i];
>
>       else max_bounds[i]=image_bounds[i];
>
>       }
>
>     else
>
>       {
>
>       if(poly_bounds[i]>image_bounds[i])max_bounds[i]=poly_bounds[i];
>
>       else max_bounds[i]=image_bounds[i];
>
>       }
>
>     }
>
>
>
>   int max_extent[6];
>
>   for ( int i = 0; i < 3; ++i )
>
>     {
>
>     max_extent[ i * 2 + 0 ] = 0;
>
>     max_extent[ i * 2 + 1 ] = (int)(
>
>       ( max_bounds[ i * 2 + 1 ] - max_bounds[ i * 2 + 0 ] )
>
>        /image_spacing[i]);
>
>     }
>
>
>
> However both approaches result in crashes, whenever my polydata leaves the
> image bounds.
> Regards,
>
>
>
> Michael
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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