# ResliceCursorWidget adds AngleWidget or DistanceWidget does not display sphere

**URL:** https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680
**Category:** Web
**Created:** [June 8, 2022, 9:36am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680 "2022-06-08T09:36:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 8, 2022, 9:36am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/1 "2022-06-08T09:36:04Z")

</div>

When adding AngleWidget or DistanceWidget to ResliceCursorWidget, only the line is displayed and the sphere is not displayed. And dragging will report an error.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d7da37daf112821751931fdb28fba78e31807c50.png)

Official example：

 ![image](https://discourse.vtk.org/uploads/default/original/2X/b/b9284fedfa813d567afb76fe9c4237a16b5cc356.png)

Error when dragging DistanceWidget：

 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8625f367949aa0709a7a69f0f7831b627d597c61.png)

---

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mau_igna_06/32/8064_2.png) [@mau\_igna\_06](https://discourse.vtk.org/u/mau_igna_06)
#### Post date: [June 8, 2022, 12:14pm UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/2 "2022-06-08T12:14:38Z")

</div>

Have younchecked all thw functionnnames are right?

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 9, 2022, 2:15am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/3 "2022-06-09T02:15:26Z")

</div>

of course correct  
Also, are there any other community colleagues who can answer questions? None of your answers solved the problem.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 10, 2022, 12:55am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/4 "2022-06-10T00:55:51Z")

</div>

Is anyone paying attention to this issue?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 10, 2022, 1:54am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/5 "2022-06-10T01:54:24Z")

</div>

You need to enable glyph in the rendering profiles.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 10, 2022, 2:16am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/7 "2022-06-10T02:16:21Z")

</div>

Hello, thanks for your answer, At first I import Profiles/All, I thought this contained all the required files, I looked at the source code and there was no Glyph in it.  
but after I try to import glyph, DistanceWidget still doesn’t show the sphere.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f3e697831a010a762f6ec3802d08cc318fc41f02.png)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/60d1d618eadcc63ec7ac061e980b2ced013131d5.png)

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 10, 2022, 2:54am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/8 "2022-06-10T02:54:46Z")

</div>

The same problem occurs when I add DistanceWidget to ResliceCursorWidget official sample code.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/a63e06326df7ae1f1460df8cba58938f660e9670.png)

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [June 10, 2022, 7:30am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/9 "2022-06-10T07:30:41Z")

</div>

The handles are actually being rendered, they are just tiny.

This default behavior should be fixed with [fix(scaleinpixels): uniformize scaleInPixels between widgets by tomsuchel · Pull Request #2465 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/pull/2465)

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 10, 2022, 7:54am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/10 "2022-06-10T07:54:48Z")

</div>

Thank you very much for your answer, it needs a new version to be released, right? In addition, why do I get an error when dragging and can’t find the setOrigin method?

---

<div class="post-metadata">

### Author: ![Tom\_Suchel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tom_suchel/32/5318_2.png) [@Tom\_Suchel](https://discourse.vtk.org/u/Tom_Suchel)
#### Post date: [June 10, 2022, 10:07am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/11 "2022-06-10T10:07:18Z")

</div>

Hello,

AngleWidget, DistanceWidget and PolyLineWidget lines are not designed to be movable, which is why you see the error `model.activeState.setOrigin is not a function` when you try to move them.  
This problem will be fixed in this PR: [fix(dragging): uniformize dragging behavior between widgets by tomsuchel · Pull Request #2466 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/pull/2466)

However, if you want to be able to move your widget by dragging the line, I suggest you look at the LineWidget, which supports this feature and have a `getDistance()` function.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 15, 2022, 7:30am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/12 "2022-06-15T07:30:50Z")

</div>

Hello, when using angleWidget, I found that there is a slice, and the angle of the drawing will be blocked. How to set the angle to display on the slice?

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/44202c82966b9a66d8467bd5ded0b4c69aa0c085.png)

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [June 15, 2022, 7:49am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/13 "2022-06-15T07:49:53Z")

</div>

It looks like the 2nd point (center of the angle) is not exactly onto the slice plane. Can you double check it ?

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 15, 2022, 7:53am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/14 "2022-06-15T07:53:58Z")

</div>

Yes, I checked, not only angleWidget, the distanceWidget also has a slice that will also be occluded.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/42c2a8b8dfb5606422a2f4037e813027e4e76f68.jpeg)

If I rotate to the proper position, I will find that the line is on the back of the slice

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/063fd3e610e0c7b5840f358e37b3e9184db95b56.jpeg)

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 15, 2022, 8:42am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/15 "2022-06-15T08:42:31Z")

</div>

Thanks a lot for your answer, I’ll try the LineWidget.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 16, 2022, 7:43am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/16 "2022-06-16T07:43:54Z")

</div>

Hi, is anyone concerned about this issue?

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [June 16, 2022, 7:56am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/17 "2022-06-16T07:56:09Z")

</div>

We are concerned about your issue, it’s just that we can’t help you much more than that with the current information.

Could you share a code that reproduces the bug ? via a branch on vtk.js or on codesandbox for example.

Regards, Julien.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 16, 2022, 8:42am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/18 "2022-06-16T08:42:27Z")

</div>

Hello, I have added demo to this branch, [https://github.com/zhangzhi93/vtk-js/tree/ResliceCursorWidget-add-angleWidget](https://github.com/zhangzhi93/vtk-js/tree/ResliceCursorWidget-add-angleWidget), you can check it out by running npm run example – ResliceCursorWidget.

In this example, the angle drawn in the first slice are on the back

 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/616d2e580326bfa81f38af9438fef45018745e43.png)

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [June 16, 2022, 7:57pm UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/19 "2022-06-16T19:57:19Z")

</div>

Thanks for sharing your code.  
if you want the widget to be placed on the current slice, you need to configure the [plane manipulator](https://kitware.github.io/vtk-js/docs/concepts_widgets.html#Widget-manipulators) on the widget.

Hth,  
Julien.

---

<div class="post-metadata">

### Author: ![zhangzhi93](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhangzhi93/32/4954_2.png) [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)
#### Post date: [June 17, 2022, 12:57am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/20 "2022-06-17T00:57:51Z")

</div>

Thank you for your reply.  
do you mean [PlaneManipulator | vtk.js](https://kitware.github.io/vtk-js/api/Widgets_Manipulators_PlaneManipulator.html) by plane manipulator?  
Sorry, because there is no official example for the plane manipulator, I don’t know how to use it with ResliceCursorWidget and angleWidget. can you give some advice.thanks very much.

---

<div class="post-metadata">

### Author: ![lanranlaura](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lanranlaura/32/3748_2.png) [@lanranlaura](https://discourse.vtk.org/u/lanranlaura)
#### Post date: [June 17, 2022, 1:56am UTC](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680/21 "2022-06-17T01:56:34Z")

</div>

Here’s how I do it: first, make sure this sentence is in the LineWidgetJS,  
 ![0A7I933TH)_QGGQ6{N7LI4U](https://discourse.vtk.org/uploads/default/original/2X/5/5c06fcee6c1da70bcf5326bfd06d0355288ae066.png)

and then add it to the code that launches the LineWidget

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f6420dec155c6cbc4ff7328abe4db89cb9f042a8.png)  
And I used this to work in linewidget but not in anglewidget. I haven’t figured out why it didn’t work. In addition, it is difficult to change the Handle style of these measuring tools.

[Next page](https://discourse.vtk.org/t/reslicecursorwidget-adds-anglewidget-or-distancewidget-does-not-display-sphere/8680.md?page=2)
