From df86c2d6066ef5ee5d2ca61c13b7ae575cbe5c7f Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauld.mccarthy@gmail.com>
Date: Thu, 17 Mar 2016 14:55:21 +0000
Subject: [PATCH] Bugfix - LabelGrid was not being notified of new lut labels
 when loaded from a label file. Other minor typo fixes.

---
 fsl/data/model.py                                  | 2 +-
 fsl/fsleyes/autodisplay.py                         | 2 +-
 fsl/fsleyes/controls/melodicclassificationpanel.py | 7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fsl/data/model.py b/fsl/data/model.py
index 2d87e3947..dcbc29b97 100644
--- a/fsl/data/model.py
+++ b/fsl/data/model.py
@@ -4,7 +4,7 @@
 #
 # Author: Paul McCarthy <pauldmccarthy@gmail.com>
 #
-"""This module providse the :class:`Model` class, which represents a 3D model.
+"""This module provides the :class:`Model` class, which represents a 3D model.
 
 .. note:: I/O support is very limited - currently, the only supported file 
           type is the VTK legacy file format, containing the ``POLYDATA``
diff --git a/fsl/fsleyes/autodisplay.py b/fsl/fsleyes/autodisplay.py
index cb28ad374..ab5f0564f 100644
--- a/fsl/fsleyes/autodisplay.py
+++ b/fsl/fsleyes/autodisplay.py
@@ -200,7 +200,7 @@ def _MelodicImageDisplay(overlay, overlayList, displayCtx):
         overlayList.insert(idx, meanImg)
 
 
-def _ModelDisplay(overlay, display, overlayList, displayCtx):
+def _ModelDisplay(overlay, overlayList, displayCtx):
     """Automatically configure display settings for the given :class:`.Model`
     overlay.
     """
diff --git a/fsl/fsleyes/controls/melodicclassificationpanel.py b/fsl/fsleyes/controls/melodicclassificationpanel.py
index 8154c9ad8..15fe049d1 100644
--- a/fsl/fsleyes/controls/melodicclassificationpanel.py
+++ b/fsl/fsleyes/controls/melodicclassificationpanel.py
@@ -180,7 +180,7 @@ class MelodicClassificationPanel(fslpanel.FSLEyesPanel):
            overlay.
 
         If the number of labels in the file is less than the number of
-        melodic_IC components, thew remaining components are labelled
+        melodic_IC components, the remaining components are labelled
         as unknown. If the number of labels in the file is greater than
         the number of melodic_IC components, an error is shown, and
         nothing is done.
@@ -246,6 +246,11 @@ class MelodicClassificationPanel(fslpanel.FSLEyesPanel):
             melclass.enableNotification('labels') 
             lut     .enableNotification('labels')
 
+            # Make sure that lut listeners
+            # are notified, in case any
+            # new labels were added.
+            lut.notify('labels')
+
             # If we have just loaded a MelodicImage,
             # make sure it is selected. If we loaded
             # labels for an existing MelodicImage,
-- 
GitLab