0
votes

I'm converting some legacy code to ITK 4.7 for dicom manipulation. I'm reading private image tags but getting results in Base64 encoded format for few private tags.

I wondered about the value I'm getting for a tag as

MlwtNVwyNSA= 

Basically it is encoded value for

2\-5\25 (in base64)

I know there is Base64.h that comes with gdcm library but question is is that header/functions part of ITK as well or do i need to create gdcm objects to convert the encoded values? or write my own C++ function for that conversion? What shall be the most efficient (if not native) way within ITK 4.7 library?

1

1 Answers

1
votes

By looking at the source code (gdcmBase64.h and .cxx), gdcm::Base64 is a self-contained class, which is independent from the rest of GDCM. Just #include "gdcmBase64.h", and call Encode and Decode as needed.

Alternatively, you can find implementations of base64 encoding and decoding and put them in your source file. base64 encoding is pretty simple.