Closed Spenhouet closed 4 years ago
I just found the .to_json()
method in your code.
The working example then would be:
json.dump(nifti_wrapper.meta_ext.to_json(), configfile)
This answers my confusion.
I will close this issue but I want to note that I could not find this method in the documentation. You might want to add it there.
EDIT:
Also, .to_json()
does not return a json object. You will have to also do this:
json.loads(nifti_wrapper.meta_ext.to_json())
I'm a bit confused to why the DcmMetaExtension is not JSON serializable.
The documentation states:
I did expect the following to work:
but I only get: