Skip to content

Commit bf3f603

Browse files
yanqzsupre-commit-ci[bot]SachidanandAlle
authored
feat: update to ohif 3.11 (#1855)
* feat: update to ohif 3.11 Signed-off-by: yanq <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: yanq <[email protected]> * feat: update to ohif 3.11, fix pre-commit error Signed-off-by: Qingyu Yan <[email protected]> Signed-off-by: yanq <[email protected]> --------- Signed-off-by: yanq <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: SACHIDANAND ALLE <[email protected]>
1 parent e58392b commit bf3f603

File tree

9 files changed

+1069
-960
lines changed

9 files changed

+1069
-960
lines changed
Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
{
2-
"name": "@ohif/extension-monai-label",
3-
"version": "3.0.0",
4-
"description": "OHIFv3 extension for MONAI Label",
5-
"author": "OHIF,NVIDIA,KCL",
6-
"license": "MIT",
7-
"main": "dist/ohif-extension-monai-label.umd.js",
8-
"module": "src/index.tsx",
9-
"files": [
10-
"dist/**",
11-
"public/**",
12-
"README.md"
13-
],
14-
"repository": "OHIF/Viewers",
15-
"keywords": [
16-
"ohif-extension"
17-
],
18-
"publishConfig": {
19-
"access": "public"
20-
},
21-
"engines": {
22-
"node": ">=14",
23-
"npm": ">=6",
24-
"yarn": ">=1.18.0"
25-
},
26-
"scripts": {
27-
"clean": "shx rm -rf dist",
28-
"clean:deep": "yarn run clean && shx rm -rf node_modules",
29-
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo",
30-
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
31-
"build:package-1": "yarn run build",
32-
"start": "yarn run dev",
33-
"test:unit": "jest --watchAll",
34-
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
35-
},
36-
"peerDependencies": {
37-
"@ohif/core": "3.10.0-beta.5",
38-
"@ohif/extension-cornerstone": "3.10.0-beta.5",
39-
"@ohif/extension-default": "3.10.0-beta.5",
40-
"@ohif/i18n": "3.10.0-beta.5",
41-
"prop-types": "^15.6.2",
42-
"react": "^18.3.1",
43-
"react-dom": "^18.3.1",
44-
"react-i18next": "^12.2.2",
45-
"react-router": "^6.23.1",
46-
"react-router-dom": "^6.23.1"
47-
},
48-
"dependencies": {
49-
"@babel/runtime": "^7.20.13",
50-
"@cornerstonejs/adapters": "^2.2.3",
51-
"@cornerstonejs/core": "^2.2.3",
52-
"@kitware/vtk.js": "32.1.0",
53-
"react-color": "^2.19.3",
54-
"md5.js": "^1.3.5",
55-
"axios": "^0.21.1",
56-
"arraybuffer-concat": "^0.0.1",
57-
"ndarray": "^1.0.19",
58-
"nrrd-js": "^0.2.1",
59-
"pako": "^2.0.3",
60-
"bootstrap": "^5.0.2",
61-
"react-select": "^4.3.1",
62-
"chroma-js": "^2.1.2"
63-
},
64-
"devDependencies": {
65-
"@babel/runtime": "^7.20.13",
66-
"@cornerstonejs/adapters": "^2.2.3",
67-
"@cornerstonejs/core": "^2.2.3",
68-
"@cornerstonejs/tools": "^2.2.3",
69-
"react-color": "^2.19.3"
70-
}
71-
}
1+
{
2+
"name": "@ohif/extension-monai-label",
3+
"version": "3.0.0",
4+
"description": "OHIFv3 extension for MONAI Label",
5+
"author": "OHIF,NVIDIA,KCL",
6+
"license": "MIT",
7+
"main": "dist/ohif-extension-monai-label.umd.js",
8+
"module": "src/index.tsx",
9+
"files": [
10+
"dist/**",
11+
"public/**",
12+
"README.md"
13+
],
14+
"repository": "OHIF/Viewers",
15+
"keywords": [
16+
"ohif-extension"
17+
],
18+
"publishConfig": {
19+
"access": "public"
20+
},
21+
"engines": {
22+
"node": ">=14",
23+
"npm": ">=6",
24+
"yarn": ">=1.18.0"
25+
},
26+
"scripts": {
27+
"clean": "shx rm -rf dist",
28+
"clean:deep": "yarn run clean && shx rm -rf node_modules",
29+
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo",
30+
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
31+
"build:package-1": "yarn run build",
32+
"start": "yarn run dev",
33+
"test:unit": "jest --watchAll",
34+
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
35+
},
36+
"peerDependencies": {
37+
"@ohif/core": "3.11.0",
38+
"@ohif/extension-cornerstone": "3.11.0",
39+
"@ohif/extension-default": "3.11.0",
40+
"@ohif/i18n": "3.11.0",
41+
"prop-types": "^15.6.2",
42+
"react": "^18.3.1",
43+
"react-dom": "^18.3.1",
44+
"react-i18next": "^12.2.2",
45+
"react-router": "^6.23.1",
46+
"react-router-dom": "^6.23.1"
47+
},
48+
"dependencies": {
49+
"@babel/runtime": "^7.20.13",
50+
"@cornerstonejs/adapters": "^3.32.5",
51+
"@cornerstonejs/core": "^3.32.5",
52+
"@kitware/vtk.js": "32.12.0",
53+
"react-color": "^2.19.3",
54+
"md5.js": "^1.3.5",
55+
"axios": "^0.21.1",
56+
"arraybuffer-concat": "^0.0.1",
57+
"ndarray": "^1.0.19",
58+
"nrrd-js": "^0.2.1",
59+
"pako": "^2.0.3",
60+
"bootstrap": "^5.0.2",
61+
"react-select": "^4.3.1",
62+
"chroma-js": "^2.1.2"
63+
},
64+
"devDependencies": {
65+
"@babel/runtime": "^7.20.13",
66+
"@cornerstonejs/adapters": "^3.32.5",
67+
"@cornerstonejs/core": "^3.32.5",
68+
"@cornerstonejs/tools": "^3.32.5",
69+
"react-color": "^2.19.3"
70+
}
71+
}
Lines changed: 82 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,82 @@
1-
/*
2-
Copyright (c) MONAI Consortium
3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
5-
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
7-
Unless required by applicable law or agreed to in writing, software
8-
distributed under the License is distributed on an "AS IS" BASIS,
9-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10-
See the License for the specific language governing permissions and
11-
limitations under the License.
12-
*/
13-
14-
import React from 'react';
15-
import { Dialog, ButtonEnums } from '@ohif/ui';
16-
import OptionsForm from './actions/OptionsForm';
17-
18-
function optionsInputDialog(uiDialogService, config, info, callback) {
19-
const dialogId = 'monai-label-options';
20-
const optionsRef = React.createRef<OptionsForm>();
21-
22-
const onSubmitHandler = ({ action }) => {
23-
switch (action.id) {
24-
case 'save':
25-
callback(optionsRef.current.state.config, action.id);
26-
uiDialogService.dismiss({ id: dialogId });
27-
break;
28-
case 'cancel':
29-
callback({}, action.id);
30-
uiDialogService.dismiss({ id: dialogId });
31-
break;
32-
case 'reset':
33-
optionsRef.current.onReset();
34-
break;
35-
}
36-
};
37-
38-
uiDialogService.create({
39-
id: dialogId,
40-
centralize: true,
41-
isDraggable: false,
42-
showOverlay: true,
43-
content: Dialog,
44-
contentProps: {
45-
title: 'Options / Configurations',
46-
noCloseButton: true,
47-
onClose: () => uiDialogService.dismiss({ id: dialogId }),
48-
actions: [
49-
{ id: 'reset', text: 'Reset', type: ButtonEnums.type.secondary },
50-
{ id: 'cancel', text: 'Cancel', type: ButtonEnums.type.secondary },
51-
{ id: 'save', text: 'Confirm', type: ButtonEnums.type.primary },
52-
],
53-
onSubmit: onSubmitHandler,
54-
body: () => {
55-
return <OptionsForm ref={optionsRef} config={config} info={info} />;
56-
},
57-
},
58-
});
59-
}
60-
61-
export default optionsInputDialog;
1+
/*
2+
Copyright (c) MONAI Consortium
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
import React from 'react';
15+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, Button } from '@ohif/ui-next';
16+
import OptionsForm from './actions/OptionsForm';
17+
18+
function OptionsInputDialogComponent({ config, info, callback, hide }) {
19+
const optionsRef = React.useRef<OptionsForm>(null);
20+
21+
const handleSave = () => {
22+
if (optionsRef.current) {
23+
callback(optionsRef.current.state.config, 'save');
24+
}
25+
hide();
26+
};
27+
28+
const handleCancel = () => {
29+
callback({}, 'cancel');
30+
hide();
31+
};
32+
33+
const handleReset = () => {
34+
if (optionsRef.current) {
35+
optionsRef.current.onReset();
36+
}
37+
};
38+
39+
return (
40+
<Dialog open={true} onOpenChange={(open) => !open && handleCancel()}>
41+
<DialogContent className="max-w-4xl">
42+
<DialogHeader>
43+
<DialogTitle>Options / Configurations</DialogTitle>
44+
</DialogHeader>
45+
46+
<div className="py-4">
47+
<OptionsForm ref={optionsRef} config={config} info={info} />
48+
</div>
49+
50+
<DialogFooter className="flex gap-2">
51+
<Button variant="outline" onClick={handleReset}>
52+
Reset
53+
</Button>
54+
<Button variant="outline" onClick={handleCancel}>
55+
Cancel
56+
</Button>
57+
<Button onClick={handleSave}>
58+
Confirm
59+
</Button>
60+
</DialogFooter>
61+
</DialogContent>
62+
</Dialog>
63+
);
64+
}
65+
66+
function optionsInputDialog(uiDialogService, config, info, callback) {
67+
const dialogId = 'monai-label-options';
68+
69+
uiDialogService.show({
70+
id: dialogId,
71+
title: 'Options / Configurations',
72+
content: OptionsInputDialogComponent,
73+
shouldCloseOnEsc: true,
74+
contentProps: {
75+
config,
76+
info,
77+
callback,
78+
},
79+
});
80+
}
81+
82+
export default optionsInputDialog;

0 commit comments

Comments
 (0)