Skip to content

Commit

Permalink
Merge pull request #2669 from michaelkain/fix-for-delete-dataset
Browse files Browse the repository at this point in the history
Fix for GitHub issue #2654: DICOM SEG not shown as overlay in OHIF
  • Loading branch information
michaelkain authored Feb 25, 2025
2 parents da480dd + dcac746 commit 436c808
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ public ResponseEntity findInstance(String studyInstanceUID, String serieInstance
if (entity != null) {
ByteArrayResource byteArrayResource = new ByteArrayResource(EntityUtils.toByteArray(entity));
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.setContentLength(entity.getContentLength());
if (!entity.isChunked() && entity.getContentLength() >= 0) {
responseHeaders.setContentLength(entity.getContentLength());
}
return new ResponseEntity(byteArrayResource, responseHeaders, HttpStatus.OK);
} else {
LOG.error("DICOMWeb: findInstance: empty response entity.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private Examination modifyDicom(Attributes datasetAttributes) {
Examination examination = examinationRepository.findById(examinationID).get();
// replace artificial examinationUID with real StudyInstanceUID in DICOM server
String studyInstanceUID = studyInstanceUIDHandler.findStudyInstanceUIDFromCacheOrDatabase(examinationUID);
datasetAttributes.setString(Tag.StudyInstanceUID, VR.UI, studyInstanceUID);
datasetAttributes.setString(Tag.StudyInstanceUID, VR.UI, studyInstanceUID);
// replace subject name, that is sent by the viewer wrongly with P-0000001 etc.
Optional<Subject> subjectOpt = subjectRepository.findById(examination.getSubject().getId());
String subjectName = "error_subject_name_not_found_in_db";
Expand All @@ -163,7 +163,7 @@ private Examination modifyDicom(Attributes datasetAttributes) {
}
datasetAttributes.setString(Tag.PatientName, VR.PN, subjectName);
datasetAttributes.setString(Tag.PatientID, VR.LO, subjectName);
// set user name, as person, who created the measurement
// set user name, as person, who created the measurement/segmentation
final String userName = KeycloakUtil.getTokenUserName();
datasetAttributes.setString(Tag.PersonName, VR.PN, userName);
// set as well person observer name in content sequence
Expand Down

0 comments on commit 436c808

Please sign in to comment.