Merge branch 'master' into fix/ohif-2570

This commit is contained in:
Igor Octaviano 2021-10-05 09:40:49 -03:00 committed by GitHub
commit 79afee7615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 150 additions and 9 deletions

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.12.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.2...@ohif/extension-vtk@1.12.3) (2021-10-04)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.12.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.1...@ohif/extension-vtk@1.12.2) (2021-09-28)
**Note:** Version bump only for package @ohif/extension-vtk

View File

@ -1,6 +1,6 @@
{
"name": "@ohif/extension-vtk",
"version": "1.12.2",
"version": "1.12.3",
"description": "OHIF extension for VTK.js",
"author": "OHIF",
"license": "MIT",
@ -53,7 +53,7 @@
"react-vtkjs-viewport": "^0.14.4"
},
"devDependencies": {
"@ohif/core": "^2.15.1",
"@ohif/core": "^2.16.0",
"@ohif/ui": "^1.10.2",
"cornerstone-tools": "^6.0.0",
"cornerstone-wado-image-loader": "^4.0.3",

View File

@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.16.0](https://github.com/OHIF/Viewers/compare/@ohif/core@2.15.1...@ohif/core@2.16.0) (2021-10-04)
### Features
* Added support for WADO servers built with static hosting (e.g. S3) ([#2566](https://github.com/OHIF/Viewers/issues/2566)) ([a046c6c](https://github.com/OHIF/Viewers/commit/a046c6c9017a84e5ead71d5113b5e892333b4130))
## [2.15.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.15.0...@ohif/core@2.15.1) (2021-09-28)
**Note:** Version bump only for package @ohif/core

View File

@ -1,6 +1,6 @@
{
"name": "@ohif/core",
"version": "2.15.1",
"version": "2.16.0",
"description": "Generic business logic for web-based medical imaging applications",
"author": "OHIF Core Team",
"license": "MIT",

View File

@ -0,0 +1,85 @@
import { api } from 'dicomweb-client';
/**
* An implementation of the static wado client, that fetches data from
* a static response rather than actually doing real queries. This allows
* fast encoding of test data, but because it is static, anything actually
* performing searches doesn't work. This version fixes the query issue
* by manually implementing a query option.
*/
export default class StaticWadoClient extends api.DICOMwebClient {
static filterKeys = {
StudyInstanceUID: '0020000D',
PatientName: '00100010',
PatientID: '00100020',
StudyDescription: '00081030',
ModalitiesInStudy: '00080061',
};
constructor(qidoConfig) {
super(qidoConfig);
this.staticWado = qidoConfig.staticWado;
this.extendMetadataWithInstances = qidoConfig.extendMetadataWithInstances;
}
async retrieveSeriesMetadata(options) {
if (!this.extendMetadataWithInstances)
return super.retrieveSeriesMetadata(options);
const results = await Promise.all([
super.retrieveSeriesMetadata(options),
this.searchForInstances(options),
]);
const metadata = results[0];
const instances = results[1];
return metadata.map(item => {
const sopUID = item['00080018'].Value[0];
const instance = instances.find(
instance => instance['00080018'].Value[0] == sopUID
);
Object.assign(item, instance);
return item;
});
}
async searchForStudies(options) {
if (!this.staticWado) return super.searchForStudies(options);
let searchResult = await super.searchForStudies(options);
const { queryParams } = options;
if (!queryParams) return searchResult;
const filtered = searchResult.filter(study => {
for (const key of Object.keys(StaticWadoClient.filterKeys)) {
if (!this.filterItem(key, queryParams, study)) return false;
}
return true;
});
return filtered;
}
filterItem(key, queryParams, study) {
const altKey = StaticWadoClient.filterKeys[key] || key;
if (!queryParams) return true;
const testValue = queryParams[key] || queryParams[altKey];
if (!testValue) return true;
const valueElem = study[key] || study[altKey];
if (!valueElem) return false;
const value = valueElem.Value;
return this.eqItem(testValue, value);
}
eqItem(testValue, value) {
if (testValue.filter) {
return (
testValue.filter(testItem => this.eqItem(testItem, value)).length > 0
);
}
if (value === testValue) return true;
if (typeof value == 'string') {
return value.indexOf(testValue) != -1;
}
if (value.Alphabetic) return this.eqItem(testValue, value.Alphabetic);
if (value.filter)
return value.filter(item => this.eqItem(testValue, item)).length > 0;
return false;
}
}

View File

@ -1,4 +1,5 @@
import { api } from 'dicomweb-client';
import StaticWadoClient from './StaticWadoClient';
import DICOMWeb from '../../../DICOMWeb/';
import errorHandler from '../../../errorHandler';
@ -115,14 +116,18 @@ function resultDataToStudies(resultData) {
}
export default function Studies(server, filter) {
const { staticWado } = server;
const config = {
...server,
url: server.qidoRoot,
headers: DICOMWeb.getAuthorizationHeader(server),
errorInterceptor: errorHandler.getHTTPErrorHandler(),
requestHooks: [getXHRRetryRequestHook()],
};
const dicomWeb = new api.DICOMwebClient(config);
const dicomWeb = staticWado
? new StaticWadoClient(config)
: new api.DICOMwebClient(config);
server.qidoSupportsIncludeField =
server.qidoSupportsIncludeField === undefined
? true

View File

@ -1,4 +1,4 @@
import { api } from 'dicomweb-client';
import StaticWadoClient from '../qido/StaticWadoClient';
import dcmjs from 'dcmjs';
import DICOMWeb from '../../../DICOMWeb/';
import RetrieveMetadataLoader from './retrieveMetadataLoader';
@ -73,7 +73,8 @@ export default class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader
configLoad() {
const { server } = this;
const client = new api.DICOMwebClient({
const client = new StaticWadoClient({
...server,
url: server.qidoRoot,
headers: DICOMWeb.getAuthorizationHeader(server),
errorInterceptor: errorHandler.getHTTPErrorHandler(),

View File

@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [4.12.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.11.2...@ohif/viewer@4.12.0) (2021-10-04)
### Features
* Added support for WADO servers built with static hosting (e.g. S3) ([#2566](https://github.com/OHIF/Viewers/issues/2566)) ([a046c6c](https://github.com/OHIF/Viewers/commit/a046c6c9017a84e5ead71d5113b5e892333b4130))
## [4.11.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.11.1...@ohif/viewer@4.11.2) (2021-09-28)
**Note:** Version bump only for package @ohif/viewer

View File

@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "4.11.2",
"version": "4.12.0",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@ -47,7 +47,7 @@
},
"dependencies": {
"@babel/runtime": "^7.5.5",
"@ohif/core": "^2.15.1",
"@ohif/core": "^2.16.0",
"@ohif/extension-cornerstone": "^2.12.1",
"@ohif/extension-debugging": "^0.3.0",
"@ohif/extension-dicom-html": "^1.3.11",
@ -56,7 +56,7 @@
"@ohif/extension-dicom-rt": "^0.7.1",
"@ohif/extension-dicom-segmentation": "^0.7.1",
"@ohif/extension-lesion-tracker": "^0.2.1",
"@ohif/extension-vtk": "^1.12.2",
"@ohif/extension-vtk": "^1.12.3",
"@ohif/i18n": "^0.53.0",
"@ohif/ui": "^1.10.2",
"@tanem/react-nprogress": "^1.1.25",

View File

@ -0,0 +1,20 @@
window.config = {
routerBasename: '/',
showStudyList: true,
servers: {
dicomWeb: [
{
name: 'LocalStatic',
wadoUriRoot: 'http://localhost:5000/',
qidoRoot: 'http://localhost:5000',
wadoRoot: 'http://localhost:5000/',
qidoSupportsIncludeField: false,
imageRendering: 'wadors',
thumbnailRendering: 'thumbnail',
enableStudyLazyLoad: true,
supportsFuzzyMatching: false,
staticWado: true,
},
],
},
};