# VisSim Cochlea Tools extension is now public

**URL:** <https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122>\
**Category:** Support\
**Created:** [September 15, 2018, 2:16pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122 "2018-09-15T14:16:34Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [September 15, 2018, 2:16pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/1 "2018-09-15T14:16:34Z")

</div>

I added video tutorials on how to [register and fuse](https://www.youtube.com/watch?v=oRQ767ojS9o&t=159s) and [segment](https://www.youtube.com/watch?v=A_mTcT3eT_c&t=31s) cochlea multi-modal images using our [VisSim Tools extension](https://github.com/MedicalImageAnalysisTutorials/SlicerCochlea) that uses [elastix toolbox](https://github.com/SuperElastix/elastix) as well. The source code can be found [here](https://github.com/MedicalImageAnalysisTutorials/SlicerCochlea).  
Sample cochlea datasets are also shared and can be downloaded using “Data Store”  
module.

This is still a beta version and more enhancement will be added to both source code and videos.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [September 20, 2018, 5:54pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/2 "2018-09-20T17:54:00Z")

</div>

The [SlicerCochlea](https://github.com/Slicer/ExtensionsIndex/blob/master/SlicerCochlea.s4ext) extension is already merged few days ago but it does not appear in the extension manager. Is there something wrong?

---

<div class="post-metadata">

**Author:** ![torquil](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@torquil](https://discourse.slicer.org/u/torquil)\
**Post date:** [October 24, 2018, 1:53pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/3 "2018-10-24T13:53:44Z")

</div>

It does appear in the extension manager for me with the current nightly build on Linux (4.11.0-2018-10-23 r27518), but it doesn’t seem to work. I’m getting the following error messsage in the terminal window where I start Slicer:

```auto
$ slicer
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/torquil/.config/NA-MIC/Extensions-27518/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaReg.py", line 24, in <module>
    import Tkinter, tkFileDialog
ImportError: No module named Tkinter
loadSourceAsModule - Failed to load file "/home/torquil/.config/NA-MIC/Extensions-27518/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaReg.py" as module "CochleaReg" !
Fail to instantiate module "CochleaReg"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/torquil/.config/NA-MIC/Extensions-27518/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaSeg.py", line 25, in <module>
    import Tkinter, tkFileDialog
ImportError: No module named Tkinter
loadSourceAsModule - Failed to load file "/home/torquil/.config/NA-MIC/Extensions-27518/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaSeg.py" as module "CochleaSeg" !
Fail to instantiate module "CochleaSeg"

```

When it works I will be happy to try it.

Best regards,  
Torquil Sørensen

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 24, 2018, 2:45pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/4 "2018-10-24T14:45:30Z")

</div>

Thanks for interesting in our work.

I tested it on Slicer 4.81. I will update it and test it on the recent versions 4.10 and 4.11 next week.

Not sure why Tkinter does not work, maybe Slicer 11 uses python 3? I just updated the code, hopefully, this problem is fixed in the next build.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 24, 2018, 3:15pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/5 "2018-10-24T15:15:17Z")

</div>

@brhoom Slicer is not using python 3 yet, but you might want to review the comment in this thread [Should we do something about EM segmenter?](https://discourse.slicer.org/t/should-we-do-something-about-em-segmenter/4382). TCL support was recently disabled in Slicer.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 24, 2018, 3:36pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/6 "2018-10-24T15:36:21Z")

</div>

Thanks for the info. I will remove Tkinter and tk from the code.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 25, 2018, 8:23am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/7 "2018-10-25T08:23:57Z")

</div>

The extension is updated and it should work with recent slicer version 4.10 and 4.11 when it builds next time.

I don’t know why the extension icon and screenshots do not appear, is there something I should do to fix it?

---

<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:** [October 25, 2018, 1:40pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/8 "2018-10-25T13:40:44Z")

</div>

Icon URLs in s4ext file are not used, they are for information purposes only. What matters is the URLs in the CMakeLists.txt file ([https://github.com/MedicalImageAnalysisTutorials/SlicerCochlea/blob/master/CMakeLists.txt](https://github.com/MedicalImageAnalysisTutorials/SlicerCochlea/blob/master/CMakeLists.txt)).

Also, URL seems incorrect. URL to raw data on github usually looks like this: [https://raw.githubusercontent.com/MedicalImageAnalysisTutorials/SlicerCochlea/master/SlicerCochlea.png](https://raw.githubusercontent.com/MedicalImageAnalysisTutorials/SlicerCochlea/master/SlicerCochlea.png)

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 28, 2018, 11:27am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/9 "2018-10-28T11:27:12Z")

</div>

Thanks, Andras, now it is clear. I updated the links with raw links in both s4ext and CMakeLists.txt.

---

<div class="post-metadata">

**Author:** ![torquil](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@torquil](https://discourse.slicer.org/u/torquil)\
**Post date:** [October 29, 2018, 10:01pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/10 "2018-10-29T22:01:21Z")

</div>

Ok, I installed the latest Slicer 3D nightly for Linux, and now I’m getting this error on the terminal after picking a point in the middle of the cochlea in a CT image, and then clicking on “Run”:

```auto
Switch to module: "CochleaSeg"
 
=======================================================
   Automatic Cochlea Image Segmentation               
=======================================================
   Default Settings: 
      VisSimTools folder: /home/torquil/VisSimTools
      Output folder : /home/torquil/VisSimTools/outputs
      Parameter file: /home/torquil/VisSimTools/pars/parCochSeg.txt
      Cropping Length: 10
elastix binaries are found in /home/torquil/VisSimTools/sw/elastix-4.9.0/bin/elastix
Other files are found !
Traceback (most recent call last):
  File "/home/torquil/.config/NA-MIC/Extensions-27526/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaSeg.py", line 746, in updateLengthBtnClick
    ptsRASNode = self.markupsNode
AttributeError: CochleaSegWidget instance has no attribute 'markupsNode'
 ..... getting cochlea location in the input image

 ..... cochlea location RAS: [38.186453904880466, 170.83668361478453, 225.1563957681987, 1.0]
 ..... cochlea location in the fixed image set to: [85, 301, 299]
removing old output folder!
Traceback (most recent call last):
  File "/home/torquil/.config/NA-MIC/Extensions-27526/SlicerCochlea/lib/Slicer-4.11/qt-scripted-modules/CochleaSeg.py", line 465, in runBtnClick
    self.inputPath = self.inputNode.GetStorageNode().GetFileName()
AttributeError: 'NoneType' object has no attribute 'GetFileName'

```

Within Slicer, the “Run”-button turned red and says “…please wait”, but nothing is happening and the timer is not counting.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [November 14, 2018, 6:27pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/11 "2018-11-14T18:27:55Z")

</div>

Thanks for testing.  
I could not reproduce the problem. Does the cochlea registration module work?

Please try these steps:

1. save your cochlea image in your home folder as nrrd format. Sometimes elastix does not recognize filenames with special characters or spaces, e.g. use this filename. /home/torquil/img.nrrd

2. delete the output contents

3. restart slicer

4. load your nrrd cochlea image

5. run the cochlea segmentation module

Let me know if this works.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [November 14, 2018, 7:59pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/12 "2018-11-14T19:59:18Z")

</div>

I just retest it again on a clean installation of Ubuntu 18.04. The only thing I needed to do is to install opencl:

```
sudo apt install ocl-icd-opencl-dev

```

please make sure you have this install before trying the above steps.

---

<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:** [November 15, 2018, 12:56am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/13 "2018-11-15T00:56:02Z")

</div>

Do you really need OpenCL? Could you include runtime libraries in the extension instead of asking the user to manually download and install development packages? Many users are not comfortable with installing additional software tools.

If there is no chance for a better solution then at least the extension should detect if some OpenCL component is missing and display a meaningful error message - with an explanation and download link.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [November 15, 2018, 9:02am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/14 "2018-11-15T09:02:09Z")

</div>

> Do you really need OpenCL? Could you include runtime libraries in the extension instead of asking the user to manually download and install development packages?

Thanks for your comment. You are right. I used my elastix binaries as a temporary solution as I am planning to use [SlicerElastix](https://github.com/lassoan/SlicerElastix/issues/8) instead.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [December 6, 2018, 5:46pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/15 "2018-12-06T17:46:07Z")

</div>

**Update:**

- Runtime libraries are included now in the elastix binaries.
- Logic classes are added so some useful function can be called from external Slicer modules.
- Tests classes are added so the user can run them using Slicer Developer Mode and the button “Reload and Test”.
- Minor bugs are fixed.

---

<div class="post-metadata">

**Author:** ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)\
**Post date:** [June 4, 2021, 9:13am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/16 "2021-06-04T09:13:04Z")

</div>

Hi,

I have a problem with the cochlea segmentation module.  
This modul create always the same cochlea that is not consist with the real image. I used Slicer 4.10.0 (on the latest version 4.11. this extension not work, always drop an error: 2 arguments expected but 4 were given)

 ![Screenshot_3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/9/6952cbb8d85e891bcbba45eefff77ad12ed5e871.png)

The modul segment this random cochlea also, when I put the markups anywhere on the image.  
What is the problem? I tried what happened if I check the right side box.

Best regards!  
Bence

---

<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:** [June 4, 2021, 8:51pm UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/17 "2021-06-04T20:51:49Z")

</div>

Do you see any errors in the application log?  
If you don’t get an answer here within a couple of days then you can submit a bug report to the extension’s github repository.

---

<div class="post-metadata">

**Author:** ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)\
**Post date:** [June 7, 2021, 8:19am UTC](https://discourse.slicer.org/t/vissim-cochlea-tools-extension-is-now-public/4122/18 "2021-06-07T08:19:34Z")

</div>

Thanks! I will report it on github!
