parameters: (self)
docstring: Remove cruft from image by eroding away by iterations number of layers of surface
      pixels and then saving only islands that are bigger than the minimumSize.
      Then dilate back and save only the pixels that are in both the original and
      result image.  Result is that small islands outside the foreground and small features
      on the foreground are removed.
  
      By calling the decrufter twice with fg and bg reversed, you can clean up small features in
      a label map while preserving the original boundary in other places.
docstring_summary: Remove cruft from image by eroding away by iterations number of layers of surface
      pixels and then saving only islands that are bigger than the minimumSize.
      Then dilate back and save only the pixels that are in both the original and
      result image.  Result is that small islands outside the foreground and small features
      on the foreground are removed.
docstring_tokens: Remove cruft from image by eroding away by iterations number of layers of surface pixels and then saving only islands that are bigger than the minimumSize . Then dilate back and save only the pixels that are in both the original and result image . Result is that small islands outside the foreground and small features on the foreground are removed .
function: def removeIslandsMorphology(self):
      """
      Remove cruft from image by eroding away by iterations number of layers of surface
      pixels and then saving only islands that are bigger than the minimumSize.
      Then dilate back and save only the pixels that are in both the original and
      result image.  Result is that small islands outside the foreground and small features
      on the foreground are removed.
  
      By calling the decrufter twice with fg and bg reversed, you can clean up small features in
      a label map while preserving the original boundary in other places.
      """
      if not self.sliceLogic:
        self.sliceLogic = EditUtil.getSliceLogic()
      parameterNode = EditUtil.getParameterNode()
      self.minimumSize = int(parameterNode.GetParameter("IslandEffect,minimumSize"))
      self.fullyConnected = bool(parameterNode.GetParameter("IslandEffect,fullyConnected"))
  
      labelImage = vtk.vtkImageData()
      labelImage.DeepCopy( self.getScopedLabelInput() )
      label = EditUtil.getLabel()
  
      self.undoRedo.saveState()
  
      self.removeIslandsMorphologyDecruft(labelImage,0,label)
      self.getScopedLabelOutput().DeepCopy(labelImage)
      self.applyScopedLabel()
      slicer.app.processEvents(qt.QEventLoop.ExcludeUserInputEvents)
  
      self.removeIslandsMorphologyDecruft(labelImage,label,0)
      self.getScopedLabelOutput().DeepCopy(labelImage)
      self.applyScopedLabel()
function_tokens: def removeIslandsMorphology ( self ) : if not self . sliceLogic : self . sliceLogic = EditUtil . getSliceLogic ( ) parameterNode = EditUtil . getParameterNode ( ) self . minimumSize = int ( parameterNode . GetParameter ( "IslandEffect,minimumSize" ) ) self . fullyConnected = bool ( parameterNode . GetParameter ( "IslandEffect,fullyConnected" ) ) labelImage = vtk . vtkImageData ( ) labelImage . DeepCopy ( self . getScopedLabelInput ( ) ) label = EditUtil . getLabel ( ) self . undoRedo . saveState ( ) self . removeIslandsMorphologyDecruft ( labelImage , 0 , label ) self . getScopedLabelOutput ( ) . DeepCopy ( labelImage ) self . applyScopedLabel ( ) slicer . app . processEvents ( qt . QEventLoop . ExcludeUserInputEvents ) self . removeIslandsMorphologyDecruft ( labelImage , label , 0 ) self . getScopedLabelOutput ( ) . DeepCopy ( labelImage ) self . applyScopedLabel ( )