@cornerstonejs/tools 1.14.4 → 1.15.1
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/dist/cjs/stateManagement/annotation/config/ToolStyle.js +1 -0
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/cjs/tools/annotation/AngleTool.js +15 -1
- package/dist/cjs/tools/annotation/AngleTool.js.map +1 -1
- package/dist/cjs/tools/annotation/ArrowAnnotateTool.js +15 -1
- package/dist/cjs/tools/annotation/ArrowAnnotateTool.js.map +1 -1
- package/dist/cjs/tools/annotation/BidirectionalTool.js +15 -1
- package/dist/cjs/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/cjs/tools/annotation/CircleROITool.js +15 -1
- package/dist/cjs/tools/annotation/CircleROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/CobbAngleTool.js +15 -1
- package/dist/cjs/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/cjs/tools/annotation/EllipticalROITool.js +15 -1
- package/dist/cjs/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/LengthTool.js +15 -1
- package/dist/cjs/tools/annotation/LengthTool.js.map +1 -1
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +10 -6
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/ProbeTool.js +5 -1
- package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/cjs/tools/annotation/RectangleROITool.js +15 -1
- package/dist/cjs/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/cjs/tools/base/AnnotationTool.js +1 -0
- package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
- package/dist/cjs/types/CINETypes.d.ts +2 -0
- package/dist/cjs/utilities/cine/playClip.js +11 -2
- package/dist/cjs/utilities/cine/playClip.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js +1 -0
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/esm/tools/annotation/AngleTool.js +15 -1
- package/dist/esm/tools/annotation/AngleTool.js.map +1 -1
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js +15 -1
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js.map +1 -1
- package/dist/esm/tools/annotation/BidirectionalTool.js +15 -1
- package/dist/esm/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/esm/tools/annotation/CircleROITool.js +15 -1
- package/dist/esm/tools/annotation/CircleROITool.js.map +1 -1
- package/dist/esm/tools/annotation/CobbAngleTool.js +15 -1
- package/dist/esm/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/esm/tools/annotation/EllipticalROITool.js +15 -1
- package/dist/esm/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/esm/tools/annotation/LengthTool.js +15 -1
- package/dist/esm/tools/annotation/LengthTool.js.map +1 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +10 -6
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/esm/tools/annotation/ProbeTool.js +5 -1
- package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/esm/tools/annotation/RectangleROITool.js +15 -1
- package/dist/esm/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/esm/tools/base/AnnotationTool.js +1 -0
- package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
- package/dist/esm/types/CINETypes.d.ts +2 -0
- package/dist/esm/utilities/cine/playClip.js +11 -3
- package/dist/esm/utilities/cine/playClip.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/stateManagement/annotation/config/ToolStyle.ts +1 -0
- package/src/tools/annotation/AngleTool.ts +16 -1
- package/src/tools/annotation/ArrowAnnotateTool.ts +16 -1
- package/src/tools/annotation/BidirectionalTool.ts +17 -2
- package/src/tools/annotation/CircleROITool.ts +16 -1
- package/src/tools/annotation/CobbAngleTool.ts +16 -1
- package/src/tools/annotation/EllipticalROITool.ts +16 -1
- package/src/tools/annotation/LengthTool.ts +16 -1
- package/src/tools/annotation/PlanarFreehandROITool.ts +12 -7
- package/src/tools/annotation/ProbeTool.ts +6 -1
- package/src/tools/annotation/RectangleROITool.ts +16 -1
- package/src/tools/base/AnnotationTool.ts +5 -0
- package/src/types/CINETypes.ts +8 -2
- package/src/utilities/cine/playClip.ts +17 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cornerstonejs/core": "^1.
|
|
32
|
+
"@cornerstonejs/core": "^1.15.1",
|
|
33
33
|
"lodash.clonedeep": "4.5.0",
|
|
34
34
|
"lodash.get": "^4.4.2"
|
|
35
35
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"type": "individual",
|
|
53
53
|
"url": "https://ohif.org/donate"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "39fc0a489df073eeee5c1c735f78a70f57258a4d"
|
|
56
56
|
}
|
|
@@ -745,6 +745,21 @@ class AngleTool extends AnnotationTool {
|
|
|
745
745
|
continue;
|
|
746
746
|
}
|
|
747
747
|
|
|
748
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
749
|
+
if (!options.visibility) {
|
|
750
|
+
data.handles.textBox = {
|
|
751
|
+
hasMoved: false,
|
|
752
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
753
|
+
worldBoundingBox: {
|
|
754
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
755
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
756
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
757
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
758
|
+
},
|
|
759
|
+
};
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
|
|
748
763
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
749
764
|
|
|
750
765
|
if (!data.handles.textBox.hasMoved) {
|
|
@@ -768,7 +783,7 @@ class AngleTool extends AnnotationTool {
|
|
|
768
783
|
textBoxPosition,
|
|
769
784
|
canvasCoordinates,
|
|
770
785
|
{},
|
|
771
|
-
|
|
786
|
+
options
|
|
772
787
|
);
|
|
773
788
|
|
|
774
789
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -776,6 +776,21 @@ class ArrowAnnotateTool extends AnnotationTool {
|
|
|
776
776
|
continue;
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
780
|
+
if (!options.visibility) {
|
|
781
|
+
data.handles.textBox = {
|
|
782
|
+
hasMoved: false,
|
|
783
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
784
|
+
worldBoundingBox: {
|
|
785
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
786
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
787
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
788
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
789
|
+
},
|
|
790
|
+
};
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
|
|
779
794
|
// Need to update to sync w/ annotation while unlinked/not moved
|
|
780
795
|
if (!data.handles.textBox.hasMoved) {
|
|
781
796
|
// linked to the point that doesn't have the arrowhead by default
|
|
@@ -798,7 +813,7 @@ class ArrowAnnotateTool extends AnnotationTool {
|
|
|
798
813
|
textBoxPosition,
|
|
799
814
|
canvasCoordinates,
|
|
800
815
|
{},
|
|
801
|
-
|
|
816
|
+
options
|
|
802
817
|
);
|
|
803
818
|
|
|
804
819
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -1162,11 +1162,26 @@ class BidirectionalTool extends AnnotationTool {
|
|
|
1162
1162
|
|
|
1163
1163
|
renderStatus = true;
|
|
1164
1164
|
|
|
1165
|
-
const
|
|
1165
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
1166
|
+
if (!options.visibility) {
|
|
1167
|
+
data.handles.textBox = {
|
|
1168
|
+
hasMoved: false,
|
|
1169
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
1170
|
+
worldBoundingBox: {
|
|
1171
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
1172
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
1173
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
1174
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
1175
|
+
},
|
|
1176
|
+
};
|
|
1177
|
+
continue;
|
|
1178
|
+
}
|
|
1166
1179
|
|
|
1180
|
+
const textLines = this.configuration.getTextLines(data, targetId);
|
|
1167
1181
|
if (!textLines || textLines.length === 0) {
|
|
1168
1182
|
continue;
|
|
1169
1183
|
}
|
|
1184
|
+
|
|
1170
1185
|
let canvasTextBoxCoords;
|
|
1171
1186
|
|
|
1172
1187
|
if (!data.handles.textBox.hasMoved) {
|
|
@@ -1189,7 +1204,7 @@ class BidirectionalTool extends AnnotationTool {
|
|
|
1189
1204
|
textBoxPosition,
|
|
1190
1205
|
canvasCoordinates,
|
|
1191
1206
|
{},
|
|
1192
|
-
|
|
1207
|
+
options
|
|
1193
1208
|
);
|
|
1194
1209
|
|
|
1195
1210
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -826,6 +826,21 @@ class CircleROITool extends AnnotationTool {
|
|
|
826
826
|
|
|
827
827
|
renderStatus = true;
|
|
828
828
|
|
|
829
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
830
|
+
if (!options.visibility) {
|
|
831
|
+
data.handles.textBox = {
|
|
832
|
+
hasMoved: false,
|
|
833
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
834
|
+
worldBoundingBox: {
|
|
835
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
836
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
837
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
838
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
839
|
+
},
|
|
840
|
+
};
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
|
|
829
844
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
830
845
|
if (!textLines || textLines.length === 0) {
|
|
831
846
|
continue;
|
|
@@ -854,7 +869,7 @@ class CircleROITool extends AnnotationTool {
|
|
|
854
869
|
textBoxPosition,
|
|
855
870
|
canvasCoordinates,
|
|
856
871
|
{},
|
|
857
|
-
|
|
872
|
+
options
|
|
858
873
|
);
|
|
859
874
|
|
|
860
875
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -770,6 +770,21 @@ class CobbAngleTool extends AnnotationTool {
|
|
|
770
770
|
continue;
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
774
|
+
if (!options.visibility) {
|
|
775
|
+
data.handles.textBox = {
|
|
776
|
+
hasMoved: false,
|
|
777
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
778
|
+
worldBoundingBox: {
|
|
779
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
780
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
781
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
782
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
783
|
+
},
|
|
784
|
+
};
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
|
|
773
788
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
774
789
|
|
|
775
790
|
if (!data.handles.textBox.hasMoved) {
|
|
@@ -792,7 +807,7 @@ class CobbAngleTool extends AnnotationTool {
|
|
|
792
807
|
textBoxPosition,
|
|
793
808
|
canvasCoordinates,
|
|
794
809
|
{},
|
|
795
|
-
|
|
810
|
+
options
|
|
796
811
|
);
|
|
797
812
|
|
|
798
813
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -950,6 +950,21 @@ class EllipticalROITool extends AnnotationTool {
|
|
|
950
950
|
|
|
951
951
|
renderStatus = true;
|
|
952
952
|
|
|
953
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
954
|
+
if (!options.visibility) {
|
|
955
|
+
data.handles.textBox = {
|
|
956
|
+
hasMoved: false,
|
|
957
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
958
|
+
worldBoundingBox: {
|
|
959
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
960
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
961
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
962
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
963
|
+
},
|
|
964
|
+
};
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
|
|
953
968
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
954
969
|
if (!textLines || textLines.length === 0) {
|
|
955
970
|
continue;
|
|
@@ -978,7 +993,7 @@ class EllipticalROITool extends AnnotationTool {
|
|
|
978
993
|
textBoxPosition,
|
|
979
994
|
canvasCoordinates,
|
|
980
995
|
{},
|
|
981
|
-
|
|
996
|
+
options
|
|
982
997
|
);
|
|
983
998
|
|
|
984
999
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -732,6 +732,21 @@ class LengthTool extends AnnotationTool {
|
|
|
732
732
|
return renderStatus;
|
|
733
733
|
}
|
|
734
734
|
|
|
735
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
736
|
+
if (!options.visibility) {
|
|
737
|
+
data.handles.textBox = {
|
|
738
|
+
hasMoved: false,
|
|
739
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
740
|
+
worldBoundingBox: {
|
|
741
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
742
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
743
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
744
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
745
|
+
},
|
|
746
|
+
};
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
|
|
735
750
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
736
751
|
|
|
737
752
|
// Need to update to sync with annotation while unlinked/not moved
|
|
@@ -755,7 +770,7 @@ class LengthTool extends AnnotationTool {
|
|
|
755
770
|
textBoxPosition,
|
|
756
771
|
canvasCoordinates,
|
|
757
772
|
{},
|
|
758
|
-
|
|
773
|
+
options
|
|
759
774
|
);
|
|
760
775
|
|
|
761
776
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -882,6 +882,17 @@ class PlanarFreehandROITool extends AnnotationTool {
|
|
|
882
882
|
const data = annotation.data;
|
|
883
883
|
const targetId = this.getTargetId(viewport);
|
|
884
884
|
|
|
885
|
+
const styleSpecifier: AnnotationStyle.StyleSpecifier = {
|
|
886
|
+
toolGroupId: this.toolGroupId,
|
|
887
|
+
toolName: this.getToolName(),
|
|
888
|
+
viewportId: enabledElement.viewport.id,
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
892
|
+
if (!options.visibility) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
|
|
885
896
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
886
897
|
if (!textLines || textLines.length === 0) {
|
|
887
898
|
return;
|
|
@@ -901,12 +912,6 @@ class PlanarFreehandROITool extends AnnotationTool {
|
|
|
901
912
|
data.handles.textBox.worldPosition
|
|
902
913
|
);
|
|
903
914
|
|
|
904
|
-
const styleSpecifier: AnnotationStyle.StyleSpecifier = {
|
|
905
|
-
toolGroupId: this.toolGroupId,
|
|
906
|
-
toolName: this.getToolName(),
|
|
907
|
-
viewportId: enabledElement.viewport.id,
|
|
908
|
-
};
|
|
909
|
-
|
|
910
915
|
const textBoxUID = '1';
|
|
911
916
|
const boundingBox = drawLinkedTextBox(
|
|
912
917
|
svgDrawingHelper,
|
|
@@ -916,7 +921,7 @@ class PlanarFreehandROITool extends AnnotationTool {
|
|
|
916
921
|
textBoxPosition,
|
|
917
922
|
canvasCoordinates,
|
|
918
923
|
{},
|
|
919
|
-
|
|
924
|
+
options
|
|
920
925
|
);
|
|
921
926
|
|
|
922
927
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -527,6 +527,11 @@ class ProbeTool extends AnnotationTool {
|
|
|
527
527
|
|
|
528
528
|
renderStatus = true;
|
|
529
529
|
|
|
530
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
531
|
+
if (!options.visibility) {
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
|
|
530
535
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
531
536
|
if (textLines) {
|
|
532
537
|
const textCanvasCoordinates = [
|
|
@@ -541,7 +546,7 @@ class ProbeTool extends AnnotationTool {
|
|
|
541
546
|
textUID,
|
|
542
547
|
textLines,
|
|
543
548
|
[textCanvasCoordinates[0], textCanvasCoordinates[1]],
|
|
544
|
-
|
|
549
|
+
options
|
|
545
550
|
);
|
|
546
551
|
}
|
|
547
552
|
}
|
|
@@ -791,6 +791,21 @@ class RectangleROITool extends AnnotationTool {
|
|
|
791
791
|
|
|
792
792
|
renderStatus = true;
|
|
793
793
|
|
|
794
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
795
|
+
if (!options.visibility) {
|
|
796
|
+
data.handles.textBox = {
|
|
797
|
+
hasMoved: false,
|
|
798
|
+
worldPosition: <Types.Point3>[0, 0, 0],
|
|
799
|
+
worldBoundingBox: {
|
|
800
|
+
topLeft: <Types.Point3>[0, 0, 0],
|
|
801
|
+
topRight: <Types.Point3>[0, 0, 0],
|
|
802
|
+
bottomLeft: <Types.Point3>[0, 0, 0],
|
|
803
|
+
bottomRight: <Types.Point3>[0, 0, 0],
|
|
804
|
+
},
|
|
805
|
+
};
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
|
|
794
809
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
795
810
|
if (!textLines || textLines.length === 0) {
|
|
796
811
|
continue;
|
|
@@ -816,7 +831,7 @@ class RectangleROITool extends AnnotationTool {
|
|
|
816
831
|
textBoxPosition,
|
|
817
832
|
canvasCoordinates,
|
|
818
833
|
{},
|
|
819
|
-
|
|
834
|
+
options
|
|
820
835
|
);
|
|
821
836
|
|
|
822
837
|
const { x: left, y: top, width, height } = boundingBox;
|
|
@@ -257,6 +257,11 @@ abstract class AnnotationTool extends AnnotationDisplayTool {
|
|
|
257
257
|
// for the textBox.
|
|
258
258
|
|
|
259
259
|
return {
|
|
260
|
+
visibility: this.getStyle(
|
|
261
|
+
'textBoxVisibility',
|
|
262
|
+
specifications,
|
|
263
|
+
annotation
|
|
264
|
+
),
|
|
260
265
|
fontFamily: this.getStyle(
|
|
261
266
|
'textBoxFontFamily',
|
|
262
267
|
specifications,
|
package/src/types/CINETypes.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
|
|
3
1
|
type PlayClipOptions = {
|
|
4
2
|
framesPerSecond?: number;
|
|
5
3
|
frameTimeVector?: number[];
|
|
@@ -7,6 +5,11 @@ type PlayClipOptions = {
|
|
|
7
5
|
loop?: boolean;
|
|
8
6
|
dynamicCineEnabled?: boolean;
|
|
9
7
|
frameTimeVectorSpeedMultiplier?: number;
|
|
8
|
+
// How many CINE frames to wait for a rendered event to occur before
|
|
9
|
+
// trying to display the image after the next one
|
|
10
|
+
// A CINE frame is attempted every 1 / fps seconds
|
|
11
|
+
// The default is 30 tries, or 1.25 seconds at 24 fps
|
|
12
|
+
waitForRendered?: number;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
interface ToolData {
|
|
@@ -26,6 +29,9 @@ type CinePlayContext = {
|
|
|
26
29
|
get numScrollSteps(): number;
|
|
27
30
|
get currentStepIndex(): number;
|
|
28
31
|
get frameTimeVectorEnabled(): boolean;
|
|
32
|
+
// How many times has the wait for rendered been tried without showing
|
|
33
|
+
// the next image.
|
|
34
|
+
waitForRenderedCount?: number;
|
|
29
35
|
scroll(delta: number): void;
|
|
30
36
|
};
|
|
31
37
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
VolumeViewport,
|
|
7
7
|
cache,
|
|
8
8
|
BaseVolumeViewport,
|
|
9
|
+
Enums,
|
|
9
10
|
} from '@cornerstonejs/core';
|
|
10
11
|
|
|
11
12
|
import { Types } from '@cornerstonejs/core';
|
|
@@ -14,6 +15,7 @@ import { addToolState, getToolState } from './state';
|
|
|
14
15
|
import { CINETypes } from '../../types';
|
|
15
16
|
import scroll from '../scroll';
|
|
16
17
|
|
|
18
|
+
const { ViewportStatus } = Enums;
|
|
17
19
|
const { triggerEvent } = csUtils;
|
|
18
20
|
|
|
19
21
|
const debounced = true;
|
|
@@ -315,7 +317,8 @@ function _getVolumeFromViewport(viewport): Types.IImageVolume {
|
|
|
315
317
|
}
|
|
316
318
|
|
|
317
319
|
function _createStackViewportCinePlayContext(
|
|
318
|
-
viewport: StackViewport
|
|
320
|
+
viewport: StackViewport,
|
|
321
|
+
waitForRendered: number
|
|
319
322
|
): CINETypes.CinePlayContext {
|
|
320
323
|
const imageIds = viewport.getImageIds();
|
|
321
324
|
|
|
@@ -330,7 +333,16 @@ function _createStackViewportCinePlayContext(
|
|
|
330
333
|
// It is always in acquired orientation
|
|
331
334
|
return true;
|
|
332
335
|
},
|
|
336
|
+
waitForRenderedCount: 0,
|
|
333
337
|
scroll(delta: number): void {
|
|
338
|
+
if (
|
|
339
|
+
this.waitForRenderedCount <= waitForRendered &&
|
|
340
|
+
viewport.viewportStatus !== ViewportStatus.RENDERED
|
|
341
|
+
) {
|
|
342
|
+
this.waitForRenderedCount++;
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this.waitForRenderedCount = 0;
|
|
334
346
|
scroll(viewport, { delta, debounceLoading: debounced });
|
|
335
347
|
},
|
|
336
348
|
};
|
|
@@ -419,7 +431,10 @@ function _createCinePlayContext(
|
|
|
419
431
|
playClipOptions: CINETypes.PlayClipOptions
|
|
420
432
|
): CINETypes.CinePlayContext {
|
|
421
433
|
if (viewport instanceof StackViewport) {
|
|
422
|
-
return _createStackViewportCinePlayContext(
|
|
434
|
+
return _createStackViewportCinePlayContext(
|
|
435
|
+
viewport,
|
|
436
|
+
playClipOptions.waitForRendered ?? 30
|
|
437
|
+
);
|
|
423
438
|
}
|
|
424
439
|
|
|
425
440
|
if (viewport instanceof VolumeViewport) {
|