DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2018-08-20, 23:46

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: dcm2json
PostPosted: Fri, 2017-05-12, 14:49 
Offline

Joined: Fri, 2017-05-12, 14:37
Posts: 2
Hi,

I'm playing around with the new dcm2json utility of the latest snapshot, thanks for that, it's pretty useful I think. One issue I have with it is the export of bulk binary data. It seems to always dump these, no matter which options I pass. Looking at the source code, I think this hasn't been implemented yet,
Code:
DcmJsonFormat::asBulkDataURI
always returns
Code:
false
. Am I correct?

Is there some workaround using dcmodify to achieve the same? I won't need the OB data, I just want to remove them from the json.

Marco


Top
 Profile  
 
 Post subject: Re: dcm2json
PostPosted: Fri, 2017-05-12, 17:06 
Offline

Joined: Tue, 2015-12-08, 15:49
Posts: 1
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:
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:
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;
}


Top
 Profile  
 
 Post subject: Re: dcm2json
PostPosted: Fri, 2017-05-12, 17:34 
Offline

Joined: Fri, 2017-05-12, 14:37
Posts: 2
Thanks for the quick solution!


Top
 Profile  
 
 Post subject: Re: dcm2json
PostPosted: Mon, 2017-12-11, 13:00 
Offline

Joined: Mon, 2017-12-11, 12:58
Posts: 1
Hello,

do you have an idea of when this update will be available ?

I tried to read the different source, in order to make the fix myself, but I didn't find where to implement your solution.

thanks
Olivier


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group