Describe the Bug
Drawing annotations where every annotation has a textbox label except for one. Then, that one annotation without label has a dashed line leading to empty textbox. Which looks really weird.
This is also a problem if we want to hide annotation labels for all the other annotations except one. (This is a business use case we are trying to solve).
Steps to Reproduce
- Add multiple Line annotations using the length tool.
- do not add label for textbox for some of the annotations.
The current behavior
LengthTool draws textbox links to annotations which does not have a label. Which draws a dashed line to an empty space.
The expected behavior
The annotation without the label should not have a textbox link or empty textbox.
It should exit the function early just like all the other annotation tools.
Some examples
https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/tools/src/tools/annotation/PlanarFreehandROITool.ts#L1091
https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/tools/src/tools/annotation/SplineROITool.ts#L1060
System Information
System:
OS: MacOS Tahoe 26.2
CPU: Apple M3 Pro
Memory: 18 GB
Binaries:
Node: 25.9.0
Yarn: 1.22.22
npm: 11.12.2
Browsers:
Chrome: 147.0.7727.138
Describe the Bug
Drawing annotations where every annotation has a textbox label except for one. Then, that one annotation without label has a dashed line leading to empty textbox. Which looks really weird.
This is also a problem if we want to hide annotation labels for all the other annotations except one. (This is a business use case we are trying to solve).
Steps to Reproduce
The current behavior
LengthTooldraws textbox links to annotations which does not have a label. Which draws a dashed line to an empty space.The expected behavior
The annotation without the label should not have a textbox link or empty textbox.
It should exit the function early just like all the other annotation tools.
Some examples
https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/tools/src/tools/annotation/PlanarFreehandROITool.ts#L1091
https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/tools/src/tools/annotation/SplineROITool.ts#L1060
System Information
System:
OS: MacOS Tahoe 26.2
CPU: Apple M3 Pro
Memory: 18 GB
Binaries:
Node: 25.9.0
Yarn: 1.22.22
npm: 11.12.2
Browsers:
Chrome: 147.0.7727.138