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

fix(modules): add stylus loader as an option to be uncommented #3710

Merged
merged 86 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a52a59d
feat(stylus): bring back the stylus loader temporarly
sedghi Aug 1, 2023
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
94a1f02
Merge branch 'master' of github.com:OHIF/Viewers into feat/monai-label
sedghi Aug 9, 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
7b13485
add load segmentation for dipslayset
sedghi Aug 11, 2023
df8b791
wip segmentation
sedghi Aug 15, 2023
8e1bd50
add required edits to make monai work
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
63857b7
wip
sedghi Aug 24, 2023
a620865
wip
sedghi Aug 24, 2023
8b23c2b
wip
sedghi Aug 24, 2023
43aa396
wip
sedghi Aug 25, 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
c7432fd
Merge branch 'feat/segmentation-mode' of github.com:OHIF/Viewers into…
sedghi Sep 12, 2023
3e2dd49
after rebase
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
326a39f
wip
sedghi Sep 12, 2023
78d8cab
Merge branch 'feat/segmentation-mode' of github.com:OHIF/Viewers into…
sedghi Sep 12, 2023
5bb78a6
more refactoring and docs
sedghi Sep 13, 2023
60a1133
Merge branch 'feat/segmentation-mode' of github.com:OHIF/Viewers into…
sedghi Sep 13, 2023
ee0c0ff
fix bugs
sedghi Sep 13, 2023
36cefeb
Merge branch 'master' of github.com:OHIF/Viewers into feat/monai-label
sedghi Sep 25, 2023
40e06be
after pull
sedghi Sep 25, 2023
c2d3b57
fix
sedghi Sep 25, 2023
bc54380
Merge branch 'master' of github.com:OHIF/Viewers into feat/monai-label
sedghi Oct 4, 2023
c299fe2
fix debug
sedghi Oct 4, 2023
4975d8d
Merge branch 'master' of github.com:OHIF/Viewers into feat/monai-label
sedghi Oct 7, 2023
3eb0095
fix panel study browswer
sedghi Oct 7, 2023
8b965f9
dont use shared array buffer in not secure
sedghi Oct 7, 2023
b2601ba
Merge branch 'master' of github.com:OHIF/Viewers into feat/monai-label
sedghi Oct 10, 2023
ec9bacc
reduce the diff
sedghi Oct 10, 2023
0db98c3
reduce the diff
sedghi Oct 10, 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
10 changes: 10 additions & 0 deletions .webpack/rules/stylusToJavaScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const stylusToJavaScript = {
test: /\.styl$/,
use: [
{ loader: 'style-loader' }, // 3. Style nodes from JS Strings
{ loader: 'css-loader' }, // 2. CSS to CommonJS
{ loader: 'stylus-loader' }, // 1. Stylus to CSS
],
};

module.exports = stylusToJavaScript;
4 changes: 4 additions & 0 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const loadShadersRule = require('./rules/loadShaders.js');
const loadWebWorkersRule = require('./rules/loadWebWorkers.js');
const transpileJavaScriptRule = require('./rules/transpileJavaScript.js');
const cssToJavaScript = require('./rules/cssToJavaScript.js');
const stylusToJavaScript = require('./rules/stylusToJavaScript.js');

// ~~ ENV VARS
const NODE_ENV = process.env.NODE_ENV;
Expand Down Expand Up @@ -112,6 +113,9 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
},
},
cssToJavaScript,
// Note: Only uncomment the following if you are using the old style of stylus in v2
// Also you need to uncomment this platform/app/.webpack/rules/extractStyleChunks.js
// stylusToJavaScript,
{
test: /\.wasm/,
type: 'asset/resource',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class SegmentationService extends PubSubService {
);
}

if (active !== undefined) {
if (active === true) {
this._setActiveSegment(segmentationId, segmentIndex, suppressEvents);
}

Expand Down Expand Up @@ -399,6 +399,23 @@ class SegmentationService extends PubSubService {
return segmentations && segmentations.map(m => this.segmentations[Object.keys(m)[0]]);
}

public getActiveSegmentation(): Segmentation {
const segmentations = this.getSegmentations();

return segmentations.find(segmentation => segmentation.isActive);
}

public getActiveSegment() {
const activeSegmentation = this.getActiveSegmentation();
const { activeSegmentIndex, segments } = activeSegmentation;

if (activeSegmentIndex === null) {
return;
}

return segments[activeSegmentIndex];
}

/**
* Get specific segmentation by its id.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default function toggleStackImageSync({
const { syncGroupService, viewportGridService, displaySetService, cornerstoneViewportService } =
servicesManager.services;

const viewports = providedViewports || getReconstructableStackViewports(viewportGridService, displaySetService);
const viewports =
providedViewports || getReconstructableStackViewports(viewportGridService, displaySetService);

// create synchronization group and add the viewports to it.
viewports.forEach(gridViewport => {
Expand Down Expand Up @@ -46,7 +47,7 @@ function disableSync(syncName, servicesManager) {
syncName
);
});
};
}

/**
* Gets the consistent spacing stack viewport types, which are the ones which
Expand Down Expand Up @@ -77,4 +78,4 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
}
});
return viewports;
};
}
8 changes: 4 additions & 4 deletions modes/longitudinal/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const dicomSeg = {
panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',
};

const dicomRt = {
const dicomRT = {
viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',
sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',
};
Expand Down Expand Up @@ -218,8 +218,8 @@ function modeFactory({ modeConfiguration }) {
displaySetsToDisplay: [dicomSeg.sopClassHandler],
},
{
namespace: dicomRt.viewport,
displaySetsToDisplay: [dicomRt.sopClassHandler],
namespace: dicomRT.viewport,
displaySetsToDisplay: [dicomRT.sopClassHandler],
},
],
},
Expand All @@ -240,7 +240,7 @@ function modeFactory({ modeConfiguration }) {
ohif.sopClassHandler,
dicompdf.sopClassHandler,
dicomsr.sopClassHandler,
dicomRt.sopClassHandler,
dicomRT.sopClassHandler,
],
hotkeys: [...hotkeys.defaults.hotkeyBindings],
...modeConfiguration,
Expand Down
11 changes: 11 additions & 0 deletions modes/segmentation/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"trailingComma": "es5",
"printWidth": 100,
"proseWrap": "always",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"singleAttributePerLine": true,
"endOfLine": "auto"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
"source-map-loader": "^4.0.1",
"start-server-and-test": "^1.10.0",
"style-loader": "^1.0.0",
"stylus": "^0.59.0",
"stylus-loader": "^7.1.3",
"terser-webpack-plugin": "^5.1.4",
"typescript": "4.6.4",
"unused-webpack-plugin": "2.4.0",
Expand Down
14 changes: 14 additions & 0 deletions platform/app/.webpack/rules/extractStyleChunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');

function extractStyleChunks(isProdBuild) {
return [
// If you are using the old stylus, you should uncomment this
// {
// test: /\.styl$/,
// use: [
// {
// loader: ExtractCssChunksPlugin.loader,
// options: {
// hot: !isProdBuild,
// },
// },
// { loader: 'css-loader' },
// { loader: 'stylus-loader' },
// ],
// },
{
test: /\.(sa|sc|c)ss$/,
use: [
Expand Down
26 changes: 25 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@adobe/css-tools@^4.0.1":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.2.0.tgz#e1a84fca468f4b337816fcb7f0964beb620ba855"
integrity sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==

"@algolia/[email protected]":
version "1.9.3"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7"
Expand Down Expand Up @@ -8456,7 +8461,7 @@ [email protected], debug@^2.6.0, debug@^2.6.9:
dependencies:
ms "2.0.0"

debug@4, [email protected], debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.3, debug@^4.3.4:
debug@4, [email protected], debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
Expand Down Expand Up @@ -19344,6 +19349,25 @@ [email protected]:
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51"
integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==

stylus-loader@^7.1.3:
version "7.1.3"
resolved "https://registry.yarnpkg.com/stylus-loader/-/stylus-loader-7.1.3.tgz#1fdfa0d34e8c05a569bc0902e1ecdb857d764964"
integrity sha512-TY0SKwiY7D2kMd3UxaWKSf3xHF0FFN/FAfsSqfrhxRT/koXTwffq2cgEWDkLQz7VojMu7qEEHt5TlMjkPx9UDw==
dependencies:
fast-glob "^3.2.12"
normalize-path "^3.0.0"

stylus@^0.59.0:
version "0.59.0"
resolved "https://registry.yarnpkg.com/stylus/-/stylus-0.59.0.tgz#a344d5932787142a141946536d6e24e6a6be7aa6"
integrity sha512-lQ9w/XIOH5ZHVNuNbWW8D822r+/wBSO/d6XvtyHLF7LW4KaCIDeVbvn5DF8fGCJAUCwVhVi/h6J0NUcnylUEjg==
dependencies:
"@adobe/css-tools" "^4.0.1"
debug "^4.3.2"
glob "^7.1.6"
sax "~1.2.4"
source-map "^0.7.3"

supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
Expand Down
Loading