In a certain sense, your supposition is right. I couldn't been able to find the exact error you've got, but I found this sitkAddImageFilter implementation on GitHub. If you look at the AddImageFilter::Execute()
function, at line 33, you'll find this exception been throwed:
std::cerr << "Both image for add filter don't match type or dimension!" << std::endl;
that seems related to yours (maybe the slight difference is just related to a different version of ITK). And that exception is throwed whenever this is verified:
if ( type != image2->GetDataType() || dimension != image2->GetDimension() )
So, a condition for the AddImageFilter is that both dimensions must be the same, and the metadata associated with the images must agree. This makes sense, because matrices addition is doable only when their dimensions match (and, of course, when they contain the same kind of informations).
If you are trying to add two different kinds of images (as an example: a DICOM with a TIFF), I suggest to convert at least one of them, in a way to have both of them in the same "metadata space".