To be able to add a new function into itk::ImageFileReader, you would have to modify the class, or template specialize it. The only template parameter that this class takes is your image type, which in turn takes a pixel type and a dimension. The IO is not specified as a template parameter, and therefore you cannot, as is, use some template specialization or SFINAE techniques to do what you want.
The current way of doing what you are talking about is:
- Do what @dzenanz suggested and add that new function on the IO
- Do not add a function but simply add data in the metadata dictionary. This is probably what you want to do if you are only talking about data/values to be added to your object.
A different approach would be to create a new type of image, which would take a dummy template parameter. That dummy template parameter could be used to specialize your reader based on your knowledge at compile time in this case. Note, I haven’t tested that option, but I would think that it works.