Hello Marco,
the documentation is currently misleading (copy and paste error from dcm2xml), this will be fixed.
We will add a command line option to dcm2json for hiding binary data based on the VR.
At this stage dcm2json requires implementing a custom JSON formatter as in the example given in the
documentation.
(In the example is a litte Error, here corrected)
Code: Select all
struct BulkDataURIJsonFormat : DcmJsonFormatPretty
{
BulkDataURIJsonFormat(const OFBool printMetaheaderInformation = OFTrue,
... bulkDataURIDatabase)
: DcmJsonFormatPretty(printMetaheaderInformation)
, TheDatabase(bulkDataURIDatabase)
{
}
virtual OFBool asBulkDataURI(const DcmTagKey& tag, OFString& uri)
{
... result = TheDatabase.findBulkDataFor(tag);
if (result.found())
{
uri = result.uri();
return OFTrue;
}
return OFFalse;
}
... TheDatabase;
}
An example to hide all OW and OB information would be:
Code: Select all
virtual OFBool asBulkDataURI(const DcmTagKey& tag, OFString& uri)
{
if (DcmTag(tag).getEVR() == EVR_OB || DcmTag(tag).getEVR() == EVR_OW || DcmTag(tag).getEVR() == EVR_ox)
{
uri = "<<BINARY_DATA_OMITTED>>";
return OFTrue;
}
return OFFalse;
}