# Pathology module install fail due to sliceWidget attribute error

**URL:** <https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269>\
**Category:** Support\
**Tags:** extensions-manager, slicerpathology\
**Created:** [March 8, 2018, 3:25pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269 "2018-03-08T15:25:01Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alvin\_Chen](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Alvin\_Chen](https://discourse.slicer.org/u/Alvin_Chen)\
**Post date:** [March 8, 2018, 3:25pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/1 "2018-03-08T15:25:01Z")

</div>

hello,

[environment]  
MacOS 10.13.3 /Ubuntu 16.04 /Win10 have same behavior  
Slicer 4.8.1

[Description]  
when I install pathology module by Extension Manager, after restart slicer  
I will get the following error message in Python Interactor, and there is no Pathology option in module list

Traceback (most recent call last):  
File “”, line 1, in   
File “/Applications/Slicer.app/Contents/Extensions-26813/SlicerPathology/lib/Slicer-4.8/qt-scripted-modules/SlicerPathology.py”, line 749, in   
red\_logic = slicer.app.layoutManager().sliceWidget(“Red”).sliceLogic()  
AttributeError: ‘NoneType’ object has no attribute ‘sliceWidget’

[btw]

1. if I input the following code in Python Interactor, there is no error message  
red\_logic = slicer.app.layoutManager().sliceWidget(“Red”).sliceLogic()
2. if i modify SlicerPathology.py", line 749 as  
lm = slicer.app.layoutManager() ==\> no error message  
red\_logic = lm.sliceWidget(“Red”).sliceLogic() ==\> fail in this line

Alvin

---

<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:** [March 8, 2018, 3:44pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/2 "2018-03-08T15:44:57Z")

</div>

It looks like that module is doing things at the global level (during module discovery) that should really not happen until the application has finished start up.

> <https://github.com/SBU-BMI/SlicerPathology/blob/master/SlicerPathology/SlicerPathology.py#L749-L783>

That code should be wrapped in a function and connected to a signal like this:

> <https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOM/DICOM.py#L70-L71>

@Alvin_Chen can you give that a try?

---

<div class="post-metadata">

**Author:** ![Alvin\_Chen](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Alvin\_Chen](https://discourse.slicer.org/u/Alvin_Chen)\
**Post date:** [March 8, 2018, 5:10pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/3 "2018-03-08T17:10:53Z")

</div>

hi Steve  
i am not sure my modification is corrected or not.  
in SlicerPathology.py, i add a similar code to end of SlicerPathology class, but it is not work  
i got same error message.  
btw, in my previous experiment 1)  
if I input the following single-line code in Python Interactor, there is no error message

```auto
red_logic = slicer.app.layoutManager().sliceWidget(“Red”).sliceLogic()

```

since all platform have same behavior, could you reproduce this case?

```auto
  29 class SlicerPathology(ScriptedLoadableModule):
  30 def __init__ (self, parent):
  31 ScriptedLoadableModule. __init__ (self, parent)
  32 self.parent.title = "Slicer Pathology"
  33 self.parent.categories = ["Pathology"]
  34 self.parent.dependencies = []
  35 self.parent.contributors = ["Erich Bremer, Joel Saltz, Yi Gao, Tammy DiPrima (Stony Brook University)"]
  36 self.parent.helpText = """
  37 Automatic and semi-automatic pathology segmentation tools.
  38 """
  39 self.parent.acknowledgementText = """
  40 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
  41 and Steve Pieper, Isomics, Inc. and was partially funded by NIH grant 3P41RR013218-12S1.
  42 """ # replace with organization, grant and thanks.
  43 slicer.app.connect("startupCompleted()", self.SlicerPathologyWidget) <-- this line

```

---

<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:** [March 8, 2018, 6:04pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/4 "2018-03-08T18:04:35Z")

</div>

Actually it looks like that code was added by mistake - you should just delete [those lines](https://github.com/SBU-BMI/SlicerPathology/blame/master/SlicerPathology/SlicerPathology.py#L749-L783) and see if the if you are able to use the rest of the module as expected.

@fedorov do you know the status?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [March 8, 2018, 8:02pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/5 "2018-03-08T20:02:49Z")

</div>

I don’t. SBU team maintains this module. @tdiprima can you comment?

---

<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:** [March 8, 2018, 8:27pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/6 "2018-03-08T20:27:34Z")

</div>

I filed an issue for reference [https://github.com/SBU-BMI/SlicerPathology/issues/100](https://github.com/SBU-BMI/SlicerPathology/issues/100)

---

<div class="post-metadata">

**Author:** ![Alvin\_Chen](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Alvin\_Chen](https://discourse.slicer.org/u/Alvin_Chen)\
**Post date:** [March 9, 2018, 2:37am UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/7 "2018-03-09T02:37:18Z")

</div>

hi Steve

thanks for your information  
in my ubuntu 16.04 platform  
Pathology module work after this following two steps

1. remove line 749-783 (all non-subroutine code) in SlicerPathology.py
2. fix the following subroutine’s indent error in SlicerPathology.py
  - Four2ThreeChannel
  - loadTCGAData
  - clear\_and\_open
  - loademup

Alvin

---

<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:** [March 9, 2018, 1:52pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/8 "2018-03-09T13:52:30Z")

</div>

Great thanks for reporting @Alvin_Chen. You might consider making a pull request with the fixes to the [SlicerPathology repository](https://github.com/SBU-BMI/SlicerPathology).

---

<div class="post-metadata">

**Author:** ![ebremer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebremer/32/607_2.png) [@ebremer](https://discourse.slicer.org/u/ebremer)\
**Post date:** [May 3, 2018, 3:07am UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/9 "2018-05-03T03:07:19Z")

</div>

Thanks Alvin for reporting this! We’ll take a look at this and get it fixed. - Erich

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [May 24, 2018, 10:17pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/10 "2018-05-24T22:17:11Z")

</div>

To follow up on this issue, @ebremer committed a fix that should resolve the problem in the next nightly. Please report if you have troubles with the extension.

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [October 4, 2018, 12:25pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/11 "2018-10-04T12:25:13Z")

</div>

Hi all,  
I’m trying to find the Pathology module into the extension manager (Linux nightly build) but it looks like it’s missing.  
Any idea?

Thanks a lot 🙂

Paolo

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 4, 2018, 1:52pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/12 "2018-10-04T13:52:07Z")

</div>

@ebremer it appears that SlicerPathology build is currently failing for all operating systems on the dashboard: [http://slicer.cdash.org/index.php?project=SlicerPreview&filtercount=1&showfilters=1&field1=buildname&compare1=63&value1=SlicerPathology](http://slicer.cdash.org/index.php?project=SlicerPreview&filtercount=1&showfilters=1&field1=buildname&compare1=63&value1=SlicerPathology).

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [January 16, 2019, 3:42pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/13 "2019-01-16T15:42:01Z")

</div>

Hi all,  
any news about this module?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [January 16, 2019, 4:28pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/14 "2019-01-16T16:28:10Z")

</div>

I’ve just emailed directly the developers and the PI of the project, will let you know if/when they respond, and whether we get any clarity on the status of support for this extension.

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [January 16, 2019, 10:19pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/15 "2019-01-16T22:19:05Z")

</div>

Thank you very much @fedorov !

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [January 17, 2019, 7:24pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/16 "2019-01-17T19:24:54Z")

</div>

Here’s the response I received from Joel Saltz, who is the PI of the effort:

> Yes, we will be maintaining the extension and we are also plan a new version that leverages software components that we’ve developed over the past couple of years as part of our QuIP U24. Erich will get the current version back up and running very soon.

Hopefully @ebremer will get back to this sometime soon.

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [January 17, 2019, 10:27pm UTC](https://discourse.slicer.org/t/pathology-module-install-fail-due-to-slicewidget-attribute-error/2269/17 "2019-01-17T22:27:46Z")

</div>

Great news!  
Thank you again.

Paolo
