{{#each studyInformation in studiesInformation}}
{{>studyBrowserItem (clone this studyInformation=studyInformation)}}
{{/each}}
diff --git a/Packages/ohif-studies/imports/client/components/browser/list.js b/Packages/ohif-studies/imports/client/components/browser/list.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/Packages/ohif-studies/imports/client/components/browser/series.html b/Packages/ohif-studies/imports/client/components/browser/series.html
new file mode 100644
index 000000000..8bd48c8bf
--- /dev/null
+++ b/Packages/ohif-studies/imports/client/components/browser/series.html
@@ -0,0 +1,9 @@
+
+
+
+ {{#each thumbnail in instance.thumbnails.get}}
+ {{>thumbnailEntry (clone '' thumbnail=thumbnail)}}
+ {{/each}}
+
+
+
diff --git a/Packages/ohif-studies/imports/client/components/browser/series.js b/Packages/ohif-studies/imports/client/components/browser/series.js
new file mode 100644
index 000000000..aa9149cb2
--- /dev/null
+++ b/Packages/ohif-studies/imports/client/components/browser/series.js
@@ -0,0 +1,40 @@
+import { Template } from 'meteor/templating';
+import { ReactiveVar } from 'meteor/reactive-var';
+import { Tracker } from 'meteor/tracker';
+import { OHIF } from 'meteor/ohif:core';
+
+Template.studyBrowserSeries.onCreated(() => {
+ const instance = Template.instance();
+ const { studyInformation } = instance.data;
+ const { studyInstanceUid } = studyInformation;
+
+ instance.thumbnails = new ReactiveVar([]);
+
+ // Get the study metadata and update the study thumbnails
+ instance.autorun(() => {
+ const studyMetadata = OHIF.viewer.Studies.findBy({ studyInstanceUid });
+
+ // Defines the resulting thumbnails list
+ const thumbnails = [];
+ studyMetadata.displaySets.forEach((stack, thumbnailIndex) => {
+ thumbnails.push({
+ thumbnailIndex,
+ stack
+ });
+ });
+
+ instance.thumbnails.set(thumbnails);
+ });
+});
+
+Template.studyBrowserSeries.onRendered(() => {
+ const instance = Template.instance();
+
+ // Run this computation every time the thumbnails are changed
+ instance.autorun(() => {
+ instance.thumbnails.get();
+ Tracker.afterFlush(() => {
+ instance.$('.study-browser-series').adjustMax('height');
+ });
+ });
+});
diff --git a/Packages/ohif-studies/imports/client/lib/index.js b/Packages/ohif-studies/imports/client/lib/index.js
index e69de29bb..d80c2409b 100644
--- a/Packages/ohif-studies/imports/client/lib/index.js
+++ b/Packages/ohif-studies/imports/client/lib/index.js
@@ -0,0 +1,2 @@
+import './retrieveStudiesMetadata';
+import './retrieveStudyMetadata';
diff --git a/Packages/ohif-studies/imports/client/lib/retrieveStudiesMetadata.js b/Packages/ohif-studies/imports/client/lib/retrieveStudiesMetadata.js
new file mode 100644
index 000000000..48918c36d
--- /dev/null
+++ b/Packages/ohif-studies/imports/client/lib/retrieveStudiesMetadata.js
@@ -0,0 +1,32 @@
+import { OHIF } from 'meteor/ohif:core';
+
+/**
+ * Retrieves metaData for multiple studies at once.
+ *
+ * This function calls retrieveStudyMetadata several times, asynchronously,
+ * and waits for all of the results to be returned.
+ *
+ * @param studyInstanceUids The UIDs of the Studies to be retrieved
+ * @return Promise
+ */
+OHIF.studies.retrieveStudiesMetadata = (studyInstanceUids, seriesInstanceUids) => {
+ // Create an empty array to store the Promises for each metaData retrieval call
+ const promises = [];
+
+ // Loop through the array of studyInstanceUids
+ studyInstanceUids.forEach(function(studyInstanceUid) {
+ // Send the call and resolve or reject the related promise based on its outcome
+ const promise = OHIF.studies.retrieveStudyMetadata(studyInstanceUid, seriesInstanceUids);
+
+ // Add the current promise to the array of promises
+ promises.push(promise);
+ });
+
+ // When all of the promises are complete, this callback runs
+ const promise = Promise.all(promises);
+
+ // Warn the error on console if some retrieval failed
+ promise.catch(error => OHIF.log.warn(error));
+
+ return promise;
+};
diff --git a/Packages/ohif-studies/imports/server/index.js b/Packages/ohif-studies/imports/server/index.js
index e69de29bb..62012bab6 100644
--- a/Packages/ohif-studies/imports/server/index.js
+++ b/Packages/ohif-studies/imports/server/index.js
@@ -0,0 +1,3 @@
+import './lib';
+import './methods';
+import './services';
diff --git a/Packages/ohif-study-list/server/lib/encodeQueryData.js b/Packages/ohif-studies/imports/server/lib/encodeQueryData.js
similarity index 100%
rename from Packages/ohif-study-list/server/lib/encodeQueryData.js
rename to Packages/ohif-studies/imports/server/lib/encodeQueryData.js
diff --git a/Packages/ohif-study-list/server/lib/index.js b/Packages/ohif-studies/imports/server/lib/index.js
similarity index 100%
rename from Packages/ohif-study-list/server/lib/index.js
rename to Packages/ohif-studies/imports/server/lib/index.js
diff --git a/Packages/ohif-study-list/server/lib/parseFloatArray.js b/Packages/ohif-studies/imports/server/lib/parseFloatArray.js
similarity index 100%
rename from Packages/ohif-study-list/server/lib/parseFloatArray.js
rename to Packages/ohif-studies/imports/server/lib/parseFloatArray.js
diff --git a/Packages/ohif-study-list/server/lib/remoteGetValue.js b/Packages/ohif-studies/imports/server/lib/remoteGetValue.js
similarity index 100%
rename from Packages/ohif-study-list/server/lib/remoteGetValue.js
rename to Packages/ohif-studies/imports/server/lib/remoteGetValue.js
diff --git a/Packages/ohif-study-list/server/methods/getStudyMetadata.js b/Packages/ohif-studies/imports/server/methods/getStudyMetadata.js
similarity index 83%
rename from Packages/ohif-study-list/server/methods/getStudyMetadata.js
rename to Packages/ohif-studies/imports/server/methods/getStudyMetadata.js
index 0ba4a1fd1..b97d04316 100644
--- a/Packages/ohif-study-list/server/methods/getStudyMetadata.js
+++ b/Packages/ohif-studies/imports/server/methods/getStudyMetadata.js
@@ -19,9 +19,9 @@ Meteor.methods({
try {
if (server.type === 'dicomWeb') {
- return Services.WADO.RetrieveMetadata(server, studyInstanceUid);
+ return OHIF.studies.services.WADO.RetrieveMetadata(server, studyInstanceUid);
} else if (server.type === 'dimse') {
- return Services.DIMSE.RetrieveMetadata(studyInstanceUid);
+ return OHIF.studies.services.DIMSE.RetrieveMetadata(studyInstanceUid);
}
} catch (error) {
OHIF.log.trace();
diff --git a/Packages/ohif-studies/imports/server/methods/index.js b/Packages/ohif-studies/imports/server/methods/index.js
new file mode 100644
index 000000000..ed1953ab8
--- /dev/null
+++ b/Packages/ohif-studies/imports/server/methods/index.js
@@ -0,0 +1 @@
+import './getStudyMetadata.js';
diff --git a/Packages/ohif-study-list/server/services/dimse/instances.js b/Packages/ohif-studies/imports/server/services/dimse/instances.js
old mode 100755
new mode 100644
similarity index 97%
rename from Packages/ohif-study-list/server/services/dimse/instances.js
rename to Packages/ohif-studies/imports/server/services/dimse/instances.js
index 83145cf05..0e914e06a
--- a/Packages/ohif-study-list/server/services/dimse/instances.js
+++ b/Packages/ohif-studies/imports/server/services/dimse/instances.js
@@ -57,7 +57,7 @@ function resultDataToStudyMetadata(resultData, studyInstanceUid) {
* @param studyInstanceUid
* @returns {{wadoUriRoot: String, studyInstanceUid: String, seriesList: Array}}
*/
-Services.DIMSE.Instances = function(studyInstanceUid) {
+OHIF.studies.services.DIMSE.Instances = function(studyInstanceUid) {
//var url = buildUrl(server, studyInstanceUid);
const result = DIMSE.retrieveInstances(studyInstanceUid);
diff --git a/Packages/ohif-study-list/server/services/dimse/retrieveMetadata.js b/Packages/ohif-studies/imports/server/services/dimse/retrieveMetadata.js
old mode 100755
new mode 100644
similarity index 97%
rename from Packages/ohif-study-list/server/services/dimse/retrieveMetadata.js
rename to Packages/ohif-studies/imports/server/services/dimse/retrieveMetadata.js
index f228e5b2c..f0922598c
--- a/Packages/ohif-study-list/server/services/dimse/retrieveMetadata.js
+++ b/Packages/ohif-studies/imports/server/services/dimse/retrieveMetadata.js
@@ -1,5 +1,5 @@
import { OHIF } from 'meteor/ohif:core';
-import { parseFloatArray } from 'meteor/ohif:study-list/server/lib/parseFloatArray';
+import { parseFloatArray } from 'meteor/ohif:studies/imports/server/lib/parseFloatArray';
/**
* Returns the value of the element (e.g. '00280009')
@@ -151,7 +151,7 @@ function resultDataToStudyMetadata(studyInstanceUid, resultData) {
* @param studyInstanceUid
* @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
*/
-Services.DIMSE.RetrieveMetadata = function(studyInstanceUid) {
+OHIF.studies.services.DIMSE.RetrieveMetadata = function(studyInstanceUid) {
// TODO: Check which peer it should point to
const activeServer = OHIF.servers.getCurrentServer().peers[0];
const supportsInstanceRetrievalByStudyUid = activeServer.supportsInstanceRetrievalByStudyUid;
diff --git a/Packages/ohif-study-list/server/services/dimse/setup.js b/Packages/ohif-studies/imports/server/services/dimse/setup.js
similarity index 100%
rename from Packages/ohif-study-list/server/services/dimse/setup.js
rename to Packages/ohif-studies/imports/server/services/dimse/setup.js
diff --git a/Packages/ohif-study-list/server/services/dimse/studies.js b/Packages/ohif-studies/imports/server/services/dimse/studies.js
old mode 100755
new mode 100644
similarity index 97%
rename from Packages/ohif-study-list/server/services/dimse/studies.js
rename to Packages/ohif-studies/imports/server/services/dimse/studies.js
index 8592a159d..897bc8d2b
--- a/Packages/ohif-study-list/server/services/dimse/studies.js
+++ b/Packages/ohif-studies/imports/server/services/dimse/studies.js
@@ -32,7 +32,7 @@ function resultDataToStudies(resultData) {
return studies;
}
-Services.DIMSE.Studies = function(filter) {
+OHIF.studies.services.DIMSE.Studies = function(filter) {
OHIF.log.info('Services.DIMSE.Studies');
let filterStudyDate = '';
diff --git a/Packages/ohif-study-list/server/services/index.js b/Packages/ohif-studies/imports/server/services/index.js
similarity index 100%
rename from Packages/ohif-study-list/server/services/index.js
rename to Packages/ohif-studies/imports/server/services/index.js
diff --git a/Packages/ohif-studies/imports/server/services/namespace.js b/Packages/ohif-studies/imports/server/services/namespace.js
new file mode 100644
index 000000000..a19d2ec29
--- /dev/null
+++ b/Packages/ohif-studies/imports/server/services/namespace.js
@@ -0,0 +1,13 @@
+import { OHIF } from 'meteor/ohif:core';
+
+const Services = {};
+Services.QIDO = {};
+Services.WADO = {};
+Services.DIMSE = {};
+Services.REMOTE = {};
+
+OHIF.studies.services = Services;
+
+remoteGetValue = function(obj) {
+ return obj ? obj.Value : null;
+};
diff --git a/Packages/ohif-study-list/server/services/qido/instances.js b/Packages/ohif-studies/imports/server/services/qido/instances.js
similarity index 97%
rename from Packages/ohif-study-list/server/services/qido/instances.js
rename to Packages/ohif-studies/imports/server/services/qido/instances.js
index 46e77b66f..8421055cc 100644
--- a/Packages/ohif-study-list/server/services/qido/instances.js
+++ b/Packages/ohif-studies/imports/server/services/qido/instances.js
@@ -74,7 +74,7 @@ function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
* @throws ECONNREFUSED
* @returns {{wadoUriRoot: String, studyInstanceUid: String, seriesList: Array}}
*/
-Services.QIDO.Instances = function(server, studyInstanceUid) {
+OHIF.studies.services.QIDO.Instances = function(server, studyInstanceUid) {
var url = buildUrl(server, studyInstanceUid);
try {
diff --git a/Packages/ohif-study-list/server/services/qido/studies.js b/Packages/ohif-studies/imports/server/services/qido/studies.js
similarity index 98%
rename from Packages/ohif-study-list/server/services/qido/studies.js
rename to Packages/ohif-studies/imports/server/services/qido/studies.js
index 02a824280..3b05f042b 100644
--- a/Packages/ohif-study-list/server/services/qido/studies.js
+++ b/Packages/ohif-studies/imports/server/services/qido/studies.js
@@ -91,7 +91,7 @@ function resultDataToStudies(resultData) {
return studies;
}
-Services.QIDO.Studies = function(server, filter) {
+OHIF.studies.services.QIDO.Studies = function(server, filter) {
var url = filterToQIDOURL(server, filter);
try {
diff --git a/Packages/ohif-study-list/server/services/remote/instances.js b/Packages/ohif-studies/imports/server/services/remote/instances.js
old mode 100755
new mode 100644
similarity index 95%
rename from Packages/ohif-study-list/server/services/remote/instances.js
rename to Packages/ohif-studies/imports/server/services/remote/instances.js
index 8aa44a0bf..5950df557
--- a/Packages/ohif-study-list/server/services/remote/instances.js
+++ b/Packages/ohif-studies/imports/server/services/remote/instances.js
@@ -1,84 +1,85 @@
-import { remoteGetValue } from '../../lib/remoteGetValue';
-
-/**
- * Parses data returned from a QIDO search and transforms it into
- * an array of series that are present in the study
- *
- * @param server The DICOM server
- * @param studyInstanceUid
- * @param resultData
- * @returns {Array} Series List
- */
-function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
- var seriesMap = {};
- var seriesList = [];
-
- resultData.forEach(function(instance) {
- // Use seriesMap to cache series data
- // If the series instance UID has already been used to
- // process series data, continue using that series
- var seriesInstanceUid = remoteGetValue(instance['0020,000e']);
- var series = seriesMap[seriesInstanceUid];
-
- // If no series data exists in the seriesMap cache variable,
- // process any available series data
- if(!series) {
- series = {
- seriesInstanceUid : seriesInstanceUid,
- seriesNumber : parseFloat(remoteGetValue(instance['0020,0011'])),
- instances: []
- };
-
- // Save this data in the seriesMap cache variable
- seriesMap[seriesInstanceUid] = series;
- seriesList.push(series);
- }
-
- // The uri for the dicomweb
- // NOTE: DCM4CHEE seems to return the data zipped
- // NOTE: Orthanc returns the data with multi-part mime which cornerstoneWADOImageLoader doesn't
- // know how to parse yet
- //var uri = DICOMWeb.getString(instance['00081190']);
- //uri = uri.replace('wado-rs', 'dicom-web');
-
- // manually create a WADO-URI from the UIDs
- // NOTE: Haven't been able to get Orthanc's WADO-URI to work yet - maybe its not configured?
- var sopInstanceUid = remoteGetValue(instance['0008,0018']);
- var uri = server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + "&contentType=application%2Fdicom";
-
- // Add this instance to the current series
- series.instances.push({
- sopClassUid: remoteGetValue(instance['0008,0016']),
- sopInstanceUid: sopInstanceUid,
- uri: uri,
- instanceNumber: parseFloat(remoteGetValue(instance['0020,0013']))
- });
- });
- return seriesList;
-}
-
-/**
- * Retrieve a set of instances using a QIDO call
- * @param server
- * @param studyInstanceUid
- * @returns {{wadoUriRoot: String, studyInstanceUid: String, seriesList: Array}}
- */
-Services.REMOTE.Instances = function(server, studyInstanceUid) {
- var parameters = {
- PatientName: "",
- PatientID: "",
- AccessionNumber: "",
- SeriesInstanceUID: "",
- SeriesNumber : "",
- SOPClassUID : "",
- InstanceNumber : ""
- };
-
- var remote = new OrthancRemote(server.root, server.sourceAE);
-
- return {
- wadoUriRoot: server.wadoUriRoot,
- studyInstanceUid: studyInstanceUid,
- seriesList: resultDataToStudyMetadata(server, studyInstanceUid, remote.findInstances(server.modality, studyInstanceUid, null, parameters))
- };
-};
\ No newline at end of file
+import { OHIF } from 'meteor/ohif:core';
+import { remoteGetValue } from '../../lib/remoteGetValue';
+
+/**
+ * Parses data returned from a QIDO search and transforms it into
+ * an array of series that are present in the study
+ *
+ * @param server The DICOM server
+ * @param studyInstanceUid
+ * @param resultData
+ * @returns {Array} Series List
+ */
+function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
+ var seriesMap = {};
+ var seriesList = [];
+
+ resultData.forEach(function(instance) {
+ // Use seriesMap to cache series data
+ // If the series instance UID has already been used to
+ // process series data, continue using that series
+ var seriesInstanceUid = remoteGetValue(instance['0020,000e']);
+ var series = seriesMap[seriesInstanceUid];
+
+ // If no series data exists in the seriesMap cache variable,
+ // process any available series data
+ if(!series) {
+ series = {
+ seriesInstanceUid : seriesInstanceUid,
+ seriesNumber : parseFloat(remoteGetValue(instance['0020,0011'])),
+ instances: []
+ };
+
+ // Save this data in the seriesMap cache variable
+ seriesMap[seriesInstanceUid] = series;
+ seriesList.push(series);
+ }
+
+ // The uri for the dicomweb
+ // NOTE: DCM4CHEE seems to return the data zipped
+ // NOTE: Orthanc returns the data with multi-part mime which cornerstoneWADOImageLoader doesn't
+ // know how to parse yet
+ //var uri = DICOMWeb.getString(instance['00081190']);
+ //uri = uri.replace('wado-rs', 'dicom-web');
+
+ // manually create a WADO-URI from the UIDs
+ // NOTE: Haven't been able to get Orthanc's WADO-URI to work yet - maybe its not configured?
+ var sopInstanceUid = remoteGetValue(instance['0008,0018']);
+ var uri = server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + "&contentType=application%2Fdicom";
+
+ // Add this instance to the current series
+ series.instances.push({
+ sopClassUid: remoteGetValue(instance['0008,0016']),
+ sopInstanceUid: sopInstanceUid,
+ uri: uri,
+ instanceNumber: parseFloat(remoteGetValue(instance['0020,0013']))
+ });
+ });
+ return seriesList;
+}
+
+/**
+ * Retrieve a set of instances using a QIDO call
+ * @param server
+ * @param studyInstanceUid
+ * @returns {{wadoUriRoot: String, studyInstanceUid: String, seriesList: Array}}
+ */
+OHIF.studies.services.REMOTE.Instances = function(server, studyInstanceUid) {
+ var parameters = {
+ PatientName: "",
+ PatientID: "",
+ AccessionNumber: "",
+ SeriesInstanceUID: "",
+ SeriesNumber : "",
+ SOPClassUID : "",
+ InstanceNumber : ""
+ };
+
+ var remote = new OrthancRemote(server.root, server.sourceAE);
+
+ return {
+ wadoUriRoot: server.wadoUriRoot,
+ studyInstanceUid: studyInstanceUid,
+ seriesList: resultDataToStudyMetadata(server, studyInstanceUid, remote.findInstances(server.modality, studyInstanceUid, null, parameters))
+ };
+};
diff --git a/Packages/ohif-study-list/server/services/remote/retrieveMetadata.js b/Packages/ohif-studies/imports/server/services/remote/retrieveMetadata.js
old mode 100755
new mode 100644
similarity index 96%
rename from Packages/ohif-study-list/server/services/remote/retrieveMetadata.js
rename to Packages/ohif-studies/imports/server/services/remote/retrieveMetadata.js
index 4ca36fcf9..67aeed141
--- a/Packages/ohif-study-list/server/services/remote/retrieveMetadata.js
+++ b/Packages/ohif-studies/imports/server/services/remote/retrieveMetadata.js
@@ -1,141 +1,142 @@
-import { remoteGetValue } from '../../lib/remoteGetValue';
-import { parseFloatArray } from '../../lib/parseFloatArray';
-
-/**
- * Parses the SourceImageSequence, if it exists, in order
- * to return a ReferenceSOPInstanceUID. The ReferenceSOPInstanceUID
- * is used to refer to this image in any accompanying DICOM-SR documents.
- *
- * @param instance
- * @returns {String} The ReferenceSOPInstanceUID
- */
-function getSourceImageInstanceUid(instance) {
- // TODO= Parse the whole Source Image Sequence
- // This is a really poor workaround for now.
- // Later we should probably parse the whole sequence.
- var SourceImageSequence = remoteGetValue(instance['0008,2112']);
- if (SourceImageSequence && SourceImageSequence.Value && SourceImageSequence.Value.length) {
- return SourceImageSequence.Value[0]['0008,1155'].Value[0];
- }
-}
-
-/**
- * Parses result data from a WADO search into Study MetaData
- * Returns an object populated with study metadata, including the
- * series list.
- *
- * @param server
- * @param studyInstanceUid
- * @param resultData
- * @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
- */
-function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
- var seriesMap = {};
- var seriesList = [];
-
- if (!resultData.length) {
- return;
- }
-
- var anInstance = resultData[0];
- if (!anInstance) {
- return;
- }
-
- var studyData = {
- seriesList: seriesList,
- patientName: remoteGetValue(anInstance['0010,0010']),
- patientId: remoteGetValue(anInstance['0010,0020']),
- accessionNumber: remoteGetValue(anInstance['0008,0050']),
- studyDate: remoteGetValue(anInstance['0008,0020']),
- modalities: remoteGetValue(anInstance['0008,0061']),
- studyDescription: remoteGetValue(anInstance['0008,1030']),
- imageCount: remoteGetValue(anInstance['0020,1208']),
- studyInstanceUid: remoteGetValue(anInstance['0020,000d'])
- };
-
- resultData.forEach(function(instance) {
- var seriesInstanceUid = remoteGetValue(instance['0020,000e']);
- var series = seriesMap[seriesInstanceUid];
- if (!series) {
- series = {
- seriesDescription: remoteGetValue(instance['0008,103e']),
- modality: remoteGetValue(instance['0008,0060']),
- seriesInstanceUid: seriesInstanceUid,
- seriesNumber: parseFloat(remoteGetValue(instance['0020,0011'])),
- instances: []
- };
- seriesMap[seriesInstanceUid] = series;
- seriesList.push(series);
- }
-
- var sopInstanceUid = remoteGetValue(instance['0008,0018']);
-
- var instanceSummary = {
- imageType: remoteGetValue(instance['0008,0008']),
- sopClassUid: remoteGetValue(instance['0008,0016']),
- sopInstanceUid: sopInstanceUid,
- instanceNumber: parseFloat(remoteGetValue(instance['0020,0013'])),
- imagePositionPatient: remoteGetValue(instance['0020,0032']),
- imageOrientationPatient: remoteGetValue(instance['0020,0037']),
- frameOfReferenceUID: remoteGetValue(instance['0020,0052']),
- sliceLocation: parseFloat(remoteGetValue(instance['0020,1041'])),
- samplesPerPixel: parseFloat(remoteGetValue(instance['0028,0002'])),
- photometricInterpretation: remoteGetValue(instance['0028,0004']),
- rows: parseFloat(remoteGetValue(instance['0028,0010'])),
- columns: parseFloat(remoteGetValue(instance['0028,0011'])),
- pixelSpacing: remoteGetValue(instance['0028,0030']),
- bitsAllocated: parseFloat(remoteGetValue(instance['0028,0100'])),
- bitsStored: parseFloat(remoteGetValue(instance['0028,0101'])),
- highBit: parseFloat(remoteGetValue(instance['0028,0102'])),
- pixelRepresentation: parseFloat(remoteGetValue(instance['0028,0103'])),
- windowCenter: remoteGetValue(instance['0028,1050']),
- windowWidth: remoteGetValue(instance['0028,1051']),
- rescaleIntercept: parseFloat(remoteGetValue(instance['0028,1052'])),
- rescaleSlope: parseFloat(remoteGetValue(instance['0028,1053'])),
- sourceImageInstanceUid: getSourceImageInstanceUid(instance),
- laterality: remoteGetValue(instance['0020,0062']),
- viewPosition: remoteGetValue(instance['0018,5101']),
- acquisitionDateTime: remoteGetValue(instance['0008,002A']),
- numberOfFrames: parseFloat(remoteGetValue(instance['0028,0008'])),
- frameIncrementPointer: remoteGetValue(instance['0028,0009']),
- frameTime: parseFloat(remoteGetValue(instance['0018,1063'])),
- frameTimeVector: parseFloatArray(remoteGetValue(instance['0018,1065'])),
- echoNumber: remoteGetValue(instance['0018,0086']),
- contrastBolusAgent: remoteGetValue(instance['0018,0010'])
- };
-
- var iid = instance['xxxx,0001'].Value;
- if (server.imageRendering === 'wadouri') {
- instanceSummary.wadouri = server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + "&contentType=application%2Fdicom";
- } else if (server.imageRendering == 'orthanc') {
- instanceSummary.wadouri = server.root + '/instances/' + iid + '/file';
- } else {
- instanceSummary.wadorsuri = server.wadoRoot + '/studies/' + studyInstanceUid + '/series/' + seriesInstanceUid + '/instances/' + sopInstanceUid + '/frames/1';
- }
-
- series.instances.push(instanceSummary);
- });
-console.log(studyData.seriesList[0].instances);
- return studyData;
-}
-
-/**
- * Retrieved Study MetaData from a DICOM server using a WADO call
- * @param server
- * @param studyInstanceUid
- * @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
- */
-Services.REMOTE.RetrieveMetadata = function(server, studyInstanceUid) {
- var remote = new OrthancRemote(server.root, server.sourceAE);
-
- var study = resultDataToStudyMetadata(server, studyInstanceUid, remote.retrieveMetadata(server.modality, studyInstanceUid));
- if (!study) {
- study = {};
- }
-
- study.wadoUriRoot = server.wadoUriRoot;
- study.studyInstanceUid = studyInstanceUid;
-
- return study;
-};
\ No newline at end of file
+import { OHIF } from 'meteor/ohif:core';
+import { remoteGetValue } from '../../lib/remoteGetValue';
+import { parseFloatArray } from '../../lib/parseFloatArray';
+
+/**
+ * Parses the SourceImageSequence, if it exists, in order
+ * to return a ReferenceSOPInstanceUID. The ReferenceSOPInstanceUID
+ * is used to refer to this image in any accompanying DICOM-SR documents.
+ *
+ * @param instance
+ * @returns {String} The ReferenceSOPInstanceUID
+ */
+function getSourceImageInstanceUid(instance) {
+ // TODO= Parse the whole Source Image Sequence
+ // This is a really poor workaround for now.
+ // Later we should probably parse the whole sequence.
+ var SourceImageSequence = remoteGetValue(instance['0008,2112']);
+ if (SourceImageSequence && SourceImageSequence.Value && SourceImageSequence.Value.length) {
+ return SourceImageSequence.Value[0]['0008,1155'].Value[0];
+ }
+}
+
+/**
+ * Parses result data from a WADO search into Study MetaData
+ * Returns an object populated with study metadata, including the
+ * series list.
+ *
+ * @param server
+ * @param studyInstanceUid
+ * @param resultData
+ * @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
+ */
+function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
+ var seriesMap = {};
+ var seriesList = [];
+
+ if (!resultData.length) {
+ return;
+ }
+
+ var anInstance = resultData[0];
+ if (!anInstance) {
+ return;
+ }
+
+ var studyData = {
+ seriesList: seriesList,
+ patientName: remoteGetValue(anInstance['0010,0010']),
+ patientId: remoteGetValue(anInstance['0010,0020']),
+ accessionNumber: remoteGetValue(anInstance['0008,0050']),
+ studyDate: remoteGetValue(anInstance['0008,0020']),
+ modalities: remoteGetValue(anInstance['0008,0061']),
+ studyDescription: remoteGetValue(anInstance['0008,1030']),
+ imageCount: remoteGetValue(anInstance['0020,1208']),
+ studyInstanceUid: remoteGetValue(anInstance['0020,000d'])
+ };
+
+ resultData.forEach(function(instance) {
+ var seriesInstanceUid = remoteGetValue(instance['0020,000e']);
+ var series = seriesMap[seriesInstanceUid];
+ if (!series) {
+ series = {
+ seriesDescription: remoteGetValue(instance['0008,103e']),
+ modality: remoteGetValue(instance['0008,0060']),
+ seriesInstanceUid: seriesInstanceUid,
+ seriesNumber: parseFloat(remoteGetValue(instance['0020,0011'])),
+ instances: []
+ };
+ seriesMap[seriesInstanceUid] = series;
+ seriesList.push(series);
+ }
+
+ var sopInstanceUid = remoteGetValue(instance['0008,0018']);
+
+ var instanceSummary = {
+ imageType: remoteGetValue(instance['0008,0008']),
+ sopClassUid: remoteGetValue(instance['0008,0016']),
+ sopInstanceUid: sopInstanceUid,
+ instanceNumber: parseFloat(remoteGetValue(instance['0020,0013'])),
+ imagePositionPatient: remoteGetValue(instance['0020,0032']),
+ imageOrientationPatient: remoteGetValue(instance['0020,0037']),
+ frameOfReferenceUID: remoteGetValue(instance['0020,0052']),
+ sliceLocation: parseFloat(remoteGetValue(instance['0020,1041'])),
+ samplesPerPixel: parseFloat(remoteGetValue(instance['0028,0002'])),
+ photometricInterpretation: remoteGetValue(instance['0028,0004']),
+ rows: parseFloat(remoteGetValue(instance['0028,0010'])),
+ columns: parseFloat(remoteGetValue(instance['0028,0011'])),
+ pixelSpacing: remoteGetValue(instance['0028,0030']),
+ bitsAllocated: parseFloat(remoteGetValue(instance['0028,0100'])),
+ bitsStored: parseFloat(remoteGetValue(instance['0028,0101'])),
+ highBit: parseFloat(remoteGetValue(instance['0028,0102'])),
+ pixelRepresentation: parseFloat(remoteGetValue(instance['0028,0103'])),
+ windowCenter: remoteGetValue(instance['0028,1050']),
+ windowWidth: remoteGetValue(instance['0028,1051']),
+ rescaleIntercept: parseFloat(remoteGetValue(instance['0028,1052'])),
+ rescaleSlope: parseFloat(remoteGetValue(instance['0028,1053'])),
+ sourceImageInstanceUid: getSourceImageInstanceUid(instance),
+ laterality: remoteGetValue(instance['0020,0062']),
+ viewPosition: remoteGetValue(instance['0018,5101']),
+ acquisitionDateTime: remoteGetValue(instance['0008,002A']),
+ numberOfFrames: parseFloat(remoteGetValue(instance['0028,0008'])),
+ frameIncrementPointer: remoteGetValue(instance['0028,0009']),
+ frameTime: parseFloat(remoteGetValue(instance['0018,1063'])),
+ frameTimeVector: parseFloatArray(remoteGetValue(instance['0018,1065'])),
+ echoNumber: remoteGetValue(instance['0018,0086']),
+ contrastBolusAgent: remoteGetValue(instance['0018,0010'])
+ };
+
+ var iid = instance['xxxx,0001'].Value;
+ if (server.imageRendering === 'wadouri') {
+ instanceSummary.wadouri = server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + "&contentType=application%2Fdicom";
+ } else if (server.imageRendering == 'orthanc') {
+ instanceSummary.wadouri = server.root + '/instances/' + iid + '/file';
+ } else {
+ instanceSummary.wadorsuri = server.wadoRoot + '/studies/' + studyInstanceUid + '/series/' + seriesInstanceUid + '/instances/' + sopInstanceUid + '/frames/1';
+ }
+
+ series.instances.push(instanceSummary);
+ });
+console.log(studyData.seriesList[0].instances);
+ return studyData;
+}
+
+/**
+ * Retrieved Study MetaData from a DICOM server using a WADO call
+ * @param server
+ * @param studyInstanceUid
+ * @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
+ */
+OHIF.studies.services.REMOTE.RetrieveMetadata = function(server, studyInstanceUid) {
+ var remote = new OrthancRemote(server.root, server.sourceAE);
+
+ var study = resultDataToStudyMetadata(server, studyInstanceUid, remote.retrieveMetadata(server.modality, studyInstanceUid));
+ if (!study) {
+ study = {};
+ }
+
+ study.wadoUriRoot = server.wadoUriRoot;
+ study.studyInstanceUid = studyInstanceUid;
+
+ return study;
+};
diff --git a/Packages/ohif-study-list/server/services/remote/studies.js b/Packages/ohif-studies/imports/server/services/remote/studies.js
old mode 100755
new mode 100644
similarity index 94%
rename from Packages/ohif-study-list/server/services/remote/studies.js
rename to Packages/ohif-studies/imports/server/services/remote/studies.js
index bc54a55f1..ea460c7b3
--- a/Packages/ohif-study-list/server/services/remote/studies.js
+++ b/Packages/ohif-studies/imports/server/services/remote/studies.js
@@ -1,49 +1,50 @@
-import { remoteGetValue } from '../../lib/remoteGetValue';
-
-function resultDataToStudies(resultData) {
- var studies = [];
-
- resultData.forEach(function(study) {
- studies.push({
- studyInstanceUid: remoteGetValue(study['0020,000d']),
- // 00080005 = SpecificCharacterSet
- studyDate: remoteGetValue(study['0008,0020']),
- studyTime: remoteGetValue(study['0008,0030']),
- accessionNumber: remoteGetValue(study['0008,0050']),
- referringPhysicianName: remoteGetValue(study['0008,0090']),
- // 00081190 = URL
- patientName: remoteGetValue(study['0010,0010']),
- patientId: remoteGetValue(study['0010,0020']),
- patientBirthdate: remoteGetValue(study['0010,0030']),
- patientSex: remoteGetValue(study['0010,0040']),
- studyId: remoteGetValue(study['0020,0010']),
- numberOfStudyRelatedSeries: parseFloat(remoteGetValue(study['0020,1206'])),
- numberOfStudyRelatedInstances: parseFloat(remoteGetValue(study['0020,1208'])),
- studyDescription: remoteGetValue(study['0008,1030']),
- modalities: remoteGetValue(study['0008,0061'])
- });
- });
- return studies;
-}
-
-Services.REMOTE.Studies = function(server, filter) {
- var parameters = {
- PatientName: filter.patientName ? filter.patientName : "",
- PatientID: filter.patientId,
- AccessionNumber: filter.accessionNumber ? filter.accessionNumber : "",
- StudyDescription: "",
- StudyDate : "",
- StudyTime : "",
- ReferringPhysicianName : "",
- PatientBirthDate : "",
- PatientSex : "",
- StudyID : "",
- NumberOfStudyRelatedSeries : "",
- NumberOfStudyRelatedInstances : "",
- ModalitiesInStudy : ""
- };
- var remote = new OrthancRemote(server.root, server.sourceAE);
- var data = remote.findStudies(server.modality, parameters);
-
- return resultDataToStudies(data.results);
-};
\ No newline at end of file
+import { OHIF } from 'meteor/ohif:core';
+import { remoteGetValue } from '../../lib/remoteGetValue';
+
+function resultDataToStudies(resultData) {
+ var studies = [];
+
+ resultData.forEach(function(study) {
+ studies.push({
+ studyInstanceUid: remoteGetValue(study['0020,000d']),
+ // 00080005 = SpecificCharacterSet
+ studyDate: remoteGetValue(study['0008,0020']),
+ studyTime: remoteGetValue(study['0008,0030']),
+ accessionNumber: remoteGetValue(study['0008,0050']),
+ referringPhysicianName: remoteGetValue(study['0008,0090']),
+ // 00081190 = URL
+ patientName: remoteGetValue(study['0010,0010']),
+ patientId: remoteGetValue(study['0010,0020']),
+ patientBirthdate: remoteGetValue(study['0010,0030']),
+ patientSex: remoteGetValue(study['0010,0040']),
+ studyId: remoteGetValue(study['0020,0010']),
+ numberOfStudyRelatedSeries: parseFloat(remoteGetValue(study['0020,1206'])),
+ numberOfStudyRelatedInstances: parseFloat(remoteGetValue(study['0020,1208'])),
+ studyDescription: remoteGetValue(study['0008,1030']),
+ modalities: remoteGetValue(study['0008,0061'])
+ });
+ });
+ return studies;
+}
+
+OHIF.studies.services.REMOTE.Studies = function(server, filter) {
+ var parameters = {
+ PatientName: filter.patientName ? filter.patientName : "",
+ PatientID: filter.patientId,
+ AccessionNumber: filter.accessionNumber ? filter.accessionNumber : "",
+ StudyDescription: "",
+ StudyDate : "",
+ StudyTime : "",
+ ReferringPhysicianName : "",
+ PatientBirthDate : "",
+ PatientSex : "",
+ StudyID : "",
+ NumberOfStudyRelatedSeries : "",
+ NumberOfStudyRelatedInstances : "",
+ ModalitiesInStudy : ""
+ };
+ var remote = new OrthancRemote(server.root, server.sourceAE);
+ var data = remote.findStudies(server.modality, parameters);
+
+ return resultDataToStudies(data.results);
+};
diff --git a/Packages/ohif-study-list/server/services/wado/retrieveMetadata.js b/Packages/ohif-studies/imports/server/services/wado/retrieveMetadata.js
similarity index 99%
rename from Packages/ohif-study-list/server/services/wado/retrieveMetadata.js
rename to Packages/ohif-studies/imports/server/services/wado/retrieveMetadata.js
index e4189a6fc..f374aa065 100644
--- a/Packages/ohif-study-list/server/services/wado/retrieveMetadata.js
+++ b/Packages/ohif-studies/imports/server/services/wado/retrieveMetadata.js
@@ -337,20 +337,20 @@ function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
* @param studyInstanceUid
* @returns {{seriesList: Array, patientName: *, patientId: *, accessionNumber: *, studyDate: *, modalities: *, studyDescription: *, imageCount: *, studyInstanceUid: *}}
*/
-Services.WADO.RetrieveMetadata = function(server, studyInstanceUid) {
+OHIF.studies.services.WADO.RetrieveMetadata = function(server, studyInstanceUid) {
var url = buildUrl(server, studyInstanceUid);
try {
var result = DICOMWeb.getJSON(url, server.requestOptions);
-
+
var study = resultDataToStudyMetadata(server, studyInstanceUid, result.data);
if (!study) {
study = {};
}
-
+
study.wadoUriRoot = server.wadoUriRoot;
study.studyInstanceUid = studyInstanceUid;
-
+
return study;
} catch (error) {
OHIF.log.trace();
diff --git a/Packages/ohif-study-list/client/components/seriesDetailsModal/seriesDetailsTable/seriesDetailsTable.js b/Packages/ohif-study-list/client/components/seriesDetailsModal/seriesDetailsTable/seriesDetailsTable.js
index 3c7f51948..6c7b96c38 100644
--- a/Packages/ohif-study-list/client/components/seriesDetailsModal/seriesDetailsTable/seriesDetailsTable.js
+++ b/Packages/ohif-study-list/client/components/seriesDetailsModal/seriesDetailsTable/seriesDetailsTable.js
@@ -36,7 +36,7 @@ Template.seriesDetailsTable.onRendered(() => {
// Get series list for the study
_.map(studies, (selectedStudy, index) => {
studies[index].seriesList = [];
- OHIF.studylist.retrieveStudyMetadata(study => {
+ OHIF.studies.retrieveStudyMetadata(study => {
// Set series list
studies[index].seriesList = study.seriesList;
studies[index].displaySeriesLoadingText = false;
diff --git a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js
index 872a8091e..6decedc16 100644
--- a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js
+++ b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js
@@ -13,7 +13,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource
* @return {Promise} A Promise object
*/
getByInstanceUID(studyInstanceUID) {
- return OHIF.studylist.retrieveStudyMetadata(studyInstanceUID);
+ return OHIF.studies.retrieveStudyMetadata(studyInstanceUID);
}
/**
diff --git a/Packages/ohif-study-list/client/lib/queryStudies.js b/Packages/ohif-study-list/client/lib/queryStudies.js
index 83dac7364..efec40158 100644
--- a/Packages/ohif-study-list/client/lib/queryStudies.js
+++ b/Packages/ohif-study-list/client/lib/queryStudies.js
@@ -12,7 +12,7 @@ queryStudies = function(studiesToQuery, options) {
const promises = [];
studiesToQuery.forEach(studyToQuery => {
- const promise = OHIF.studylist.retrieveStudyMetadata(studyToQuery.studyInstanceUid);
+ const promise = OHIF.studies.retrieveStudyMetadata(studyToQuery.studyInstanceUid);
promise.then(study => {
studiesQueried++;
notify({
diff --git a/Packages/ohif-study-list/client/lib/retrieveStudiesMetadata.js b/Packages/ohif-study-list/client/lib/retrieveStudiesMetadata.js
index 86f68751a..8d9e6fb55 100644
--- a/Packages/ohif-study-list/client/lib/retrieveStudiesMetadata.js
+++ b/Packages/ohif-study-list/client/lib/retrieveStudiesMetadata.js
@@ -1,42 +1,12 @@
import { OHIF } from 'meteor/ohif:core';
+const note = 'OHIF.studylist.retrieveStudiesMetadata is deprecated.';
+const instructions = 'Please use OHIF.studies.retrieveStudiesMetadata instead.';
+
/**
- * Retrieves metaData for multiple studies at once.
- *
- * This function calls retrieveStudyMetadata several times, asynchronously,
- * and waits for all of the results to be returned.
- *
- * @param studyInstanceUids The UIDs of the Studies to be retrieved
- * @return Promise
+ * @deprecated Please use OHIF.studies.retrieveStudiesMetadata instead
*/
-OHIF.studylist.retrieveStudiesMetadata = (studyInstanceUids, seriesInstanceUids, doneCallback, failCallback) => {
- // // Check to make sure studyInstanceUids were actually input
- // if (!studyInstanceUids || !studyInstanceUids.length) {
- // if (failCallback && typeof failCallback === 'function') {
- // failCallback('No studyInstanceUids were input');
- // }
- //
- // return;
- // }
-
- // Create an empty array to store the Promises for each metaData retrieval call
- const promises = [];
-
- // Loop through the array of studyInstanceUids
- studyInstanceUids.forEach(function(studyInstanceUid) {
- // Send the call, and attach doneCallbacks and failCallbacks
- // which can resolve or reject the related promise based on its outcome
- const promise = OHIF.studylist.retrieveStudyMetadata(studyInstanceUid, seriesInstanceUids);
-
- // Add the current promise to the array of promises
- promises.push(promise);
- });
-
- // When all of the promises are complete, this callback runs
- const promise = Promise.all(promises);
-
- // Warn the error on console if some retrieval failed
- promise.catch(error => OHIF.log.warn(error));
-
- return promise;
+OHIF.studylist.retrieveStudiesMetadata = function() {
+ OHIF.log.warn(`${note}\n${instructions}`);
+ OHIF.studies.retrieveStudiesMetadata.apply(this, arguments);
};
diff --git a/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js b/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js
index d6d0a0162..b86d11c12 100644
--- a/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js
+++ b/Packages/ohif-study-list/client/lib/retrieveStudyMetadata.js
@@ -1,110 +1,12 @@
-import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
-import 'meteor/ohif:viewerbase';
-// Define the StudyMetaDataPromises object. This is used as a cache to store study meta data
-// promises and prevent unnecessary subsequent calls to the server
-const StudyMetaDataPromises = new Map();
+const note = 'OHIF.studylist.retrieveStudyMetadata is deprecated.';
+const instructions = 'Please use OHIF.studies.retrieveStudyMetadata instead.';
/**
- * Retrieves study metadata using a server call
- *
- * @param {String} studyInstanceUid The UID of the Study to be retrieved
- * @returns {Promise} that will be resolved with the metadata or rejected with the error
+ * @deprecated Please use OHIF.studies.retrieveStudyMetadata instead
*/
-OHIF.studylist.retrieveStudyMetadata = (studyInstanceUid, seriesInstanceUids) => {
-
- // @TODO: Whenever a study metadata request has failed, its related promise will be rejected once and for all
- // and further requests for that metadata will always fail. On failure, we probably need to remove the
- // corresponding promise from the "StudyMetaDataPromises" map...
-
- // If the StudyMetaDataPromises cache already has a pending or resolved promise related to the
- // given studyInstanceUid, then that promise is returned
- if (StudyMetaDataPromises.has(studyInstanceUid)) {
- return StudyMetaDataPromises.get(studyInstanceUid);
- }
-
- console.time('retrieveStudyMetadata');
-
- // Create a promise to handle the data retrieval
- const promise = new Promise((resolve, reject) => {
- // If no study metadata is in the cache variable, we need to retrieve it from
- // the server with a call.
- Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) {
- console.timeEnd('retrieveStudyMetadata');
-
- if (error) {
- const errorType = error.error;
- let errorMessage = '';
-
- if (errorType === 'server-connection-error') {
- errorMessage = 'There was an error connecting to the DICOM server, please verify if it is up and running.'
- } else if (errorType === 'server-internal-error') {
- errorMessage = `There was an internal error with the DICOM server getting metadeta for ${studyInstanceUid}`;
- } else {
- errorMessage = `For some reason we could not retrieve the study\'s metadata for ${studyInstanceUid}.`;
- }
-
- OHIF.log.error(errorMessage);
- OHIF.log.error(error.stack);
- reject(`GetStudyMetadata: ${errorMessage}`);
- return;
- }
-
- // Filter series if seriesInstanceUid exists
- if (seriesInstanceUids && seriesInstanceUids.length) {
- study.seriesList = study.seriesList.filter(series => seriesInstanceUids.indexOf(series.seriesInstanceUid) > -1);
- }
-
- if (!study) {
- reject(`GetStudyMetadata: No study data returned from server: ${studyInstanceUid}`);
- return;
- }
-
- if (window.HipaaLogger && Meteor.user && Meteor.user()) {
- window.HipaaLogger.logEvent({
- eventType: 'viewed',
- userId: Meteor.userId(),
- userName: Meteor.user().profile.fullName,
- collectionName: 'Study',
- recordId: studyInstanceUid,
- patientId: study.patientId,
- patientName: study.patientName
- });
- }
-
- // Once the data was retrieved, the series are sorted by series and instance number
- OHIF.viewerbase.sortStudy(study);
-
- // Updates WADO-RS metaDataManager
- OHIF.viewerbase.updateMetaDataManager(study);
-
- // Add additional metadata to our study from the studylist
- const studylistStudy = OHIF.studylist.collections.Studies.findOne({
- studyInstanceUid: study.studyInstanceUid,
- 'seriesList.seriesInstanceUid': '123456',
- });
-
- if (studylistStudy) {
- Object.assign(study, studylistStudy);
- }
-
- // Transform the study in a StudyMetadata object
- const studyMetadata = new OHIF.metadata.StudyMetadata(study);
-
- // Add the display sets to the study
- study.displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
- study.displaySets.forEach(displaySet => {
- OHIF.viewerbase.stackManager.makeAndAddStack(study, displaySet);
- });
-
- // Resolve the promise with the final study metadata object
- resolve(study);
- });
- });
-
- // Store the promise in cache
- StudyMetaDataPromises.set(studyInstanceUid, promise);
-
- return promise;
+OHIF.studylist.retrieveStudyMetadata = function() {
+ OHIF.log.warn(`${note}\n${instructions}`);
+ OHIF.studies.retrieveStudyMetadata.apply(this, arguments);
};
diff --git a/Packages/ohif-study-list/package.js b/Packages/ohif-study-list/package.js
index 522edd8d4..4200c42e4 100644
--- a/Packages/ohif-study-list/package.js
+++ b/Packages/ohif-study-list/package.js
@@ -44,6 +44,4 @@ Package.onUse(function(api) {
// Client imports
api.addFiles('client/index.js', 'client');
-
- api.export('Services', 'server');
});
diff --git a/Packages/ohif-study-list/server/index.js b/Packages/ohif-study-list/server/index.js
index 6ffca0633..e06b98f8c 100644
--- a/Packages/ohif-study-list/server/index.js
+++ b/Packages/ohif-study-list/server/index.js
@@ -1,5 +1 @@
import './publications.js';
-
-import './lib';
-import './methods';
-import './services';
diff --git a/Packages/ohif-study-list/server/methods/index.js b/Packages/ohif-study-list/server/methods/index.js
index b54508a5b..6cc5143b1 100644
--- a/Packages/ohif-study-list/server/methods/index.js
+++ b/Packages/ohif-study-list/server/methods/index.js
@@ -1,3 +1,2 @@
-import './getStudyMetadata.js';
import './importStudies.js';
import './studylistSearch.js';
diff --git a/Packages/ohif-study-list/server/methods/studylistSearch.js b/Packages/ohif-study-list/server/methods/studylistSearch.js
index 7e70155be..f7bb12687 100644
--- a/Packages/ohif-study-list/server/methods/studylistSearch.js
+++ b/Packages/ohif-study-list/server/methods/studylistSearch.js
@@ -18,9 +18,9 @@ Meteor.methods({
try {
if (server.type === 'dicomWeb') {
- return Services.QIDO.Studies(server, filter);
+ return OHIF.studies.services.QIDO.Studies(server, filter);
} else if (server.type === 'dimse') {
- return Services.DIMSE.Studies(filter);
+ return OHIF.studies.services.DIMSE.Studies(filter);
}
} catch (error) {
OHIF.log.trace();
diff --git a/Packages/ohif-study-list/server/services/namespace.js b/Packages/ohif-study-list/server/services/namespace.js
deleted file mode 100644
index 08718df35..000000000
--- a/Packages/ohif-study-list/server/services/namespace.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Services = {};
-Services.QIDO = {};
-Services.WADO = {};
-Services.DIMSE = {};
-Services.REMOTE = {};
-
-remoteGetValue = function(obj) {
- return obj ? obj.Value : null;
-};
diff --git a/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.html b/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.html
index aa6dfa6fc..a1f7229cc 100644
--- a/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.html
+++ b/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.html
@@ -4,8 +4,8 @@
{{>imageThumbnail (clone this)}}
-
-
+
+
{{stack.seriesDescription}}
diff --git a/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.styl b/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.styl
index ce054be76..8e9e56502 100644
--- a/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.styl
+++ b/Packages/ohif-viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.styl
@@ -47,13 +47,7 @@ $seriesCountBackgroundColor = #678696
margin-left: 0
width: auto
- .seriesDescription
- float: left
- width: calc(100% - 50px)
-
.seriesInformation
- display: table
- float: right
padding-right: 4px
max-width: 50px
@@ -66,6 +60,9 @@ $seriesCountBackgroundColor = #678696
float: right
font-size: 12px
margin-left: 4px
+ overflow: hidden
+ text-overflow: ellipsis
+ white-space: nowrap
width: calc(100% - 15px)
.icon
diff --git a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepoint.js b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepoint.js
index d4314e09b..9b9f76375 100644
--- a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepoint.js
+++ b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepoint.js
@@ -68,7 +68,7 @@ Template.studyTimepoint.events({
$selection.removeClass('loading');
$selection.toggleClass('active');
// Recalculates the timepoint height to make CSS transition smoother
- const $thumbnails = $selection.find('.studyTimepointThumbnails');
+ const $thumbnails = $selection.find('.study-browser-series');
$thumbnails.one('transitionend', () => $timepoint.trigger('displayStateChanged'));
}
diff --git a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.html b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.html
index 68f22b7b5..a7a5da855 100644
--- a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.html
+++ b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.html
@@ -18,10 +18,12 @@
{{#if isSidebar}}
-
- {{#each thumbnail in (studyThumbnails this.study)}}
- {{>thumbnailEntry (clone this thumbnail=thumbnail)}}
- {{/each}}
+
+
+ {{#each thumbnail in (studyThumbnails this.study)}}
+ {{>thumbnailEntry (clone this thumbnail=thumbnail)}}
+ {{/each}}
+
{{/if}}
diff --git a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js
index 225abe574..293bbb57c 100644
--- a/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js
+++ b/Packages/ohif-viewerbase/client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js
@@ -52,7 +52,7 @@ Template.studyTimepointStudy.onCreated(() => {
}
const $study = instance.getStudyElement();
- const $thumbnails = $study.find('.studyTimepointThumbnails');
+ const $thumbnails = $study.find('.study-browser-series');
$study.addClass('active');
// If element already has max-height property set, .height()
// will return that value, so remove it to recalculate
@@ -80,7 +80,7 @@ Template.studyTimepointStudy.onRendered(() => {
Template.studyTimepointStudy.events({
// Recalculates the timepoint height to make CSS transition smoother
- 'transitionend .studyTimepointThumbnails'(event, instance) {
+ 'transitionend .study-browser-series'(event, instance) {
if (event.target === event.currentTarget) {
$(event.currentTarget).closest('.studyTimepoint').trigger('displayStateChanged');
}
@@ -117,7 +117,7 @@ Template.studyTimepointStudy.events({
if (!alreadyLoaded) {
const $studies = instance.getStudyElement(true);
$studies.trigger('loadStarted');
- OHIF.studylist.retrieveStudyMetadata(studyInstanceUid).then(study => {
+ OHIF.studies.retrieveStudyMetadata(studyInstanceUid).then(study => {
instance.data.study = study;
OHIF.viewer.Studies.insert(study);
diff --git a/Packages/ohif-viewerbase/client/lib/prepareViewerData.js b/Packages/ohif-viewerbase/client/lib/prepareViewerData.js
index 7d17bd714..32bc7f681 100644
--- a/Packages/ohif-viewerbase/client/lib/prepareViewerData.js
+++ b/Packages/ohif-viewerbase/client/lib/prepareViewerData.js
@@ -17,7 +17,7 @@ export const prepareViewerData = ({ studyInstanceUids, seriesInstanceUids, timep
// Retrieve the studies metadata
const promise = new Promise((resolve, reject) => {
const processData = viewerData => {
- OHIF.studylist.retrieveStudiesMetadata(viewerData.studyInstanceUids, viewerData.seriesInstanceUids).then(studies => {
+ OHIF.studies.retrieveStudiesMetadata(viewerData.studyInstanceUids, viewerData.seriesInstanceUids).then(studies => {
// Add additional metadata to our study from the studylist
studies.forEach(study => {
const studylistStudy = OHIF.studylist.collections.Studies.findOne({