Skip to content

Commit

Permalink
DICOMDIR cannot be written if it contains special DICOM elements #586
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Sep 6, 2024
1 parent 12238a6 commit e45a4f9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ protected void writeDicom(
tsuid, onlyRaw, dicomEditors, jpegQuality, compressionRatio);
Attributes attributes = img.saveToFile(destinationFile, dicomExportParameters);
if (attributes != null) {
if (attributes.isEmpty()) {
attributes = img.getMediaReader().getDicomObject();
}
writeInDicomDir(writer, attributes, node, iuid, destinationFile);
}
} else if (node.getUserObject() instanceof DicomElement dcm) {
Expand All @@ -715,6 +718,9 @@ protected void writeDicom(
null, onlyRaw, getAttributeEditors(editor), jpegQuality, compressionRatio);
Attributes attributes = dcm.saveToFile(destinationFile, dicomExportParameters);
if (attributes != null) {
if (attributes.isEmpty()) {
attributes = dcm.getMediaReader().getDicomObject();
}
writeInDicomDir(writer, attributes, node, iuid, destinationFile);
}
} else if (node.getUserObject() instanceof Series) {
Expand Down

0 comments on commit e45a4f9

Please sign in to comment.