Skip to content

Commit

Permalink
Move import statement to widget init. #83
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhillyer committed Sep 9, 2020
1 parent 37380ea commit 0399ff2
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
import datetime
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
try:
import collageradiomics
except:
slicer.util.pip_install('collageradiomics')
slicer.util.pip_install('mahotas')

from collageradiomics import HaralickFeature, DifferenceVarianceInterpretation, Collage
#
# CollageRadiomicsSlicer
#
Expand Down Expand Up @@ -57,6 +50,13 @@ def __init__(self, parent=None):
VTKObservationMixin.__init__(self)
self.logic = None
self._parameterNode = None
try:
import collageradiomics
except ModuleNotFoundError as e:
if slicer.util.confirmOkCancelDisplay("CollageRadiomics requires 'collageradiomics' python package. Click OK to download it now. It may take a few minues."):
slicer.util.pip_install('collageradiomics')
import collageradiomics
from collageradiomics import HaralickFeature, DifferenceVarianceInterpretation, Collage

def setup(self):
"""
Expand Down

0 comments on commit 0399ff2

Please sign in to comment.