Skip to content
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/segmentation mode #3632

Merged
merged 104 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 100 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
9637f4c
add seg mode
sedghi Aug 4, 2023
3c882dc
initial panel
sedghi Aug 4, 2023
9ef0feb
add segmentation panel
sedghi Aug 4, 2023
2b2e566
segpanel initial work
sedghi Aug 4, 2023
acd5676
working seg panel
sedghi Aug 4, 2023
ba9e2f6
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Aug 9, 2023
eeef8e8
added panel secton
sedghi Aug 10, 2023
9768919
add panel section
sedghi Aug 10, 2023
f50f93a
add panel section
sedghi Aug 10, 2023
3946285
wip
sedghi Aug 10, 2023
c212ce6
start of new seg row
sedghi Aug 11, 2023
df8b791
wip segmentation
sedghi Aug 15, 2023
4fc8c49
wip
sedghi Aug 16, 2023
6215d0e
checkpoint
sedghi Aug 16, 2023
1de6081
wip
sedghi Aug 16, 2023
3aa36c5
working segment
sedghi Aug 16, 2023
6953f64
working everything
sedghi Aug 16, 2023
12e00fb
wip
sedghi Aug 16, 2023
98f4219
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Aug 16, 2023
696f29b
working read only with new design
sedghi Aug 17, 2023
dfddbb3
wip for the new edit mode
sedghi Aug 17, 2023
e3a0f3e
initial advanced toolbox
sedghi Aug 22, 2023
62d5f8a
wip
sedghi Aug 22, 2023
c4f118f
wip
sedghi Aug 22, 2023
6ee70f4
wip
sedghi Aug 22, 2023
96f4f5e
advanced toolbox
sedghi Aug 23, 2023
90656c4
wip sync between tools and toolbar
sedghi Aug 24, 2023
f832049
brushes work fine
sedghi Aug 25, 2023
fdc902e
wip input double range
sedghi Aug 26, 2023
9d1ea8c
segment and double range
sedghi Aug 28, 2023
5e130d7
wip
sedghi Aug 30, 2023
9909878
segmentation export works
sedghi Aug 30, 2023
5c56cff
wip
sedghi Sep 1, 2023
ba3b521
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 1, 2023
eab774a
wip new button groups
sedghi Sep 1, 2023
55214f7
fix button group design
sedghi Sep 1, 2023
f063ef5
working segmentation mode
sedghi Sep 5, 2023
f98c7c7
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 5, 2023
0e25075
remaining styles changes
sedghi Sep 5, 2023
dacd78a
after pull
sedghi Sep 6, 2023
25f5cde
update cs3d
sedghi Sep 6, 2023
9e9ba13
fix brush initial state
sedghi Sep 8, 2023
b36665a
fix add new segmentation
sedghi Sep 8, 2023
394023b
fix remove segmentation
sedghi Sep 8, 2023
893be36
fix seg config styles
sedghi Sep 8, 2023
68fd83a
fix seg tool box state syncs
sedghi Sep 8, 2023
7481cb5
fix tooltip
sedghi Sep 8, 2023
d7c04e4
fix row unlocked
sedghi Sep 8, 2023
48e5ef1
fix
sedghi Sep 11, 2023
534db04
fix extra segs getting created
sedghi Sep 11, 2023
30bb919
refactor hydration for segmentations
sedghi Sep 11, 2023
6ff8d03
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 11, 2023
da09815
update yarn lock
sedghi Sep 11, 2023
5865c0d
fix rest of seg
sedghi Sep 12, 2023
6b1064c
update pr with new cs3d
sedghi Sep 12, 2023
48f1d48
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 12, 2023
dac16b2
fix commands module
sedghi Sep 12, 2023
cfe7814
fix e2e unstable tests
sedghi Sep 12, 2023
90566dd
fix ui stuff
sedghi Sep 12, 2023
0360d83
fix more bugs
sedghi Sep 12, 2023
5bb78a6
more refactoring and docs
sedghi Sep 13, 2023
e15848c
fix initial mpr hp
sedghi Sep 13, 2023
b2d7488
fix bug
sedghi Sep 13, 2023
00112c5
fix various bugs
sedghi Sep 14, 2023
f026641
fix various icon discrepencies
sedghi Sep 14, 2023
97b65a6
fixed the thumbnail black
sedghi Sep 14, 2023
1c1fb34
wip
sedghi Sep 15, 2023
4c38cef
apply review comments
sedghi Sep 18, 2023
4bb9929
fix SR hydration - seems to be broken in master too
sedghi Sep 18, 2023
d5ac687
apply review comments
sedghi Sep 18, 2023
d1c1f95
update cs3d version
sedghi Sep 18, 2023
00ba117
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 18, 2023
2371ff9
try to fix e2e
sedghi Sep 18, 2023
4d883cb
try to fix e2e
sedghi Sep 19, 2023
b4f55a7
try to fix e2e
sedghi Sep 19, 2023
518fe18
try to fix e2e
sedghi Sep 19, 2023
1051db8
try to fix e2e
sedghi Sep 19, 2023
87a616c
try to fix e2e
sedghi Sep 19, 2023
1998224
try to fix e2e
sedghi Sep 19, 2023
6ff4af9
try to fix e2e
sedghi Sep 19, 2023
e5cb412
try to fix e2e
sedghi Sep 19, 2023
4964f7e
try to fix e2e
sedghi Sep 19, 2023
7cc8a04
try to fix e2e
sedghi Sep 19, 2023
4e46de5
try to fix e2e
sedghi Sep 19, 2023
ea1f1c6
try to fix e2e
sedghi Sep 19, 2023
6260294
try to fix e2e again
sedghi Sep 19, 2023
90ac343
e2e should work
sedghi Sep 19, 2023
6161791
make e2e work again
sedghi Sep 19, 2023
656582c
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 20, 2023
71c0bd0
make e2e work again 23
sedghi Sep 20, 2023
5518289
make e2e work again 231
sedghi Sep 20, 2023
4fb8c42
fix ci
sedghi Sep 20, 2023
3cdb653
try to hook it to cypress cloud again
sedghi Sep 20, 2023
85c5f30
make circleci run in parallel
sedghi Sep 20, 2023
11b35bd
for frodo
sedghi Sep 20, 2023
9258e18
cleanup buttons to separaet services and ui
sedghi Sep 20, 2023
5039a8a
fixed the remaining bugs
sedghi Sep 20, 2023
80f7002
fix toolbar button activation
sedghi Sep 21, 2023
6aeee99
fixed doc
sedghi Sep 21, 2023
8980f34
fix e2e
sedghi Sep 21, 2023
8be7114
fix button bugs
sedghi Sep 21, 2023
8198428
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 21, 2023
2d8ebd3
apply review comments
sedghi Sep 22, 2023
d4f6b0f
Merge branch 'master' of github.com:OHIF/Viewers into feat/segmentati…
sedghi Sep 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 48 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ version: 2.1
##
orbs:
codecov: codecov/[email protected]
cypress: cypress-io/cypress@1.26.0
executors:
# Custom executor to override Cypress config
deploy-to-prod-executor:
docker:
- image: cimg/node:16.14
environment:
CYPRESS_BASE_URL: https://ohif-staging.netlify.com/
chrome-and-pacs:
docker:
# Primary container image where all steps run.
- image: 'cypress/browsers:node16.14.2-slim-chrome103-ff102'
cypress: cypress-io/cypress@3
# executors:
# # Custom executor to override Cypress config
# deploy-to-prod-executor:
# docker:
# - image: cimg/node:16.14
# environment:
# CYPRESS_BASE_URL: https://ohif-staging.netlify.com/
# chrome-and-pacs:
# docker:
# # Primary container image where all steps run.
# - image: 'cypress/browsers:node18.12.0-chrome106-ff106'

defaults: &defaults
docker:
Expand Down Expand Up @@ -363,32 +363,20 @@ jobs:
fi

workflows:
version: 2

PR_CHECKS:
jobs:
- UNIT_TESTS

# E2E: PWA
- cypress/run:
name: 'E2E: PWA'
executor: chrome-and-pacs
browser: chrome
pre-steps:
- run: |
# Clear yarn cache; use yarn from image (update image to update yarn)
rm -rf ~/.yarn
yarn -v
yarn: true
record: true
store_artifacts: true
working_directory: platform/app
build: yarn test:data
start: yarn run test:e2e:serve
spec: 'cypress/integration/**/*'
wait-on: 'http://localhost:3000'
cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
no-workspace: true # Don't persist workspace
start-command: yarn run test:data && yarn run test:e2e:serve
install-browsers: true
cypress-command:
'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run
--record --browser chrome --parallel'
package-manager: 'yarn'
cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
cypress-cache-path: '~/.cache/Cypress'
post-steps:
- store_artifacts:
path: platform/app/cypress/screenshots
Expand All @@ -399,34 +387,34 @@ workflows:
requires:
- UNIT_TESTS

PR_OPTIONAL_VISUAL_TESTS:
jobs:
- AWAIT_APPROVAL:
type: approval
# Update hub.docker.org
- cypress/run:
name: 'Generate Percy Snapshots'
executor: cypress/browsers-chrome76
browser: chrome
pre-steps:
- run: 'rm -rf ~/.yarn && yarn -v && yarn global add wait-on'
yarn: true
store_artifacts: false
working_directory: platform/app
build:
yarn test:data && npx cross-env QUICK_BUILD=true APP_CONFIG=config/dicomweb-server.js
yarn run build
# start server --> verify running --> percy + chrome + cypress
command: yarn run test:e2e:dist
cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
no-workspace: true # Don't persist workspace
post-steps:
- store_artifacts:
path: platform/app/cypress/screenshots
- store_artifacts:
path: platform/app/cypress/videos
requires:
- AWAIT_APPROVAL
# PR_OPTIONAL_VISUAL_TESTS:
# jobs:
# - AWAIT_APPROVAL:
# type: approval
# # Update hub.docker.org
# - cypress/run:
# name: 'Generate Percy Snapshots'
# executor: cypress/browsers-chrome76
# browser: chrome
# pre-steps:
# - run: 'rm -rf ~/.yarn && yarn -v && yarn global add wait-on'
# yarn: true
# store_artifacts: false
# working_directory: platform/app
# build:
# yarn test:data && npx cross-env QUICK_BUILD=true APP_CONFIG=config/dicomweb-server.js
# yarn run build
# # start server --> verify running --> percy + chrome + cypress
# command: yarn run test:e2e:dist
# cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
# no-workspace: true # Don't persist workspace
# post-steps:
# - store_artifacts:
# path: platform/app/cypress/screenshots
# - store_artifacts:
# path: platform/app/cypress/videos
# requires:
# - AWAIT_APPROVAL

# Our master branch deploys to viewer-dev.ohif.org, the viewer.ohif.org is
# deployed from the release branch which is more stable and less frequently updated.
Expand Down
2 changes: 0 additions & 2 deletions extensions/cornerstone-dicom-rt/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { id } from './id';
import React from 'react';
import { Types } from '@ohif/core';
import getSopClassHandlerModule from './getSopClassHandlerModule';
import hydrateRTDisplaySet from './utils/_hydrateRT';

const Component = React.lazy(() => {
return import(/* webpackPrefetch: true */ './viewports/OHIFCornerstoneRTViewport');
Expand Down Expand Up @@ -60,4 +59,3 @@ const extension: Types.Extensions.Extension = {
};

export default extension;
export { hydrateRTDisplaySet };
70 changes: 0 additions & 70 deletions extensions/cornerstone-dicom-rt/src/utils/_hydrateRT.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function createRTToolGroupAndAddTools(ToolGroupService, customizationService, toolGroupId) {
const { tools } = customizationService.get('cornerstone.overlayViewportTools') ?? {};

return ToolGroupService.createToolGroupAndAddTools(toolGroupId, tools, {});
return ToolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}

export default createRTToolGroupAndAddTools;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ButtonEnums } from '@ohif/ui';
import hydrateRTDisplaySet from './_hydrateRT';

const RESPONSE = {
NO_NEVER: -1,
Expand All @@ -13,6 +12,7 @@ function promptHydrateRT({
viewportId,
toolGroupId = 'default',
preHydrateCallbacks,
hydrateRTDisplaySet,
}) {
const { uiViewportDialogService } = servicesManager.services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import PropTypes from 'prop-types';
import OHIF, { utils } from '@ohif/core';
import { ViewportActionBar, useViewportGrid, LoadingIndicatorTotalPercent } from '@ohif/ui';

import _hydrateRTdisplaySet from '../utils/_hydrateRT';
import promptHydrateRT from '../utils/promptHydrateRT';
import _getStatusComponent from './_getStatusComponent';
import createRTToolGroupAndAddTools from '../utils/initRTToolGroup';
import _hydrateRTDisplaySet from '../utils/_hydrateRT';

const { formatDate } = utils;
const RT_TOOLGROUP_BASE_NAME = 'RTToolGroup';
Expand Down Expand Up @@ -95,6 +93,13 @@ function OHIFCornerstoneRTViewport(props) {
});
}, [viewportGrid]);

const hydrateRTDisplaySet = ({ rtDisplaySet, viewportId }) => {
commandsManager.runCommand('loadSegmentationDisplaySetsForViewport', {
displaySets: [rtDisplaySet],
viewportId,
});
};

const getCornerstoneViewport = useCallback(() => {
const { component: Component } = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.viewportModule.cornerstone'
Expand Down Expand Up @@ -154,6 +159,7 @@ function OHIFCornerstoneRTViewport(props) {
viewportId,
rtDisplaySet,
preHydrateCallbacks: [storePresentationState],
hydrateRTDisplaySet,
}).then(isHydrated => {
if (isHydrated) {
setIsHydrated(true);
Expand Down Expand Up @@ -295,10 +301,9 @@ function OHIFCornerstoneRTViewport(props) {
// presentation state (w/l and invert) and then opens the RT. If we don't store
// the presentation state, the viewport will be reset to the default presentation
storePresentationState();
const isHydrated = await _hydrateRTDisplaySet({
const isHydrated = await hydrateRTDisplaySet({
rtDisplaySet,
viewportId,
servicesManager,
});

setIsHydrated(isHydrated);
Expand Down
1 change: 1 addition & 0 deletions extensions/cornerstone-dicom-seg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"react-router-dom": "^6.8.1"
},
"dependencies": {
"@cornerstonejs/tools": "^1.16.4",
"@babel/runtime": "^7.20.13",
"react-color": "^2.19.3"
}
Expand Down
Loading
Loading