[vtk-developers] Handling invalid vtp files

Will Schroeder will.schroeder at kitware.com
Sun Feb 14 07:18:27 EST 2010


Another option here is to create a filter (or family of filters) that can be
inserted into the pipeline to check for validity (there could be different
sorts of checks). The filter could be removed, or disabled with a flag, once
the application is being tuned for performance and the data is known to be
good. In my mind these validity checks are more like debugging tools and
should be able to easily removed when debugging is complete.


On Sat, Feb 13, 2010 at 9:52 PM, Berk Geveci <berk.geveci at kitware.com>wrote:

>
> Is vtkXMLReader::RequestData the right place in the pipeline to do this
>> kind of check?
>>
>> A simple thing could be to add something like:
>>
>> if(this->CurrentOutput->GetNumberOfElements(vtkDataObject::POINT) == 0)
>>   {
>>   return 0;
>>   }
>>
>> (Is there ever a time where there could be 0 points but still some
>> reasonable data set?)
>>
>
> Yes. It is possible. Let's say you have a multi-piece dataset where some of
> the pieces are empty but you still want associated meta-data that may be
> stored in the field data.
>
>
>> An extensive check would be to go through all the cells and make sure the
>> points that they reference actually exist. Maybe this could be a flag?
>>
>> reader->SetValidityCheck(true);
>>
>> The above would make the reader traverse the cells checking that they are
>> defined on valid geometry. If speed is a priority (for large data sets),
>> this option could be turned off.
>>
>> I wouldn't even bother with the flag. Even if you went over the whole cell
> array to make this check, compared to IO, it would be quite negligible.
>
> -berk
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>


-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100214/ede4fe89/attachment.html>


More information about the vtk-developers mailing list