[Insight-users] UnaryFunctorImageFilter and MetadataDictionnary handling

Luis Ibanez luis.ibanez at kitware.com
Sat Mar 17 19:37:32 EST 2007


Hi Julien,


Thanks for reporting this problem in such a detailed manner.


This looks like a real bug in this class.

Could you please create a bug entry for this problem
in the phpBugTracker ?

      http://public.kitware.com/Bug/index.php

If you don't have an account yet, you can create it by
just providing your email and using the "Create New Account"
button on the top bar of the page.


Please let us know if you find any difficulty
creating the bug entry.



     Thanks



        Luis


-----------------------
Julien Michel wrote:
> Dear ITK users,
> 
> We are using the MetaDataDictionary attribute of the class itk::Object 
> to store additionnal metadata in our custom Image class, deriving from 
> itk::Image.
> 
> In order to get these metadata propagated through the pipeline, we did 
> override the CopyInformation(DataObject * data) method of our Image 
> class, first calling the superclass implementation, and then copy the 
> MetaDataDictionary of data into our own MetaDataDictionary attribute. 
> This method is usually called in the GenerateOutputInformation() method 
> of the filters.
> 
> The most high level implementation of GenerateOutputInformation() is 
> provided by itk::ProcessObject, which calls the CopyInformation() from 
> input to output.
> 
> itk::ImageToImageFilter override this method, doing some more copying, 
> but it first calls the Superclass implemntation, so the 
> CopyInformation() is used. Therefore Filters deriving directly from this 
> class (such as itk::DiscreteGaussianImageFilter) propagates our metadata 
> through the pipeline.
> 
> The problem appears with the itk::UnaryFunctorImageFilter. It derives 
> from itk::ImageToImageFilter, but it overrides the 
> GenerateOutputInformation(), without calling the Superclass 
> implementation (for dimensions reasons) and without doing a 
> CopyInformation() from input to output by itself. Therefore our metadata 
> are lost whenever there is a filter deriving from 
> itk::UnaryFunctorImageFilter in our pipeline.
> 
> It might not be the only base class to behave like this (maybe 
> itk::BinaryFunctorImageFilter does the same), but I did not check for 
> the moment.
> 
> I don't know if it is a known issue, or if it has been implemented like 
> this willingly for some reason. Anyway, I wanted to report it.
> 
> Thanks a lot for your work, I hope this will contribute a little,
> 
> Best Regards,
> 
> Julien
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list