@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,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
viewportSupportsImageSlices,
|
|
3
|
+
viewportSupportsStackCalibration as canCalibrate,
|
|
4
|
+
} from '@cornerstonejs/core/utilities';
|
|
5
|
+
export { viewportSupportsImageSlices as supportsImageSlices } from '@cornerstonejs/core/utilities';
|
|
6
|
+
|
|
7
|
+
export function calibrate(viewport, imageId: string) {
|
|
8
|
+
if (viewportSupportsImageSlices(viewport) && canCalibrate(viewport)) {
|
|
9
|
+
viewport.calibrateSpacing(imageId);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const checks = { viewportSupportsImageSlices };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
viewportSupportsImageSlices,
|
|
3
|
+
viewportSupportsStackCalibration as canCalibrate,
|
|
4
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
5
|
+
export { viewportSupportsImageSlices as supportsImageSlices } from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
6
|
+
|
|
7
|
+
export function calibrate(viewport, imageId: string) {
|
|
8
|
+
if (viewportSupportsImageSlices(viewport) && canCalibrate(viewport)) {
|
|
9
|
+
viewport.calibrateSpacing(imageId);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const checks = { viewportSupportsImageSlices };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createVolumeLabelmapPlan as createLegacyVolumeLabelmapPlan } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/volumeLabelmapPlan';
|
|
2
|
+
|
|
3
|
+
export function createVolumeLabelmapPlan() {
|
|
4
|
+
return createLegacyVolumeLabelmapPlan;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const plans = { createLegacyVolumeLabelmapPlan };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createLegacyVolumeLabelmapPlan } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/legacyVolumePlan';
|
|
2
|
+
|
|
3
|
+
export function createVolumeLabelmapPlan() {
|
|
4
|
+
return createLegacyVolumeLabelmapPlan;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const plans = { createLegacyVolumeLabelmapPlan };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ImageSliceViewport } from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
2
|
+
import * as capabilities from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
3
|
+
import {
|
|
4
|
+
viewportSupportsStackCalibration,
|
|
5
|
+
viewportSupportsStackCompatibility,
|
|
6
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
7
|
+
import {
|
|
8
|
+
type StackCalibrationViewport,
|
|
9
|
+
viewportSupportsImageSlices,
|
|
10
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
11
|
+
export {
|
|
12
|
+
viewportSupportsImageSlices as supportsImageSlices,
|
|
13
|
+
type ImageSliceViewport as SliceViewport,
|
|
14
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
15
|
+
export * from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
16
|
+
|
|
17
|
+
export function check(
|
|
18
|
+
viewport: ImageSliceViewport | StackCalibrationViewport
|
|
19
|
+
): boolean {
|
|
20
|
+
return (
|
|
21
|
+
capabilities.viewportSupportsImageSlices(viewport) &&
|
|
22
|
+
viewportSupportsStackCalibration(viewport) &&
|
|
23
|
+
viewportSupportsStackCompatibility(viewport) &&
|
|
24
|
+
viewportSupportsImageSlices(viewport)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ImageSliceViewport } from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
2
|
+
import * as capabilities from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
3
|
+
import {
|
|
4
|
+
viewportSupportsStackCalibration,
|
|
5
|
+
viewportSupportsStackCompatibility,
|
|
6
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
7
|
+
import {
|
|
8
|
+
type StackCalibrationViewport,
|
|
9
|
+
viewportSupportsImageSlices,
|
|
10
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
11
|
+
export {
|
|
12
|
+
viewportSupportsImageSlices as supportsImageSlices,
|
|
13
|
+
type ImageSliceViewport as SliceViewport,
|
|
14
|
+
} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
15
|
+
export * from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
16
|
+
|
|
17
|
+
export function check(
|
|
18
|
+
viewport: ImageSliceViewport | StackCalibrationViewport
|
|
19
|
+
): boolean {
|
|
20
|
+
return (
|
|
21
|
+
capabilities.viewportSupportsImageSlices(viewport) &&
|
|
22
|
+
viewportSupportsStackCalibration(viewport) &&
|
|
23
|
+
viewportSupportsStackCompatibility(viewport) &&
|
|
24
|
+
viewportSupportsImageSlices(viewport)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "1",
|
|
7
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.ts",
|
|
14
|
+
"line": "11",
|
|
15
|
+
"rule": "export of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.ts",
|
|
22
|
+
"line": "15",
|
|
23
|
+
"rule": "export of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"cardinality": {
|
|
29
|
+
"file": "input.ts",
|
|
30
|
+
"line": "2",
|
|
31
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
32
|
+
},
|
|
33
|
+
"count": 1
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"cardinality": {
|
|
37
|
+
"file": "input.ts",
|
|
38
|
+
"line": "3",
|
|
39
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
40
|
+
},
|
|
41
|
+
"count": 1
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"cardinality": {
|
|
45
|
+
"file": "input.ts",
|
|
46
|
+
"line": "5",
|
|
47
|
+
"rule": "viewportSupportsStackCompatibility"
|
|
48
|
+
},
|
|
49
|
+
"count": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"cardinality": {
|
|
53
|
+
"file": "input.ts",
|
|
54
|
+
"line": "7",
|
|
55
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
56
|
+
},
|
|
57
|
+
"count": 1
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { syncLegacyLabelmapData } from '@cornerstonejs/tools/segmentation/labelmapModel/labelmapPrimaryLayerFields';
|
|
2
|
+
export { createVolumeLabelmapPlan as createLegacyVolumeLabelmapPlan } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/volumeLabelmapPlan';
|
|
3
|
+
export { createVolumeLabelmapPlan as planFor } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/volumeLabelmapPlan';
|
|
4
|
+
export * from '@cornerstonejs/tools/segmentation/labelmapModel/labelmapLegacyAdapter';
|
|
5
|
+
export { getSlabThicknessOrDefault } from '@cornerstonejs/tools/utilities/genericViewportToolHelpers';
|
|
6
|
+
export * as rotation from '@cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { syncLegacyLabelmapData } from '@cornerstonejs/tools/segmentation/labelmapModel/labelmapLegacyAdapter';
|
|
2
|
+
export { createLegacyVolumeLabelmapPlan } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/legacyVolumePlan';
|
|
3
|
+
export { createLegacyVolumeLabelmapPlan as planFor } from '@cornerstonejs/tools/tools/displayTools/Labelmap/labelmapRenderPlan/legacyVolumePlan';
|
|
4
|
+
export * from '@cornerstonejs/tools/segmentation/labelmapModel/labelmapLegacyAdapter';
|
|
5
|
+
export { getSlabThicknessOrDefault } from '@cornerstonejs/tools/utilities/genericViewportToolHelpers';
|
|
6
|
+
export * as rotation from '@cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "4",
|
|
7
|
+
"rule": "export of @cornerstonejs/tools/segmentation/labelmapModel/labelmapLegacyAdapter"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.ts",
|
|
14
|
+
"line": "5",
|
|
15
|
+
"rule": "getSlabThicknessOrDefault"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.ts",
|
|
22
|
+
"line": "6",
|
|
23
|
+
"rule": "export of @cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
2
|
+
import {} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
3
|
+
|
|
4
|
+
export async function loadCapabilities() {
|
|
5
|
+
return import('@cornerstonejs/tools/utilities/viewportCapabilities');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function loadRotation() {
|
|
9
|
+
return import(
|
|
10
|
+
'@cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint'
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
2
|
+
import {} from '@cornerstonejs/tools/utilities/viewportCapabilities';
|
|
3
|
+
|
|
4
|
+
export async function loadCapabilities() {
|
|
5
|
+
return import('@cornerstonejs/tools/utilities/viewportCapabilities');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function loadRotation() {
|
|
9
|
+
return import(
|
|
10
|
+
'@cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint'
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "1",
|
|
7
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.ts",
|
|
14
|
+
"line": "2",
|
|
15
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.ts",
|
|
22
|
+
"line": "5",
|
|
23
|
+
"rule": "import of @cornerstonejs/tools/utilities/viewportCapabilities"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"cardinality": {
|
|
29
|
+
"file": "input.ts",
|
|
30
|
+
"line": "9",
|
|
31
|
+
"rule": "import of @cornerstonejs/tools/utilities/spatial/rotateViewportAroundWorldPoint"
|
|
32
|
+
},
|
|
33
|
+
"count": 1
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
version: '1'
|
|
2
|
+
nodes:
|
|
3
|
+
- id: tools
|
|
4
|
+
name: Cornerstone3D 6.0 tools
|
|
5
|
+
steps:
|
|
6
|
+
- name: Rewrite the tools modules in TypeScript files
|
|
7
|
+
js-ast-grep:
|
|
8
|
+
js_file: scripts/tools.ts
|
|
9
|
+
language: typescript
|
|
10
|
+
base_path: .
|
|
11
|
+
semantic_analysis: file
|
|
12
|
+
include:
|
|
13
|
+
- '**/*.{ts,mts,cts}'
|
|
14
|
+
exclude:
|
|
15
|
+
- '**/node_modules/**'
|
|
16
|
+
- '**/dist/**'
|
|
17
|
+
- '**/build/**'
|
|
18
|
+
- name: Rewrite the tools modules in TSX and JavaScript files
|
|
19
|
+
js-ast-grep:
|
|
20
|
+
js_file: scripts/tools.ts
|
|
21
|
+
language: tsx
|
|
22
|
+
base_path: .
|
|
23
|
+
semantic_analysis: file
|
|
24
|
+
include:
|
|
25
|
+
- '**/*.{tsx,js,jsx,mjs,cjs}'
|
|
26
|
+
exclude:
|
|
27
|
+
- '**/node_modules/**'
|
|
28
|
+
- '**/dist/**'
|
|
29
|
+
- '**/build/**'
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Cornerstone3D 6.0 Viewport Members Migration
|
|
2
|
+
|
|
3
|
+
Rewrites the members of the legacy viewports that have a fixed 6.0 call, and
|
|
4
|
+
reports the others. Steps 4 to 8 and 10 of the
|
|
5
|
+
[upgrade](https://www.cornerstonejs.org/docs/migration-guides/6x/upgrade-step-by-step#step-4-the-look-of-the-data).
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx codemod @cornerstonejs/cornerstone3d-6-viewport-members
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Changes
|
|
14
|
+
|
|
15
|
+
Only on a viewport that the file shows to come from Cornerstone: a call of
|
|
16
|
+
`getViewport` on a rendering engine made with `new RenderingEngine` or got
|
|
17
|
+
with `getRenderingEngine`, the `viewport` of `getEnabledElement`, a cast or
|
|
18
|
+
annotation whose top type is a Cornerstone viewport type, or a `const` (or a
|
|
19
|
+
parameter that the file never writes) that holds one of these. A legacy
|
|
20
|
+
member on a name such as `viewport` alone, a `let` or a `var` is reported by
|
|
21
|
+
its name, and so is a legacy member in brackets
|
|
22
|
+
(`viewport['getProperties']()`). A `renderer.resetCamera()` of vtk.js stays.
|
|
23
|
+
|
|
24
|
+
- `resetCamera()` and `resetCamera({ resetPan, resetZoom, resetOrientation })`
|
|
25
|
+
become `resetViewState(...)`.
|
|
26
|
+
- `setProperties({ ... })` with one object of presentation keys becomes
|
|
27
|
+
`setDisplaySetPresentation({ ... })`, which sets the source display set;
|
|
28
|
+
`VOILUTFunction` becomes `voiLUTFunction`, also as a quoted key, which
|
|
29
|
+
keeps its quotes. `preset` and
|
|
30
|
+
`sampleDistanceMultiplier` count only on a viewport typed as a 3D viewport.
|
|
31
|
+
An ECG `setProperties` of view keys becomes `setViewState` (`layoutType`
|
|
32
|
+
becomes `traceLayout`).
|
|
33
|
+
- `resetCameraForResize()` becomes `resetViewStateForResize()`,
|
|
34
|
+
`getTargetImageIdIndex()` `getCurrentImageIdIndex()`.
|
|
35
|
+
- `getActorUIDs()`, `getAllVolumeIds()`, `getActorByIndex(i)` and
|
|
36
|
+
`getActorUIDByIndex(i)` become reads of `getActors()`; `getBounds()`
|
|
37
|
+
becomes `getImageData()?.imageData.getBounds?.()`, which passes
|
|
38
|
+
`strictNullChecks` and gives undefined while the viewport shows nothing.
|
|
39
|
+
- `isInAcquisitionPlane()`, `getSlicesClippingPlanes()`,
|
|
40
|
+
`getVtkDisplayCoords(point)` and `getCurrentSlicePixelData()` become
|
|
41
|
+
functions of the core `utilities`; `getCornerstoneImage()` becomes
|
|
42
|
+
`cache.getImage(viewport.getCurrentImageId())`; `isOrientationChangeable()`
|
|
43
|
+
the test of the map.
|
|
44
|
+
- Reads of `modality`, `isDisabled`, `uid`, `fps` and `numberOfFrames` become
|
|
45
|
+
`utilities.getViewportModality(viewport)`, `isDestroyed`, `id`,
|
|
46
|
+
`getFrameRate()` and `getNumberOfFrames()`.
|
|
47
|
+
- `setFrameRange(range)` and `setAverageWhite(value)` become `setViewState`
|
|
48
|
+
and `setDisplaySetPresentation`.
|
|
49
|
+
- `setDisplaySetPresentation` sets the display set that the viewport shows,
|
|
50
|
+
and does nothing before the first mount, where 5.x kept the properties.
|
|
51
|
+
So `setProperties` of presentation keys and `setAverageWhite` change only
|
|
52
|
+
on a viewport that is a name whose binding holds one value (a `const`, an
|
|
53
|
+
unwritten parameter), after a statement of the same function that awaits
|
|
54
|
+
a mount on that binding (`await viewport.setDisplaySets(...)`,
|
|
55
|
+
`await viewport.setStack(...)` and their kin), with no mount on it after
|
|
56
|
+
the call or before it without `await`. A mount under an `if` or in
|
|
57
|
+
another function proves nothing.
|
|
58
|
+
- On a viewport typed as a planar viewport: `setCamera({ flipHorizontal })`
|
|
59
|
+
becomes `setViewState(...)`.
|
|
60
|
+
|
|
61
|
+
## Reported
|
|
62
|
+
|
|
63
|
+
All manual, with the rule name: `setProperties` with a second argument, a
|
|
64
|
+
variable, a spread, or a key without a twin (`slabThickness`, `preset`,
|
|
65
|
+
`isComputedVOI` and the others), or before the viewport shows its data;
|
|
66
|
+
`setAverageWhite` before the viewport shows its data;
|
|
67
|
+
`resetCamera` with `resetToCenter` or `storeAsInitialCamera`; `getCamera`,
|
|
68
|
+
`setCamera` of other keys, `getProperties`, `resetProperties`, the default
|
|
69
|
+
properties, the view presentation, the actor members, `getSliceViewInfo`,
|
|
70
|
+
`getIntensityFromWorld`, `jumpToWorld`, `flip`, `setBlendMode`,
|
|
71
|
+
`setSlabThickness`, `togglePlayPause`, `setChannelVisibility`,
|
|
72
|
+
`getSliceIndexForImage` (5.x took a view reference too and gave `undefined`
|
|
73
|
+
for a missing image, where `getImageIds().indexOf(imageId)` gives -1), writes
|
|
74
|
+
of a
|
|
75
|
+
renamed property, the properties `requestedType`, `options`, `scaling` and
|
|
76
|
+
the others of the map, and the removed helpers of the core
|
|
77
|
+
(`viewportSupportsStackCompatibility`, `getImageLegacy`, `scrollVolume`,
|
|
78
|
+
`getVolumeViewportScrollInfo` and the others), also in an
|
|
79
|
+
`export { ... } from '@cornerstonejs/core'`, and
|
|
80
|
+
`renderFrameOfReference` on a rendering engine (also in brackets): call
|
|
81
|
+
`renderViewports` with the ids of the viewports of that frame of reference.
|
|
82
|
+
|
|
83
|
+
## Review
|
|
84
|
+
|
|
85
|
+
The rewrite of `getAllVolumeIds()` is listed for review: `getActors()` also
|
|
86
|
+
lists the actors of labelmaps, surfaces and the images of a stack, whose
|
|
87
|
+
`referencedId` is not a volume id or is undefined. Keep the ids that
|
|
88
|
+
`viewport.hasVolumeId(id)` takes where only the volumes count.
|
|
89
|
+
|
|
90
|
+
## Development
|
|
91
|
+
|
|
92
|
+
From `packages/codemods`:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
yarn test
|
|
96
|
+
npx codemod workflow validate -w registry/cornerstone3d/6/viewport-members
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The fixtures of `.ts` files are in `tests/typescript` (parsed as TypeScript),
|
|
100
|
+
the others in `tests/tsx`. Each `metrics.json` holds the sites that a fixture
|
|
101
|
+
reports.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
schema_version: '1.0'
|
|
2
|
+
name: '@cornerstonejs/cornerstone3d-6-viewport-members'
|
|
3
|
+
version: '0.1.0'
|
|
4
|
+
description: 'Rewrite the legacy Cornerstone3D viewport members that have a fixed 6.0 call, and report the others.'
|
|
5
|
+
author: 'Cornerstone.js Contributors'
|
|
6
|
+
license: 'MIT'
|
|
7
|
+
workflow: 'workflow.yaml'
|
|
8
|
+
repository: 'https://github.com/cornerstonejs/cornerstone3D'
|
|
9
|
+
category: 'migration'
|
|
10
|
+
targets:
|
|
11
|
+
languages: ['typescript', 'tsx', 'javascript', 'jsx']
|
|
12
|
+
keywords:
|
|
13
|
+
- cornerstone3d
|
|
14
|
+
- migration
|
|
15
|
+
- upgrade
|
|
16
|
+
- v6
|
|
17
|
+
- viewport-members
|
|
18
|
+
registry:
|
|
19
|
+
access: 'public'
|
|
20
|
+
visibility: 'public'
|