@cornerstonejs/codemods 5.19.4 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/package.json +2 -2
- package/registry/cornerstone3d/6/README.md +87 -0
- package/registry/cornerstone3d/6/classes-and-types/README.md +113 -0
- package/registry/cornerstone3d/6/classes-and-types/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/classes-and-types/scripts/classes-and-types.ts +1461 -0
- package/registry/cornerstone3d/6/classes-and-types/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/edge-namespace-and-reported/expected.tsx +27 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/edge-namespace-and-reported/input.tsx +27 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/edge-namespace-and-reported/metrics.json +36 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/edge-already-6/expected.ts +15 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/edge-already-6/input.ts +15 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/negative-other-packages/expected.ts +11 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/negative-other-packages/input.ts +11 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-3d-family-of-predicate-or-cast-object/expected.ts +55 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-3d-family-of-predicate-or-cast-object/input.ts +51 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-3d-family-of-predicate-or-cast-object/metrics.json +36 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-types-from-the-types-subpath/expected.ts +26 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-types-from-the-types-subpath/input.ts +26 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/ohif-types-from-the-types-subpath/metrics.json +52 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-3d-evidence/expected.ts +34 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-3d-evidence/input.ts +30 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-3d-evidence/metrics.json +12 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-classes/expected.ts +35 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-classes/input.ts +35 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-classes/metrics.json +28 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-types-and-casts/expected.ts +46 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-types-and-casts/input.ts +42 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-class-import-cleanup-orphans-shorthand/expected.ts +4 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-class-import-cleanup-orphans-shorthand/input.ts +4 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-class-import-cleanup-orphans-shorthand/metrics.json +12 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-check-can-prevent-the-first-mount/expected.ts +24 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-check-can-prevent-the-first-mount/input.ts +25 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-check-can-prevent-the-first-mount/metrics.json +38 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-replacement-inverts-comparison/expected.ts +11 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-replacement-inverts-comparison/input.ts +11 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-instanceof-replacement-inverts-comparison/metrics.json +20 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-negative-3d-test-taken-as-3d-viewport/expected.ts +29 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-negative-3d-test-taken-as-3d-viewport/input.ts +29 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-negative-3d-test-taken-as-3d-viewport/metrics.json +20 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-re-exports-of-removed-classes/expected.ts +6 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-re-exports-of-removed-classes/input.ts +6 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-re-exports-of-removed-classes/metrics.json +20 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-type-only-namespace-used-as-value/expected.ts +8 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-type-only-namespace-used-as-value/input.ts +8 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review-type-only-namespace-used-as-value/metrics.json +12 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-instanceof-mount-proof-crosses-shadowed-binding/expected.ts +19 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-instanceof-mount-proof-crosses-shadowed-binding/input.ts +19 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-instanceof-mount-proof-crosses-shadowed-binding/metrics.json +22 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-unrelated-discriminator-taken-as-3d-proof/expected.ts +40 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-unrelated-discriminator-taken-as-3d-proof/input.ts +40 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review2-unrelated-discriminator-taken-as-3d-proof/metrics.json +28 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review3-conditional-viewport-type-taken-as-3d/expected.ts +39 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review3-conditional-viewport-type-taken-as-3d/input.ts +38 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review3-conditional-viewport-type-taken-as-3d/metrics.json +20 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-spread-or-computed-key-overrides-viewport-type/expected.ts +76 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-spread-or-computed-key-overrides-viewport-type/input.ts +75 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-spread-or-computed-key-overrides-viewport-type/metrics.json +36 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-viewport-family-proved-on-another-engine/expected.ts +92 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-viewport-family-proved-on-another-engine/input.ts +91 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/review4-viewport-family-proved-on-another-engine/metrics.json +20 -0
- package/registry/cornerstone3d/6/classes-and-types/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/codemod.yaml +19 -0
- package/registry/cornerstone3d/6/display-sets/README.md +173 -0
- package/registry/cornerstone3d/6/display-sets/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/display-sets/scripts/display-sets.ts +965 -0
- package/registry/cornerstone3d/6/display-sets/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes/expected.tsx +32 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes/input.tsx +32 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes/metrics.json +84 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes-on-a-typed-engine/expected.tsx +33 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes-on-a-typed-engine/input.tsx +33 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/edge-reported-shapes-on-a-typed-engine/metrics.json +84 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/positive-javascript/expected.js +23 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/positive-javascript/input.js +17 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/review-commonjs-module-gets-es-import/expected.js +10 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/review-commonjs-module-gets-es-import/input.js +10 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/review-commonjs-module-gets-es-import/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/negative-already-6/expected.ts +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/negative-already-6/input.ts +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-set-volumes-for-viewports/expected.ts +27 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-set-volumes-for-viewports/input.ts +27 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-set-volumes-for-viewports/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-stack-and-volume/expected.ts +37 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-stack-and-volume/input.ts +31 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-stack-and-volume/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-video-and-ecg/expected.ts +15 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/positive-video-and-ecg/input.ts +15 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-conditional-mount-breaks-control-flow/expected.ts +26 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-conditional-mount-breaks-control-flow/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-conditional-mount-breaks-control-flow/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-conditional-viewport-lists-and-callback-capture/expected.ts +46 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-conditional-viewport-lists-and-callback-capture/input.ts +21 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-generated-references-resolve-to-shadowing-parameter/expected.ts +23 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-generated-references-resolve-to-shadowing-parameter/input.ts +13 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-optional-mounts-become-unconditional/expected.ts +11 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-optional-mounts-become-unconditional/input.ts +11 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-optional-mounts-become-unconditional/metrics.json +28 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-regenerated-import-drops-comments/expected.ts +22 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-regenerated-import-drops-comments/input.ts +15 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-stack-display-set-id-reused-across-series/expected.ts +41 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-stack-display-set-id-reused-across-series/input.ts +16 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/expected.ts +11 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/input.ts +11 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-helper-binding-still-used/expected.ts +46 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-helper-binding-still-used/input.ts +17 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-helper-binding-still-used/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-registration-references-image-list-outside-block/expected.ts +16 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-registration-references-image-list-outside-block/input.ts +16 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review-volume-registration-references-image-list-outside-block/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-bracketed-and-re-exported-data-names/expected.ts +19 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-bracketed-and-re-exported-data-names/input.ts +19 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-bracketed-and-re-exported-data-names/metrics.json +44 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-generic-container-taken-as-viewport/expected.ts +22 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-generic-container-taken-as-viewport/input.ts +22 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-generic-container-taken-as-viewport/metrics.json +36 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-image-list-getter-read-twice/expected.ts +62 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-image-list-getter-read-twice/input.ts +28 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-missing-target-partly-updates-layout/expected.ts +50 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-missing-target-partly-updates-layout/input.ts +25 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-missing-target-partly-updates-layout/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-reassigned-receiver-keeps-initializer-evidence/expected.ts +45 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-reassigned-receiver-keeps-initializer-evidence/input.ts +39 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-reassigned-receiver-keeps-initializer-evidence/metrics.json +36 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-stack-ids-collide-across-engines/expected.ts +24 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-stack-ids-collide-across-engines/input.ts +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-volume-registration-attaches-another-series/expected.ts +47 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-volume-registration-attaches-another-series/input.ts +42 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review2-volume-registration-attaches-another-series/metrics.json +28 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-computed-option-key-overrides-image-ids/expected.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-computed-option-key-overrides-image-ids/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-computed-option-key-overrides-image-ids/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-loop-increment-taken-as-volume-creation/expected.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-loop-increment-taken-as-volume-creation/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-loop-increment-taken-as-volume-creation/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-mixed-family-targets-partly-update-layout/expected.ts +42 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-mixed-family-targets-partly-update-layout/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-ecg-mount-empty-after-the-call/expected.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-ecg-mount-empty-after-the-call/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-ecg-mount-empty-after-the-call/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-helper-blocks-async-function/expected.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-helper-blocks-async-function/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-helper-blocks-async-function/metrics.json +12 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-stack-mount-blocks-async-function/expected.ts +19 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-stack-mount-blocks-async-function/input.ts +19 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-stack-mount-blocks-async-function/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-video-mount-empty-after-the-call/expected.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-video-mount-empty-after-the-call/input.ts +18 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-video-mount-empty-after-the-call/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-volume-mount-blocks-async-function/expected.ts +23 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-volume-mount-blocks-async-function/input.ts +23 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-unawaited-volume-mount-blocks-async-function/metrics.json +20 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-viewport-getter-read-three-times/expected.ts +34 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review3-viewport-getter-read-three-times/input.ts +19 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review4-argument-getter-redirects-stack-mount/expected.ts +80 -0
- package/registry/cornerstone3d/6/display-sets/tests/typescript/review4-argument-getter-redirects-stack-mount/input.ts +50 -0
- package/registry/cornerstone3d/6/display-sets/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/events/README.md +65 -0
- package/registry/cornerstone3d/6/events/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/events/scripts/events.ts +442 -0
- package/registry/cornerstone3d/6/events/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/events/tests/tsx/edge-reported-and-conflicts/expected.tsx +18 -0
- package/registry/cornerstone3d/6/events/tests/tsx/edge-reported-and-conflicts/input.tsx +18 -0
- package/registry/cornerstone3d/6/events/tests/tsx/edge-reported-and-conflicts/metrics.json +46 -0
- package/registry/cornerstone3d/6/events/tests/typescript/negative-other-events/expected.ts +10 -0
- package/registry/cornerstone3d/6/events/tests/typescript/negative-other-events/input.ts +10 -0
- package/registry/cornerstone3d/6/events/tests/typescript/ohif-core-events-export/expected.ts +22 -0
- package/registry/cornerstone3d/6/events/tests/typescript/ohif-core-events-export/input.ts +22 -0
- package/registry/cornerstone3d/6/events/tests/typescript/ohif-core-events-export/metrics.json +54 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-destructured/expected.ts +20 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-destructured/input.ts +20 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-destructured/metrics.json +12 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-members/expected.ts +16 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-members/input.ts +16 -0
- package/registry/cornerstone3d/6/events/tests/typescript/positive-members/metrics.json +52 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-aliased-event-destructuring-left-silently/expected.ts +5 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-aliased-event-destructuring-left-silently/input.ts +5 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-aliased-event-destructuring-left-silently/metrics.json +12 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-event-destructuring-introduces-undeclared-name/expected.ts +9 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-event-destructuring-introduces-undeclared-name/input.ts +10 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-event-destructuring-introduces-undeclared-name/metrics.json +20 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-removed-event-strings-not-reported/expected.ts +11 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-removed-event-strings-not-reported/input.ts +11 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review-removed-event-strings-not-reported/metrics.json +28 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review2-quoted-defaulted-and-bracketed-event-keys/expected.ts +15 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review2-quoted-defaulted-and-bracketed-event-keys/input.ts +15 -0
- package/registry/cornerstone3d/6/events/tests/typescript/review2-quoted-defaulted-and-bracketed-event-keys/metrics.json +62 -0
- package/registry/cornerstone3d/6/events/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/settings/README.md +69 -0
- package/registry/cornerstone3d/6/settings/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/settings/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/settings/scripts/settings.ts +647 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/edge-namespace-and-reported/expected.tsx +18 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/edge-namespace-and-reported/input.tsx +18 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/edge-namespace-and-reported/metrics.json +46 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/negative-other-names/expected.ts +18 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/negative-other-names/input.ts +18 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-configuration/expected.ts +27 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-configuration/input.ts +28 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-configuration/metrics.json +46 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-functions/expected.ts +32 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-functions/input.ts +33 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/positive-functions/metrics.json +36 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-aliased-setting-imports-removed-while-used/expected.ts +10 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-aliased-setting-imports-removed-while-used/input.ts +9 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-aliased-setting-imports-removed-while-used/metrics.json +22 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-generated-references-resolve-to-shadowing-locals/expected.ts +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-generated-references-resolve-to-shadowing-locals/input.ts +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-import-name-collision-calls-undefined/expected.ts +9 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-import-name-collision-calls-undefined/input.ts +9 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-import-name-collision-calls-undefined/metrics.json +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-settings-deletes-unrelated-configuration/expected.ts +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-settings-deletes-unrelated-configuration/input.ts +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review-settings-deletes-unrelated-configuration/metrics.json +28 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-adjacent-obsolete-settings/expected.ts +24 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-adjacent-obsolete-settings/input.ts +29 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-adjacent-obsolete-settings/metrics.json +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-nested-cpu-getter-in-rewritten-setting/expected.ts +3 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-nested-cpu-getter-in-rewritten-setting/input.ts +3 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-nested-cpu-getter-in-rewritten-setting/metrics.json +12 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-re-exported-setting-names/expected.ts +1 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-re-exported-setting-names/input.ts +1 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-re-exported-setting-names/metrics.json +20 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-spread-boolean-tuple/expected.ts +6 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-spread-boolean-tuple/input.ts +6 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review2-spread-boolean-tuple/metrics.json +22 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review3-shorthand-cpu-setting/expected.ts +13 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review3-shorthand-cpu-setting/input.ts +13 -0
- package/registry/cornerstone3d/6/settings/tests/typescript/review3-shorthand-cpu-setting/metrics.json +12 -0
- package/registry/cornerstone3d/6/settings/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/tools/README.md +59 -0
- package/registry/cornerstone3d/6/tools/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/tools/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/tools/scripts/tools.ts +517 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/edge-removed-names/expected.tsx +36 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/edge-removed-names/input.tsx +36 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/edge-removed-names/metrics.json +60 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/negative-other-modules/expected.ts +13 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/negative-other-modules/input.ts +13 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/positive-moved-modules/expected.ts +11 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/positive-moved-modules/input.ts +11 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/positive-viewport-capabilities-to-core/expected.ts +13 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/positive-viewport-capabilities-to-core/input.ts +13 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review-moved-import-collides-with-local/expected.ts +7 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review-moved-import-collides-with-local/input.ts +7 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review-viewport-capabilities-not-plain/expected.ts +26 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review-viewport-capabilities-not-plain/input.ts +26 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review-viewport-capabilities-not-plain/metrics.json +60 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review2-barrel-re-export-of-moved-module/expected.ts +6 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review2-barrel-re-export-of-moved-module/input.ts +6 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review2-barrel-re-export-of-moved-module/metrics.json +28 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review3-side-effect-and-empty-imports-of-deleted-module/expected.ts +12 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review3-side-effect-and-empty-imports-of-deleted-module/input.ts +12 -0
- package/registry/cornerstone3d/6/tools/tests/typescript/review3-side-effect-and-empty-imports-of-deleted-module/metrics.json +36 -0
- package/registry/cornerstone3d/6/tools/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/viewport-members/README.md +101 -0
- package/registry/cornerstone3d/6/viewport-members/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/viewport-members/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/viewport-members/scripts/viewport-members.ts +815 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members/expected.tsx +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members/input.tsx +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members/metrics.json +100 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members-on-a-typed-viewport/expected.tsx +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members-on-a-typed-viewport/input.tsx +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/edge-reported-members-on-a-typed-viewport/metrics.json +100 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/negative-other-receivers/expected.ts +24 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/negative-other-receivers/input.ts +24 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-3d-presentation/expected.ts +11 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-3d-presentation/input.ts +11 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-3d-presentation/metrics.json +28 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-engine-render-frame-of-reference/expected.ts +16 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-engine-render-frame-of-reference/input.ts +16 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-engine-render-frame-of-reference/metrics.json +28 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-presentation-and-view/expected.ts +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-presentation-and-view/input.ts +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-questions-and-actors/expected.ts +31 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-questions-and-actors/input.ts +26 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-questions-and-actors/metrics.json +22 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-video-and-ecg/expected.ts +15 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-video-and-ecg/input.ts +15 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/positive-video-and-ecg/metrics.json +28 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-generated-imports-invalidate-file-directives/expected.ts +5 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-generated-imports-invalidate-file-directives/input.ts +5 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-generated-imports-invalidate-file-directives/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-quoted-presentation-key-loses-effect/expected.ts +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-quoted-presentation-key-loses-effect/input.ts +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-quoted-presentation-key-loses-effect/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-slice-index-rewrite-mishandles-references/expected.ts +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-slice-index-rewrite-mishandles-references/input.ts +12 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-slice-index-rewrite-mishandles-references/metrics.json +20 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/expected.ts +9 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/input.ts +9 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/metrics.json +20 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-bracket-access-hides-removed-methods/expected.ts +11 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-bracket-access-hides-removed-methods/input.ts +11 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-bracket-access-hides-removed-methods/metrics.json +36 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-re-exported-core-helpers/expected.ts +5 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-re-exported-core-helpers/input.ts +5 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review2-re-exported-core-helpers/metrics.json +20 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review3-conditional-mount-drops-presentation/expected.ts +58 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review3-conditional-mount-drops-presentation/input.ts +58 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review3-conditional-mount-drops-presentation/metrics.json +20 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review4-strict-bounds-and-actor-volume-ids/expected.ts +16 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review4-strict-bounds-and-actor-volume-ids/input.ts +16 -0
- package/registry/cornerstone3d/6/viewport-members/tests/typescript/review4-strict-bounds-and-actor-volume-ids/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-members/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/viewport-types/README.md +73 -0
- package/registry/cornerstone3d/6/viewport-types/codemod.yaml +20 -0
- package/registry/cornerstone3d/6/viewport-types/scripts/lib.ts +2386 -0
- package/registry/cornerstone3d/6/viewport-types/scripts/viewport-types.ts +714 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/edge-reported-sites/expected.tsx +57 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/edge-reported-sites/input.tsx +57 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/edge-reported-sites/metrics.json +70 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/edge-already-6/expected.ts +25 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/edge-already-6/input.ts +25 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/negative-other-names/expected.ts +22 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/negative-other-names/input.ts +22 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-destructured-viewport-type/expected.ts +68 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-destructured-viewport-type/input.ts +65 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-destructured-viewport-type/metrics.json +46 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-namespaced-and-aliased/expected.ts +20 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-namespaced-and-aliased/input.ts +19 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-namespaced-and-aliased/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-strings/expected.ts +25 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-strings/input.ts +24 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-strings/metrics.json +22 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-destructured-viewport-type-members/expected.ts +19 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-destructured-viewport-type-members/input.ts +19 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-destructured-viewport-type-members/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-type-check-can-prevent-the-first-mount/expected.ts +27 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-type-check-can-prevent-the-first-mount/input.ts +27 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-type-check-can-prevent-the-first-mount/metrics.json +28 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/expected.ts +9 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/input.ts +9 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-like-name-rewrites-unrelated-objects/metrics.json +20 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-type-pass-changes-unrelated-discriminators/expected.ts +18 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-type-pass-changes-unrelated-discriminators/input.ts +18 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review-viewport-type-pass-changes-unrelated-discriminators/metrics.json +30 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-mount-proof-crosses-shadowed-binding/expected.ts +42 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-mount-proof-crosses-shadowed-binding/input.ts +42 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-mount-proof-crosses-shadowed-binding/metrics.json +36 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-quoted-defaulted-and-bracketed-viewport-type-keys/expected.ts +10 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-quoted-defaulted-and-bracketed-viewport-type-keys/input.ts +10 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/review2-quoted-defaulted-and-bracketed-viewport-type-keys/metrics.json +36 -0
- package/registry/cornerstone3d/6/viewport-types/workflow.yaml +29 -0
- package/registry/cornerstone3d/6/workflow.yaml +26 -0
- package/scripts/test-registry-packages.mjs +86 -0
- package/scripts/validate-registry-packages.mjs +43 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Enums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
import type { Types } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
const { ViewportType } = Enums;
|
|
6
|
+
|
|
7
|
+
function inputFor(
|
|
8
|
+
viewportInput: Types.PublicViewportInput,
|
|
9
|
+
isStack: boolean,
|
|
10
|
+
options
|
|
11
|
+
) {
|
|
12
|
+
if (viewportInput.type === ViewportType.STACK) {
|
|
13
|
+
return viewportInput;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
switch (viewportInput.type) {
|
|
17
|
+
case ViewportType.ORTHOGRAPHIC:
|
|
18
|
+
return viewportInput;
|
|
19
|
+
default:
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
viewportId: 'conditional',
|
|
26
|
+
element: document.createElement('div'),
|
|
27
|
+
type: isStack ? ViewportType.PLANAR : ViewportType.PLANAR,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
viewportId: 'perspective',
|
|
31
|
+
element: document.createElement('div'),
|
|
32
|
+
type: ViewportType.PERSPECTIVE,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
viewportId: 'shorthand',
|
|
36
|
+
element: document.createElement('div'),
|
|
37
|
+
type: ViewportType.PLANAR,
|
|
38
|
+
defaultOptions,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
viewportId: 'stretched',
|
|
42
|
+
element: document.createElement('div'),
|
|
43
|
+
type: 'perspective',
|
|
44
|
+
defaultOptions: { displayArea: options.displayArea },
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const storedLayout = 'planarNext';
|
|
50
|
+
|
|
51
|
+
export function Viewer({ engine }: { engine: RenderingEngine }) {
|
|
52
|
+
return (
|
|
53
|
+
<div data-type={storedLayout} data-engine={engine.id}>
|
|
54
|
+
{String(inputFor)}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Enums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
import type { Types } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
const { ViewportType } = Enums;
|
|
6
|
+
|
|
7
|
+
function inputFor(
|
|
8
|
+
viewportInput: Types.PublicViewportInput,
|
|
9
|
+
isStack: boolean,
|
|
10
|
+
options
|
|
11
|
+
) {
|
|
12
|
+
if (viewportInput.type === ViewportType.STACK) {
|
|
13
|
+
return viewportInput;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
switch (viewportInput.type) {
|
|
17
|
+
case ViewportType.ORTHOGRAPHIC:
|
|
18
|
+
return viewportInput;
|
|
19
|
+
default:
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
viewportId: 'conditional',
|
|
26
|
+
element: document.createElement('div'),
|
|
27
|
+
type: isStack ? ViewportType.STACK : ViewportType.ORTHOGRAPHIC,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
viewportId: 'perspective',
|
|
31
|
+
element: document.createElement('div'),
|
|
32
|
+
type: ViewportType.PERSPECTIVE,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
viewportId: 'shorthand',
|
|
36
|
+
element: document.createElement('div'),
|
|
37
|
+
type: ViewportType.ORTHOGRAPHIC,
|
|
38
|
+
defaultOptions,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
viewportId: 'stretched',
|
|
42
|
+
element: document.createElement('div'),
|
|
43
|
+
type: 'perspective',
|
|
44
|
+
defaultOptions: { displayArea: options.displayArea },
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const storedLayout = 'planarNext';
|
|
50
|
+
|
|
51
|
+
export function Viewer({ engine }: { engine: RenderingEngine }) {
|
|
52
|
+
return (
|
|
53
|
+
<div data-type={storedLayout} data-engine={engine.id}>
|
|
54
|
+
{String(inputFor)}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.tsx",
|
|
6
|
+
"line": "12",
|
|
7
|
+
"rule": "ViewportType.STACK"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.tsx",
|
|
14
|
+
"line": "17",
|
|
15
|
+
"rule": "ViewportType.ORTHOGRAPHIC"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.tsx",
|
|
22
|
+
"line": "32",
|
|
23
|
+
"rule": "ViewportType.PERSPECTIVE"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"cardinality": {
|
|
29
|
+
"file": "input.tsx",
|
|
30
|
+
"line": "37",
|
|
31
|
+
"rule": "ViewportType.ORTHOGRAPHIC: orientation"
|
|
32
|
+
},
|
|
33
|
+
"count": 1
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"cardinality": {
|
|
37
|
+
"file": "input.tsx",
|
|
38
|
+
"line": "43",
|
|
39
|
+
"rule": "'perspective'"
|
|
40
|
+
},
|
|
41
|
+
"count": 1
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"cardinality": {
|
|
45
|
+
"file": "input.tsx",
|
|
46
|
+
"line": "44",
|
|
47
|
+
"rule": "defaultOptions.displayArea"
|
|
48
|
+
},
|
|
49
|
+
"count": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"cardinality": {
|
|
53
|
+
"file": "input.tsx",
|
|
54
|
+
"line": "49",
|
|
55
|
+
"rule": "'planarNext'"
|
|
56
|
+
},
|
|
57
|
+
"count": 1
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"cornerstone3d-6-review": [
|
|
61
|
+
{
|
|
62
|
+
"cardinality": {
|
|
63
|
+
"file": "input.tsx",
|
|
64
|
+
"line": "27",
|
|
65
|
+
"rule": "ViewportType.ORTHOGRAPHIC: orientation"
|
|
66
|
+
},
|
|
67
|
+
"count": 1
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PlanarViewport } from '@cornerstonejs/core';
|
|
2
|
+
import { Enums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ViewportType } = Enums;
|
|
5
|
+
const engine = new RenderingEngine('engine');
|
|
6
|
+
|
|
7
|
+
engine.setViewports([
|
|
8
|
+
{
|
|
9
|
+
viewportId: 'axial',
|
|
10
|
+
element,
|
|
11
|
+
type: ViewportType.PLANAR,
|
|
12
|
+
defaultOptions: { orientation: Enums.OrientationAxis.AXIAL },
|
|
13
|
+
},
|
|
14
|
+
{ viewportId: '3d', element: element3d, type: ViewportType.VOLUME_3D },
|
|
15
|
+
{ viewportId: 'video', element: videoElement, type: 'video' },
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
const viewport = engine.getViewport<PlanarViewport>('axial');
|
|
19
|
+
|
|
20
|
+
if (
|
|
21
|
+
viewport.getCurrentMode() === 'volume' &&
|
|
22
|
+
viewport.type === ViewportType.PLANAR
|
|
23
|
+
) {
|
|
24
|
+
console.log('a volume');
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PlanarViewport } from '@cornerstonejs/core';
|
|
2
|
+
import { Enums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ViewportType } = Enums;
|
|
5
|
+
const engine = new RenderingEngine('engine');
|
|
6
|
+
|
|
7
|
+
engine.setViewports([
|
|
8
|
+
{
|
|
9
|
+
viewportId: 'axial',
|
|
10
|
+
element,
|
|
11
|
+
type: ViewportType.PLANAR,
|
|
12
|
+
defaultOptions: { orientation: Enums.OrientationAxis.AXIAL },
|
|
13
|
+
},
|
|
14
|
+
{ viewportId: '3d', element: element3d, type: ViewportType.VOLUME_3D },
|
|
15
|
+
{ viewportId: 'video', element: videoElement, type: 'video' },
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
const viewport = engine.getViewport<PlanarViewport>('axial');
|
|
19
|
+
|
|
20
|
+
if (
|
|
21
|
+
viewport.getCurrentMode() === 'volume' &&
|
|
22
|
+
viewport.type === ViewportType.PLANAR
|
|
23
|
+
) {
|
|
24
|
+
console.log('a volume');
|
|
25
|
+
}
|
package/registry/cornerstone3d/6/viewport-types/tests/typescript/negative-other-names/expected.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Enums as csToolsEnums } from '@cornerstonejs/tools';
|
|
2
|
+
import { getRenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
enum ViewportType {
|
|
5
|
+
STACK = 'mine',
|
|
6
|
+
ORTHOGRAPHIC = 'other',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const mine = ViewportType.STACK;
|
|
10
|
+
const tool = csToolsEnums.MouseBindings.Primary;
|
|
11
|
+
const layout = { type: 'stack', columns: 2 };
|
|
12
|
+
|
|
13
|
+
function describe(viewport) {
|
|
14
|
+
return viewport.getCurrentMode() === 'stack' ? 'a stack' : 'a volume';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log(
|
|
18
|
+
mine,
|
|
19
|
+
tool,
|
|
20
|
+
layout,
|
|
21
|
+
describe(getRenderingEngine('e').getViewport('v'))
|
|
22
|
+
);
|
package/registry/cornerstone3d/6/viewport-types/tests/typescript/negative-other-names/input.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Enums as csToolsEnums } from '@cornerstonejs/tools';
|
|
2
|
+
import { getRenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
enum ViewportType {
|
|
5
|
+
STACK = 'mine',
|
|
6
|
+
ORTHOGRAPHIC = 'other',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const mine = ViewportType.STACK;
|
|
10
|
+
const tool = csToolsEnums.MouseBindings.Primary;
|
|
11
|
+
const layout = { type: 'stack', columns: 2 };
|
|
12
|
+
|
|
13
|
+
function describe(viewport) {
|
|
14
|
+
return viewport.getCurrentMode() === 'stack' ? 'a stack' : 'a volume';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log(
|
|
18
|
+
mine,
|
|
19
|
+
tool,
|
|
20
|
+
layout,
|
|
21
|
+
describe(getRenderingEngine('e').getViewport('v'))
|
|
22
|
+
);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { RenderingEngine, Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ViewportType } = Enums;
|
|
5
|
+
|
|
6
|
+
const renderingEngine = new RenderingEngine('engine');
|
|
7
|
+
|
|
8
|
+
const viewportInputArray = [
|
|
9
|
+
{
|
|
10
|
+
viewportId: 'CT_STACK',
|
|
11
|
+
type: ViewportType.PLANAR,
|
|
12
|
+
element: element1,
|
|
13
|
+
defaultOptions: {
|
|
14
|
+
background: [0.2, 0, 0.2] as Types.Point3,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
viewportId: 'CT_SAGITTAL',
|
|
19
|
+
type: ViewportType.PLANAR,
|
|
20
|
+
element: element2,
|
|
21
|
+
defaultOptions: {
|
|
22
|
+
orientation: Enums.OrientationAxis.SAGITTAL,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
viewportId: 'CT_AXIAL',
|
|
27
|
+
type: ViewportType.PLANAR,
|
|
28
|
+
defaultOptions: { orientation: Enums.OrientationAxis.AXIAL },
|
|
29
|
+
element: element3,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
viewportId: 'CT_DEFAULT',
|
|
33
|
+
type: ViewportType.PLANAR,
|
|
34
|
+
element: element4,
|
|
35
|
+
defaultOptions: {
|
|
36
|
+
orientation: Enums.OrientationAxis.AXIAL,
|
|
37
|
+
background: [0, 0, 0] as Types.Point3,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
viewportId: 'NEXT',
|
|
42
|
+
type: ViewportType.PLANAR,
|
|
43
|
+
element: element5,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
viewportId: 'CT_COMMENTED',
|
|
47
|
+
type: ViewportType.PLANAR,
|
|
48
|
+
element: element6,
|
|
49
|
+
defaultOptions: {
|
|
50
|
+
orientation: Enums.OrientationAxis.AXIAL,
|
|
51
|
+
// orientation: Enums.OrientationAxis.SAGITTAL,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
renderingEngine.setViewports(viewportInputArray);
|
|
57
|
+
|
|
58
|
+
const viewport = renderingEngine.getViewport('CT_STACK');
|
|
59
|
+
|
|
60
|
+
if (viewport.type === ViewportType.STACK) {
|
|
61
|
+
console.log('stack');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (viewport.type !== ViewportType.ORTHOGRAPHIC) {
|
|
65
|
+
console.log('not a volume');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const threeD = ViewportType.VOLUME_3D;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { RenderingEngine, Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ViewportType } = Enums;
|
|
5
|
+
|
|
6
|
+
const renderingEngine = new RenderingEngine('engine');
|
|
7
|
+
|
|
8
|
+
const viewportInputArray = [
|
|
9
|
+
{
|
|
10
|
+
viewportId: 'CT_STACK',
|
|
11
|
+
type: ViewportType.STACK,
|
|
12
|
+
element: element1,
|
|
13
|
+
defaultOptions: {
|
|
14
|
+
background: [0.2, 0, 0.2] as Types.Point3,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
viewportId: 'CT_SAGITTAL',
|
|
19
|
+
type: ViewportType.ORTHOGRAPHIC,
|
|
20
|
+
element: element2,
|
|
21
|
+
defaultOptions: {
|
|
22
|
+
orientation: Enums.OrientationAxis.SAGITTAL,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
viewportId: 'CT_AXIAL',
|
|
27
|
+
type: ViewportType.ORTHOGRAPHIC,
|
|
28
|
+
element: element3,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
viewportId: 'CT_DEFAULT',
|
|
32
|
+
type: ViewportType.ORTHOGRAPHIC,
|
|
33
|
+
element: element4,
|
|
34
|
+
defaultOptions: {
|
|
35
|
+
background: [0, 0, 0] as Types.Point3,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
viewportId: 'NEXT',
|
|
40
|
+
type: ViewportType.PLANAR_NEXT,
|
|
41
|
+
element: element5,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
viewportId: 'CT_COMMENTED',
|
|
45
|
+
type: ViewportType.ORTHOGRAPHIC,
|
|
46
|
+
element: element6,
|
|
47
|
+
defaultOptions: {
|
|
48
|
+
// orientation: Enums.OrientationAxis.SAGITTAL,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
renderingEngine.setViewports(viewportInputArray);
|
|
54
|
+
|
|
55
|
+
const viewport = renderingEngine.getViewport('CT_STACK');
|
|
56
|
+
|
|
57
|
+
if (viewport.type === ViewportType.STACK) {
|
|
58
|
+
console.log('stack');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (viewport.type !== ViewportType.ORTHOGRAPHIC) {
|
|
62
|
+
console.log('not a volume');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const threeD = ViewportType.VOLUME_3D_NEXT;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "57",
|
|
7
|
+
"rule": "ViewportType.STACK: the viewport may not show its data yet"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.ts",
|
|
14
|
+
"line": "61",
|
|
15
|
+
"rule": "ViewportType.ORTHOGRAPHIC: the viewport may not show its data yet"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"cornerstone3d-6-review": [
|
|
21
|
+
{
|
|
22
|
+
"cardinality": {
|
|
23
|
+
"file": "input.ts",
|
|
24
|
+
"line": "27",
|
|
25
|
+
"rule": "ViewportType.ORTHOGRAPHIC: default orientation AXIAL"
|
|
26
|
+
},
|
|
27
|
+
"count": 1
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"cardinality": {
|
|
31
|
+
"file": "input.ts",
|
|
32
|
+
"line": "32",
|
|
33
|
+
"rule": "ViewportType.ORTHOGRAPHIC: default orientation AXIAL"
|
|
34
|
+
},
|
|
35
|
+
"count": 1
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"cardinality": {
|
|
39
|
+
"file": "input.ts",
|
|
40
|
+
"line": "45",
|
|
41
|
+
"rule": "ViewportType.ORTHOGRAPHIC: default orientation AXIAL"
|
|
42
|
+
},
|
|
43
|
+
"count": 1
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
2
|
+
import { Enums as csEnums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const engine = new RenderingEngine('engine');
|
|
5
|
+
|
|
6
|
+
engine.enableElement({
|
|
7
|
+
viewportId: 'stack',
|
|
8
|
+
element,
|
|
9
|
+
type: cornerstone.Enums.ViewportType.PLANAR,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
engine.enableElement({
|
|
13
|
+
viewportId: 'axial',
|
|
14
|
+
element,
|
|
15
|
+
type: csEnums.ViewportType.PLANAR,
|
|
16
|
+
defaultOptions: { orientation: csEnums.OrientationAxis.AXIAL },
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const video = csEnums.ViewportType.VIDEO;
|
|
20
|
+
export const slide = cornerstone.Enums.ViewportType.WHOLE_SLIDE;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
2
|
+
import { Enums as csEnums, RenderingEngine } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const engine = new RenderingEngine('engine');
|
|
5
|
+
|
|
6
|
+
engine.enableElement({
|
|
7
|
+
viewportId: 'stack',
|
|
8
|
+
element,
|
|
9
|
+
type: cornerstone.Enums.ViewportType.STACK,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
engine.enableElement({
|
|
13
|
+
viewportId: 'axial',
|
|
14
|
+
element,
|
|
15
|
+
type: csEnums.ViewportType.ORTHOGRAPHIC,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const video = csEnums.ViewportType.VIDEO_NEXT;
|
|
19
|
+
export const slide = cornerstone.Enums.ViewportType.WHOLE_SLIDE_NEXT;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RenderingEngine, Enums } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const engine = new RenderingEngine('engine');
|
|
4
|
+
|
|
5
|
+
engine.setViewports([
|
|
6
|
+
{ viewportId: 'a', element: elementA, type: 'planar' },
|
|
7
|
+
{
|
|
8
|
+
viewportId: 'b',
|
|
9
|
+
element: elementB,
|
|
10
|
+
type: 'planar',
|
|
11
|
+
defaultOptions: { orientation: Enums.OrientationAxis.AXIAL },
|
|
12
|
+
},
|
|
13
|
+
{ viewportId: 'c', element: elementC, type: 'planar' },
|
|
14
|
+
{ viewportId: 'd', element: elementD, type: 'ecg' },
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const viewport = engine.getViewport('a');
|
|
18
|
+
|
|
19
|
+
if (viewport.type === 'stack') {
|
|
20
|
+
console.log('a stack');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (viewport.type === 'video') {
|
|
24
|
+
console.log('a video');
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RenderingEngine } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const engine = new RenderingEngine('engine');
|
|
4
|
+
|
|
5
|
+
engine.setViewports([
|
|
6
|
+
{ viewportId: 'a', element: elementA, type: 'stack' },
|
|
7
|
+
{
|
|
8
|
+
viewportId: 'b',
|
|
9
|
+
element: elementB,
|
|
10
|
+
type: 'orthographic',
|
|
11
|
+
},
|
|
12
|
+
{ viewportId: 'c', element: elementC, type: 'planarNext' },
|
|
13
|
+
{ viewportId: 'd', element: elementD, type: 'ecgNext' },
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
const viewport = engine.getViewport('a');
|
|
17
|
+
|
|
18
|
+
if (viewport.type === 'stack') {
|
|
19
|
+
console.log('a stack');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (viewport.type === 'videoNext') {
|
|
23
|
+
console.log('a video');
|
|
24
|
+
}
|
package/registry/cornerstone3d/6/viewport-types/tests/typescript/positive-strings/metrics.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "18",
|
|
7
|
+
"rule": "'stack': the viewport may not show its data yet"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"cornerstone3d-6-review": [
|
|
13
|
+
{
|
|
14
|
+
"cardinality": {
|
|
15
|
+
"file": "input.ts",
|
|
16
|
+
"line": "10",
|
|
17
|
+
"rule": "'orthographic': default orientation AXIAL"
|
|
18
|
+
},
|
|
19
|
+
"count": 1
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Enums } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
STACK: STACK_VIEW,
|
|
5
|
+
PLANAR: PLANAR_NEXT,
|
|
6
|
+
VOLUME_3D: THREE_D,
|
|
7
|
+
} = Enums.ViewportType;
|
|
8
|
+
|
|
9
|
+
export const options = {
|
|
10
|
+
viewportId: 'A',
|
|
11
|
+
element: document.body,
|
|
12
|
+
type: STACK_VIEW,
|
|
13
|
+
};
|
|
14
|
+
export const planar = {
|
|
15
|
+
viewportId: 'B',
|
|
16
|
+
element: document.body,
|
|
17
|
+
type: PLANAR_NEXT,
|
|
18
|
+
};
|
|
19
|
+
export const threeD = THREE_D;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Enums } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
STACK: STACK_VIEW,
|
|
5
|
+
PLANAR_NEXT,
|
|
6
|
+
VOLUME_3D_NEXT: THREE_D,
|
|
7
|
+
} = Enums.ViewportType;
|
|
8
|
+
|
|
9
|
+
export const options = {
|
|
10
|
+
viewportId: 'A',
|
|
11
|
+
element: document.body,
|
|
12
|
+
type: STACK_VIEW,
|
|
13
|
+
};
|
|
14
|
+
export const planar = {
|
|
15
|
+
viewportId: 'B',
|
|
16
|
+
element: document.body,
|
|
17
|
+
type: PLANAR_NEXT,
|
|
18
|
+
};
|
|
19
|
+
export const threeD = THREE_D;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Enums, RenderingEngine } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const renderingEngine = new RenderingEngine('engine');
|
|
4
|
+
|
|
5
|
+
export async function show(imageIds: string[]) {
|
|
6
|
+
const viewport = renderingEngine.getViewport('CT');
|
|
7
|
+
|
|
8
|
+
if (viewport.type === Enums.ViewportType.STACK) {
|
|
9
|
+
await viewport.setStack(imageIds);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (viewport?.type !== Enums.ViewportType.STACK) {
|
|
13
|
+
return 'volume';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return viewport.type === 'stack' ? 'stack' : 'other';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function afterMount(imageIds: string[]) {
|
|
20
|
+
const viewport = renderingEngine.getViewport('CT');
|
|
21
|
+
|
|
22
|
+
await viewport.setStack(imageIds);
|
|
23
|
+
|
|
24
|
+
if (viewport.getCurrentMode() !== 'volume') {
|
|
25
|
+
return viewport?.getCurrentMode() === 'stack';
|
|
26
|
+
}
|
|
27
|
+
}
|