# Sound feedback navigation

**URL:** <https://discourse.slicer.org/t/sound-feedback-navigation/690>\
**Category:** Development\
**Tags:** surgical-navigation\
**Created:** [July 14, 2017, 2:02pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690 "2017-07-14T14:02:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robmbar](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@robmbar](https://discourse.slicer.org/u/robmbar)\
**Post date:** [July 14, 2017, 2:02pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690/1 "2017-07-14T14:02:29Z")

</div>

I’m developing a navigation module and I want to implement some sound feedback during the navigation. I found this video regarding LumpNav module and this is what I intend to implement:

I tried to look for the python code of this implementation but, in python script of LumpNav and SlicerSoundControl modules, I couldn’t find the python code regarding this sound feedback implementation. Can someone provide the python code to implement this sound feedback?

Thank you!

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [July 14, 2017, 5:10pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690/2 "2017-07-14T17:10:16Z")

</div>

The simplest option is to use the existing BreachWarningNode infrastructure. See initialization here:

> <https://github.com/SlicerIGT/LumpNav/blob/master/LumpNav/LumpNav.py#L417-L421>

C++ code here:

> <https://github.com/SlicerIGT/SlicerIGT/blob/master/BreachWarning/MRML/vtkMRMLBreachWarningNode.cxx>

The actual sound is in Qt, a QSound played when the observed vtkMRMLBreachWarningNode `WarningSoundPlaying` property is true:

> <https://github.com/SlicerIGT/SlicerIGT/blob/master/BreachWarning/qSlicerBreachWarningModule.cxx#L164-L188>

Hope that helps.

---

<div class="post-metadata">

**Author:** ![robmbar](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@robmbar](https://discourse.slicer.org/u/robmbar)\
**Post date:** [July 14, 2017, 7:48pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690/3 "2017-07-14T19:48:54Z")

</div>

Thank you for your answer! I am developing my module in Python. I have already looked to BreachWarning module but it only plays the beep sound when the tip touches the model. I am looking for an approach like is shown in video that adjusts the frequency of beep sound according to the distance to the model.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 14, 2017, 8:07pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690/4 "2017-07-14T20:07:27Z")

</div>

To create the demo, I’ve added a few lines of Python code to LumpNav to create a transform based on the distance computed by a BreachWarning node.  
I’ll add that code to the SoundNav module in a few days - you can [track its status here](https://github.com/SlicerIGT/SlicerSoundControl/issues/1).

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 14, 2017, 8:11pm UTC](https://discourse.slicer.org/t/sound-feedback-navigation/690/5 "2017-07-14T20:11:09Z")

</div>

You may also want to look at the research described here:

[https://na-mic.org/wiki/Project\_Week\_25/Improving\_Depth\_Perception\_in\_Interventional\_Augmented\_Reality\_Visualization/Sonification](https://na-mic.org/wiki/Project_Week_25/Improving_Depth_Perception_in_Interventional_Augmented_Reality_Visualization/Sonification)
