# HG changeset patch # User Sebastien Jodogne # Date 1547200915 -3600 # Node ID 1bedab6993d4222984b51b1b4b5b42fe732824fc # Parent 897d539ae0e979792f044e71342644a8ab5785f4# Parent 495ec3d3893dcc40df995c171cba62c51f8a4d58 integration mainline->db-changes diff -r 897d539ae0e9 -r 1bedab6993d4 .hgignore --- a/.hgignore Thu Jan 10 18:03:04 2019 +0100 +++ b/.hgignore Fri Jan 11 11:01:55 2019 +0100 @@ -3,3 +3,4 @@ CMakeLists.txt.user *.cpp.orig *.h.orig +.vs/ diff -r 897d539ae0e9 -r 1bedab6993d4 Core/DicomNetworking/Internals/FindScp.cpp --- a/Core/DicomNetworking/Internals/FindScp.cpp Thu Jan 10 18:03:04 2019 +0100 +++ b/Core/DicomNetworking/Internals/FindScp.cpp Fri Jan 11 11:01:55 2019 +0100 @@ -166,6 +166,28 @@ } + static void FixFindQuery(DicomMap& target, + const DicomMap& source) + { + // "The definition of a Data Set in PS3.5 specifically excludes + // the range of groups below group 0008, and this includes in + // particular Meta Information Header elements such as Transfer + // Syntax UID (0002,0010)." + // http://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_C.4.html#sect_C.4.1.1.3 + // https://groups.google.com/d/msg/orthanc-users/D3kpPuX8yV0/_zgHOzkMEQAJ + + DicomArray a(source); + + for (size_t i = 0; i < a.GetSize(); i++) + { + if (a.GetElement(i).GetTag().GetGroup() >= 0x0008) + { + target.SetValue(a.GetElement(i).GetTag(), a.GetElement(i).GetValue()); + } + } + } + + void FindScpCallback( /* in */ @@ -255,7 +277,10 @@ DicomMap input; FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers); - data.findHandler_->Handle(data.answers_, input, sequencesToReturn, + DicomMap filtered; + FixFindQuery(filtered, input); + + data.findHandler_->Handle(data.answers_, filtered, sequencesToReturn, *data.remoteIp_, *data.remoteAet_, *data.calledAet_, modality.GetManufacturer()); ok = true; diff -r 897d539ae0e9 -r 1bedab6993d4 Core/DicomParsing/DicomDirWriter.cpp --- a/Core/DicomParsing/DicomDirWriter.cpp Thu Jan 10 18:03:04 2019 +0100 +++ b/Core/DicomParsing/DicomDirWriter.cpp Fri Jan 11 11:01:55 2019 +0100 @@ -410,7 +410,14 @@ switch (level) { case ResourceType_Patient: - found = GetUtf8TagValue(id, dataset, encoding, DCM_PatientID); + if (!GetUtf8TagValue(id, dataset, encoding, DCM_PatientID)) + { + // Be tolerant about missing patient ID. Fixes issue #124 + // (GET /studies/ID/media fails for certain dicom file). + id = ""; + } + + found = true; type = ERT_Patient; break; diff -r 897d539ae0e9 -r 1bedab6993d4 NEWS --- a/NEWS Thu Jan 10 18:03:04 2019 +0100 +++ b/NEWS Fri Jan 11 11:01:55 2019 +0100 @@ -14,7 +14,10 @@ Maintenance ----------- +* Don't consider tags whose group is below 0x0008 in C-FIND SCP +* Fix issue #21 (DICOM files missing after uploading with Firefox) * Fix issue #118 (Wording in Configuration.json regarding SynchronousCMove) +* Fix issue #124 (GET /studies/ID/media fails for certain dicom file) * Fixed Orthanc Explorer on IE and Firefox: Explorer always show "too many results" and it's therefore impossible to browse the content. * Upgraded dependencies for static and Windows builds: diff -r 897d539ae0e9 -r 1bedab6993d4 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Thu Jan 10 18:03:04 2019 +0100 +++ b/OrthancExplorer/explorer.html Fri Jan 11 11:01:55 2019 +0100 @@ -1,627 +1,642 @@ - - - - Orthanc Explorer + + + + + Orthanc Explorer - - - - - - - - - - - - - - - + + + + + + - - - - + + + + + + + + + + + + + - - - - - - - -
-
-

Lookup studies

-
- Lookup - Plugins -
- + + + + + + + + +
+
+

Lookup studies

+ -
-
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
-
 
-
-
-
-
-

Warning:

Your lookup led to many results! - Showing only ? studies to - avoid performance issue. Please make your query more - specific, then relaunch the lookup. -
-
 
-
-
    -
-
+
+
+
+
+ + +
-
-
-

All patients

-
- Lookup - Plugins +
+ + +
+ +
+ + +
+ +
+ +
-
- Upload - Query/Retrieve - Jobs + +
+ +
-
-
-
+ +
+ + +
+ +
+
+
 
+ +
+
-

Warning:

This is a large Orthanc server. Showing - only ? patients to avoid - performance issue. Make sure to use lookup if targeting - specific patients! +

Warning:

Your lookup led to many results! + Showing only ? studies to + avoid performance issue. Please make your query more + specific, then relaunch the lookup.
 
-
    -
-
-
- -
-
-

All studies

-
- Lookup - Plugins -
- -
-
-
-
-

Warning:

This is a large Orthanc server. Showing - only ? studies to avoid - performance issue. Make sure to use lookup if targeting - specific studies! -
-
 
-
-
    +
+
-
-
-

Upload DICOM files

-
- Lookup - Plugins -
+
+
+

All patients

+ -
-
- + +
+
+
+
+

Warning:

This is a large Orthanc server. Showing + only ? patients to avoid + performance issue. Make sure to use lookup if targeting + specific patients!
-

-

-
- -
-
-

-
    -
  • Drag and drop DICOM files here
  • -
+
 
+
+
    +
+
+
+ +
+
+

All studies

+
+ Lookup + Plugins +
+ +
+
+
+
+

Warning:

This is a large Orthanc server. Showing + only ? studies to avoid + performance issue. Make sure to use lookup if targeting + specific studies! +
+
 
+
+
    +
+
+
+ +
+
+

Upload DICOM files

+
+
+
+ + +
+

+

+
+ +
+
+

+
+

Warning:

Orthanc issue #21: On Firefox, especially on + Linux & OSX systems, files might be missing if using + drag-and-drop. Please use the "Select files to upload" button + instead, or use the command-line "ImportDicomFiles.py" script. +
+
    +
  • Drag and drop DICOM files here
  • +
+
+
-
-
-

Patient

-
- Lookup - Plugins -
- +
+
+

Patient

+ -
-
-
-
-
    -
-

-

- -
-

- + +
+
+
+
+
+
    +
+

+

+ +
+

+ - -
+
-
-
-
    -
-
+
+
+
+
    +
+
-
-
-

- - Patient » - Study -

-
- Lookup - Plugins +
+
+

+ + Patient » + Study +

+
+ Lookup + Plugins +
+ +
+
+
+ -
- Upload - Query/Retrieve - Jobs +
+
+
    +
+
-
-
-
-
-
    -
+
+
- +
+
+

+ + Patient » + Study » + Series +

+
+ Lookup + Plugins +
+ +
+
+ +
+
+
    +
-
-
-
    -
+
+
+
+
+ +
+
+

+ + Patient » + Study » + Series » + Instance +

+
+ Lookup + Plugins +
+ +
+
+
+ +
+
+
+

DICOM Tags

+

+ + +

+
- -
-
-

- - Patient » - Study » - Series -

-
- Lookup - Plugins -
- -
-
-
-
-
-
    -
+
- +
+
+

Plugins

+
+ Lookup + Plugins +
+
+
+
    +
+
+
- -
-
-
-
-
    -
-
-
-
+
+
+

DICOM Query/Retrieve (1/4)

+
+
+
+
+ + +
-
-
-

- - Patient » - Study » - Series » - Instance -

-
- Lookup - Plugins +
+
+ Field of interest: + + + + + + + + +
- -
-
-
-
-
-
    -
- +
+ + +
+ +
+ + +
- -
-
-
-
-
-

DICOM Tags

-

- - -

-
-
-
+
+
+
+ Modalities: + + + + + + + + + +
-
+ +
+
+ +
+
+ +
+
+
+
+ -
-
-

Plugins

-
- Lookup - Plugins -
+
+
+

DICOM Query/Retrieve (2/4)

+ -
-
    -
+ Query/Retrieve +
+
+
    +
+
+
+ + +
+
+

DICOM Query/Retrieve (3/4)

+ + Query/Retrieve +
+
+
    +
+
+
+ + +
+
+

DICOM Query/Retrieve (4/4)

+
+ Lookup + Plugins +
+ Query/Retrieve
-
-
-

DICOM Query/Retrieve (1/4)

-
- Lookup - Plugins -
-
-
-
-
- - -
- -
-
- Field of interest: - - - - - - - - -
-
- -
- - -
- -
- - -
- -
-
-
- Modalities: - - - - - - - - - -
-
-
- -
-
- -
-
- -
-
-
-
-
- - -
-
-

DICOM Query/Retrieve (2/4)

-
- Lookup - Plugins +
+
+
+ +
- Query/Retrieve -
-
-
    -
-
-
- - -
-
-

DICOM Query/Retrieve (3/4)

-
- Lookup - Plugins -
- Query/Retrieve -
-
-
    -
-
-
- - -
-
-

DICOM Query/Retrieve (4/4)

-
- Lookup - Plugins -
- Query/Retrieve -
- -
- -
- - -
- -
-
-
- -
-
-
- -
-
- - -
-
-

Jobs

-
- Lookup - Plugins -
-
-
-
    -
-
-
- -
-
-

Job

-
- Lookup - Plugins -
-
- Jobs -
-
-
-
    -
-
- - - - +
+
-
+ + +
+
+ + +
+
+

Jobs

+
+ Lookup + Plugins +
+
+
+
    +
+
+
+ +
+
+

Job

+
+ Lookup + Plugins +
+
+ Jobs
+
+
    +
- - - +
- + + + - - + + + + + diff -r 897d539ae0e9 -r 1bedab6993d4 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Thu Jan 10 18:03:04 2019 +0100 +++ b/OrthancExplorer/explorer.js Fri Jan 11 11:01:55 2019 +0100 @@ -27,10 +27,12 @@ function ChangePage(page, options) { - let first = true; + var first = true; + var value; + if (options) { - for (let key in options) { - let value = options[key]; + for (var key in options) { + value = options[key]; if (first) { page += '?'; first = false; @@ -63,7 +65,7 @@ $(document).ready(function() { - let $tree = $('#dicom-tree'); + var $tree = $('#dicom-tree'); $tree.tree({ autoEscape: false }); @@ -124,7 +126,7 @@ if (s == undefined) return "No date"; - let d = ParseDicomDate(s); + var d = ParseDicomDate(s); if (d == null) return '?'; else @@ -134,16 +136,16 @@ function Sort(arr, fieldExtractor, isInteger, reverse) { - let defaultValue; + var defaultValue; if (isInteger) defaultValue = 0; else defaultValue = ''; arr.sort(function(a, b) { - let ta = fieldExtractor(a); - let tb = fieldExtractor(b); - let order; + var ta = fieldExtractor(a); + var tb = fieldExtractor(b); + var order; if (ta == undefined) ta = defaultValue; @@ -226,11 +228,13 @@ function FormatMainDicomTags(target, tags, tagsToIgnore) { - for (let i in tags) + var v; + + for (var i in tags) { if (tagsToIgnore.indexOf(i) == -1) { - let v = tags[i]; + v = tags[i]; if (i == "PatientBirthDate" || i == "StudyDate" || @@ -254,7 +258,7 @@ function FormatPatient(patient, link, isReverse) { - let node = $('
').append($('

').text(patient.MainDicomTags.PatientName)); + var node = $('
').append($('

').text(patient.MainDicomTags.PatientName)); FormatMainDicomTags(node, patient.MainDicomTags, [ "PatientName" @@ -268,7 +272,8 @@ function FormatStudy(study, link, isReverse, includePatient) { - let label; + var label; + var node; if (includePatient) { label = study.Label; @@ -276,7 +281,7 @@ label = study.MainDicomTags.StudyDescription; } - let node = $('
').append($('

').text(label)); + node = $('
').append($('

').text(label)); if (includePatient) { FormatMainDicomTags(node, study.PatientMainDicomTags, [ @@ -296,7 +301,9 @@ function FormatSeries(series, link, isReverse) { - let c; + var c; + var node; + if (series.ExpectedNumberOfInstances == null || series.Instances.length == series.ExpectedNumberOfInstances) { @@ -307,7 +314,7 @@ c = series.Instances.length + '/' + series.ExpectedNumberOfInstances; } - let node = $('
') + node = $('
') .append($('

').text(series.MainDicomTags.SeriesDescription)) .append($('

').append($('') .text('Status: ') @@ -328,7 +335,7 @@ function FormatInstance(instance, link, isReverse) { - let node = $('

').append($('

').text('Instance: ' + instance.IndexInSeries)); + var node = $('
').append($('

').text('Instance: ' + instance.IndexInSeries)); FormatMainDicomTags(node, instance.MainDicomTags, [ "AcquisitionNumber", @@ -364,7 +371,7 @@ $('#lookup').live('pagebeforeshow', function() { // NB: "GenerateDicomDate()" is defined in "query-retrieve.js" - let target = $('#lookup-study-date'); + var target = $('#lookup-study-date'); $('option', target).remove(); target.append($('