Weasis 3.0.2 not exporting MPR reformats

75 views
Skip to first unread message

Logi Vidarsson

unread,
Oct 26, 2018, 3:55:52 PM10/26/18
to dcm4che
Greetings

Thanks for a very nice DICOM viewer and tool, Weasis is easy to use yet has powerful features.

I was unable to save reformats generated by Weasis for further analysis in another tool. I can save .png, .jpg but no DICOM. To reproduce the issue, this is what I did:

1. Start Weasis-portable (I used both linux and windows), version 3.0.2
2. Load a suitable DICOM data-set
3. Click the MPR button
4. Click Export DICOM, select the newly created MPR series
5. Export to DICOM file to a directory on my hard-drive

This only generates the DICOM dir file (and if you selected any DICOM files belonging to your original data, these are exported as well) but no MPR DICOM files!

Being a tinkerer at heart, and Weasis being open source (thank you again;) I went in and fixed it, not sure if this breaks anything else, but I figured Id share the fix with you guys so that you may at least consider it.

Its simple, in the file RawImageIO.java (under weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/mpr) near line 94:

Change This

BulkData bdl = new BulkData(file.toURI().toString(), FileRawImage.HEADER_LENGTH, (int) file.length(), false);

To that

BulkData bdl = new BulkData(file.toURI().toString(), FileRawImage.HEADER_LENGTH, (int) file.length() - FileRawImage.HEADER_LENGTH, false);

Also, I did notice that once I got generating Weasis files, the TransferSynthaxUID somehow goes in there twice (presumably as during the MPR process all DICOM tags from the parent are copied over), this can bother some DICOM viewers/PACS systems. Hence I added in the blirp just below my edit above:

// check to see if the transfer synthax UID tag is present, if so, kick it out as dcm4chee adds it in
if(dcm.contains(Tag.TransferSyntaxUID))
{        
      dcm.remove(Tag.TransferSyntaxUID);
      LOGGER.warn("Removing duplicate TransferSynthax UID");
}

Happy Friday to you all

Logi




Nicolas Roduit

unread,
Oct 27, 2018, 11:16:51 AM10/27/18
to dcm4che
Thanks for your concise description.

It is a bug introduced in version 3.

I'm moving the issues system from JIRA to GitHub. So I fill two bugs and confirmed that your fix solves the problem.
Reply all
Reply to author
Forward
0 new messages