thanks for the info so far. I understand that a .mhd image can include custom tags that are read into ITK’s MetaDataDictionary for the ImageIOBase and then later handled by the application, perfectly fine (even though the current code for metaIO reading seems to ignore all user tags that are written below the ElementDataFile line in the mhd. So that workaround would work in case…
- rescaleIntercept/Slope are given as custom metadata attributes with e.g. the key “rescaleIntercept”/“rescaleSlope”, or with their corresponding DICOM key
- If these tags are listed above the ElementDataFile line in the .mhd (again, they seem to be ignored otherwise) - I can dig out more information if needed.
I was more interested in the two dedicated mod-tags ElementToIntensityFunctionSlope/Offset, which are seem to provide the same functionality, but which are listed in metaIO as dedicated tags for the image type. They are not forwarded as custom tags to ITK, so they are lost when reading an image with ITK, even though according to metaIO’s documentation, they are implemented for the exact same reason.
And, again, in case of DICOM, rescaleIntercept are applied while reading bulk data (voxels), see itkGDCMImageIO.cxx, line 327 ff., so this is not handled by the application but by ITK.
With this information, is there any further advice/comments on these three aspects (order of tags in the .mhd file / ElementToIntensityFunctionSlope / different behaviour for DICOM)?