-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(retrieve) : Allow OHIF retrieve from multiple servers #3633
feat(retrieve) : Allow OHIF retrieve from multiple servers #3633
Conversation
✅ Deploy Preview for ohif-platform-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
@@ Coverage Diff @@
## master #3633 +/- ##
==========================================
- Coverage 46.23% 45.57% -0.67%
==========================================
Files 78 79 +1
Lines 1276 1299 +23
Branches 312 319 +7
==========================================
+ Hits 590 592 +2
- Misses 548 562 +14
- Partials 138 145 +7
Continue to review full report in Codecov by Sentry.
|
82e871b
to
83acbd5
Compare
I will review after Igor if that is ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some questions to bootstrap the review process!
extensions/default/src/DicomWebDataSource/retrieveStudyMetadata.js
Outdated
Show resolved
Hide resolved
extensions/default/src/DicomWebDataSource/utils/clientManager.ts
Outdated
Show resolved
Hide resolved
a24bd7a
to
cd0db23
Compare
extensions/default/src/DicomWebDataSource/utils/clientManager.ts
Outdated
Show resolved
Hide resolved
extensions/default/src/DicomWebDataSource/utils/clientManager.ts
Outdated
Show resolved
Hide resolved
@rodrigobasilio2022 can you please finish the comments/follow up with @sedghi so we can merge this PR asap? I think you doing it its going to be a lot faster. Thanks in advance! |
@sedghi Done the modifications. Please review |
…rs into feat/TwoServers
Looks much! better, thanks. Do you think this is good enough? or we should be more specific, that grab from these two data sources. (we have |
The idea is to allow multiple configurations/instances per data source. Right now its only going to work for dicomweb data source but later we can add support for other kinds. I tink it does not affect the defaultDataSourceName property because that property is in the data sources level, and this change here is to allow multiple configurations/instances per data source. |
@igoroctaviano what I mean is that right now (after this PR), if there are 3 DICOM web data sources in the configuration it will try to fetch from all three which might or might not be ideal. @wayfarer3130 what do you think? should we be more explicit or not? Like right now If I try it it will say, since it is trying each server and I don't have my local servers up and runnign |
But if you dont want to use the three configurations, you have to set it properly. You can define multiple datasources, each one with multiple configurations and you can select the datasource depending on the mode. |
Please could we use the standard DICOM attributes for this: The basic idea:
That should be a lot easier to implement than a hierarhical structure, and can easily be replicated for non-DICOMweb type systems, or default values provided as a map or function somewhere. |
@@ -39,6 +39,7 @@ async function checkAndLoadContourData(instance, datasource) { | |||
StudyInstanceUID: instance.StudyInstanceUID, | |||
SeriesInstanceUID: instance.SeriesInstanceUID, | |||
SOPInstanceUID: instance.SOPInstanceUID, | |||
clientName: instance?.clientName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RetrieveAETitle
import getDirectURL from '../utils/getDirectURL'; | ||
import { fixBulkDataURI } from './utils/fixBulkDataURI'; | ||
import { | ||
mergedSearch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get rid of mergedSearch etc. You don't need to merge the search, simply perform each query against the named data source, providing the RetrieveAE in the keyed value.
}) || {}; | ||
|
||
const results = await qidoSearch(qidoDicomWebClient, undefined, undefined, mappedParams); | ||
const clients = dicomWebClientManager.getQidoClients(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just separate out the clients into separate configs, and lookup the global config with the given name. That way you can have multiple top level query entry points, and multiple users of those. That is:
RetrieveAE => query locaiton 1 with study data for some specific purpose
RetrieveAE 2 - global study data with global study query
AE 2 points to AE 1 for AE1 specific data, but otherwise AE 1 points to AE 2 for everything imaging related.
There are lots of situations like this. A true merge AE is a merge of the study level query results, and should be it's own data source type that is JUST merge.
* @param {Function} options.qidoSearch - The function to perform the QIDO search. | ||
* @returns {Promise<Array>} - A promise that resolves to the merged search results. | ||
*/ | ||
export const mergedSearch = async ({ clients, origParams, mapParams, qidoSearch }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you truly need merge search results, then you need to define how the merge happens, and that should be in a separate data source type, NOT in the DICOMweb type. That is, you might merge two DICOMweb data sources, and another one that is a different type entirely. Mixing it up in DICOMweb code is going to cause endless bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not part of the plan to merge conflicting results. The assumption is that each server will contain a unique set of data. Real conciliation of data is much more complex and not part of the scope of the PR.
await dataSource.reject.series( | ||
ds.StudyInstanceUID, | ||
ds.SeriesInstanceUID, | ||
ds.instances[0].clientName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ds.instance.RetrieveAETitle
You should have a single instance that defines the series rather than expecting instance 0 to be what you are viewing.
Delivered by #3788 |
Context
This PR is related to the issue #3507, and allows OHIF to search in a main server and retrieves series from multiple dicomweb servers.
Changes & Results
The main change is this PR is the ability to write a datasource configuration as an array, where one can define multiple servers configurations. The first one will be the main server and OHIF will use this configuration to search for studies. The other configurations will be used to retrieve series, as described in the issue. This PR also shows how to define parameters in a URL.
Testing
To test, one need to setup or use two different dicomweb servers, and prepare and subdivide some studies series between them. After that, define the configuration attribute of a datasource as an array as follow
dataSources: [
{
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
sourceName: 'dicomweb',
configuration: [{..}, {..}]
...
Here is one example of a datasource configuration with two dicomservers: one static wado server and other local orthanc server
Its important to define in each configuration the attribute that will uniquely identifies the configuration.
In my test, I used the oficial OHIF dicomweb server and a local one, with a TotalSegmentator series produced from a study in the oficial OHIF dicomweb server
Opening the study, both series will appear and the segmentation series could be opened, despite not listed in the main dicomweb server.
To test with the same data as displayed here, one can download this dicom segmentation file
https://drive.google.com/file/d/124RgsQNRp6EmQIie9jr-6m41DFzt-T-K/view?usp=drive_link
and use the link
http://localhost:3000/viewer?StudyInstanceUIDs=2.16.840.1.114362.1.11972228.22789312658.616067305.306.2
To test the URL parameter secondGoogleServer, one needs to setup two google datastores, one with the main series and another with derived series, and configure in the default.js file the main one. The second one should be configured as follows:
Note that the URL parameter is defined not in the OHIF code, but outside, in the default.js.
The following pictures demonstrate this functionality.
Main datastore, with two studies. Note that the expanded study has three series.
Opening the study using an URL with the secondGoogleServer parameter, it shows four series, the dicom seg series belonging only to the second server
Next picture shows that the parameter SeriesInstanceUID works to filter a particular series. Remember that this url parameter works as follows: it tries to filter the series, but if the result is empty, it returns all series found of a particular study. That's why the segmentation series also appears
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment