[vtkusers] Noisy errors from vtkMINCImageReader when optional dimension attributes are missing

Elvis Stansvik elvis.stansvik at orexplore.com
Wed Feb 24 10:06:04 EST 2016


2016-02-24 15:59 GMT+01:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:

> 2016-02-24 15:57 GMT+01:00 David Gobbi <david.gobbi at gmail.com>:
>
>> On Wed, Feb 24, 2016 at 7:31 AM, Elvis Stansvik <
>> elvis.stansvik at orexplore.com> wrote:
>>>
>>> Do things printed with vtkErrorMacro (like in vtkMINCImageAttributes)
>>> really pass through this observer mechanism?
>>>
>>
>> Yes, they do.  But it looks like the error is generated by the
>> vtkMINCImageAttributes object, so that's the object that needs to be
>> observed.  I'm not sure it can be accessed, but give it a try.
>>
>
> Ah, *facepalm*. Of course. I'll see if it can be done, otherwise I'll have
> to live with it.
>

This worked fine:

    def _handleMINCImageAttributesError(self, attributes, event):
        pass

and then

        self.reader = vtkMINCImageReader()
        self.reader.GetImageAttributes().AddObserver(
            vtkCommand.ErrorEvent, self._handleMINCImageAttributesError)

Good thing that the attributes object is available before the image has
been loaded.

I'll try to filter out just those bogus errors with some string matching.

Elvis


> Thanks,
> Elvis
>
>
>>
>>  - David
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160224/020a4a9b/attachment.html>


More information about the vtkusers mailing list