[Insight-users] UnaryFunctorImageFilter and MetaDataDictionnary

Bill Lorensen bill.lorensen at gmail.com
Tue Oct 27 10:07:41 EDT 2009


Another possibility is for the application to observe the EndEvent of
the filters and copy the input meta data dictionary to the output of
the filter. We might be able to package this into a helper class.

I'll look into this one.

Bill

On Tue, Oct 27, 2009 at 8:13 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> As Luis suggested we could add a method to ProcessObject. Maybe we
> call it CopyMetaDataDictionary(). We could make the invocation of this
> method conditional. For example, CopyMetaDataDictionaryFlagOn() Off().
> This would be off by default.
>
> Bill
>
> On Tue, Oct 27, 2009 at 8:00 AM, Julien Michel <julien.michel at c-s.fr> wrote:
>> Luis Ibanez a écrit :
>>>
>>> Julien,
>>>
>>> One possible way to go about it is to add to the itkProcessObject
>>> a method that will copy MetaDataDictionaries from one DataObject
>>> to another.
>>>
>>> As Bill pointed out, though, the challenge with the MetaData
>>> Dictionary is that filters do not know how to update it.
>>>
>>> For example:
>>>
>>> Even for the simple case of the pixe-wise filter, imagine that someone
>>> decides to store in the MetaDataDictionary the maximum and minimum
>>> intensity values of the image. Users would tend to do this using some
>>> arbitrary tag that is not necessarily an ITK standard.
>>>
>>> Filters such as the IntensityWindowing, Sigmoid, and Normalize, that
>>> change the intensity range of the image pixels will not properly update
>>> the MetaDataDictionary in order to reflect the changes in the image
>>> data.
>>>
>>>
>>> Of course, there are other types of data that may still be valid when
>>> passing through filters, but ... the bottom line is that the MetaData
>>> Dictionary becomes a carrier of information that can not be certified
>>> in a systematic way.
>>>
>>> We can still pass the dictionary around, but with the disclaimer that
>>> every application should use it at its own risk.
>>>
>>> Another option that comes to mind, (since you mention that you
>>> are deriving from the Image class), is to provide another virtual
>>> method in the itkImageBase class, that you could overload in you
>>> satellite image type. In this way, the action performed inside that
>>> method is really left to your custom implementation.
>>
>> Dear Luis,
>>
>> Thank you very much for your answer. I think it is a good idea to provide
>> customization points for users (even if they do not derive any classes) with
>> a default pass-through behaviour and a proper disclaimer. Virtual methods to
>> change the default behaviour might be handy as well.
>>
>> Actually, I though that the MetaDataDictionnary was indeed a customization
>> point for users (but it seems I have been mistaken, or if it is it misses
>> disclaimer and advertisement).
>>
>> I understand that CopyInformation() should not be used to propagate these
>> user defined informations and that my fix is harmful.
>>
>> It was the only solution we found to get our dictionnary copied (and it was
>> copied only if using our Image subclass redifining CopyInformation()).
>>
>> The handling of the user defined information should be left to a proper
>> virtual method (even outside GenerateOutputInformation()). This way we would
>> not need to call CopyInformation() in GenerateOutputInformation() anymore
>> (and we do not mix ITK internals with custom data).
>>
>> Bill, does this sounds like a good solution to you ?
>>
>> Best regards,
>>
>> Julien
>> --
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Julien MICHEL - Ingénieur d'études - Traitement d'images
>> CS Systèmes d'Information - Division ESPACE
>> Département Information Géographique & Image
>> Téléphone : +33 561 17 64 27
>> Email : julien.michel at c-s.fr
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>


More information about the Insight-users mailing list