Trying to fix T2072 revealed some issues with the AccessByItk macros provided in mitkImageAccessByItk.h .
1.) Some templates (ITK filter) can not be used with any primitive datatype in a meaningful way. With strict concept checking enabled in ITK, we would need a new macro which allows to specify a set of allowed pixel types in a mitk::Image.
2.) The error handling is inconsistent, when checking for pixel types and correct dimensions. Right now, specified dimensions are checked with "assert" (leading to inevitable program termination) and mitk::Image instances with non-matching pixel types trigger an output on the console (providing no means for users to check for errors).
I suggest the following:
ad 1.) Provide means to specify a list of allowed pixel types to be used in the multiplexing step.
ad 2.) Regard the calls to all AccessByItk macros as a contract on the allowed pixel types and dimensions and throw an exception in all cases where the mitk::Image does not comply with the allowed types, thus allowing users to correctly handle non-conforming image data.