From ab35b010e0c51bb4528ada5091aa71652cb656da Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauld.mccarthy@gmail.com>
Date: Wed, 11 May 2016 12:02:50 +0100
Subject: [PATCH] melodicresults module renamed to melodicanalysis. New
 (currently empty) module, melodiclabels, which will contain all stuff related
 to IC classification labels.

---
 doc/fsl.data.melodicanalysis.rst              |  9 +++++++
 doc/fsl.data.melodiclabels.rst                |  9 +++++++
 doc/fsl.data.melodicresults.rst               |  9 -------
 doc/fsl.data.rst                              |  3 ++-
 .../{melodicresults.py => melodicanalysis.py} |  4 +--
 fsl/data/melodicimage.py                      | 25 ++++++++++---------
 fsl/data/melodiclabels.py                     | 12 +++++++++
 7 files changed, 47 insertions(+), 24 deletions(-)
 create mode 100644 doc/fsl.data.melodicanalysis.rst
 create mode 100644 doc/fsl.data.melodiclabels.rst
 delete mode 100644 doc/fsl.data.melodicresults.rst
 rename fsl/data/{melodicresults.py => melodicanalysis.py} (99%)
 create mode 100644 fsl/data/melodiclabels.py

diff --git a/doc/fsl.data.melodicanalysis.rst b/doc/fsl.data.melodicanalysis.rst
new file mode 100644
index 000000000..0c61211c5
--- /dev/null
+++ b/doc/fsl.data.melodicanalysis.rst
@@ -0,0 +1,9 @@
+:orphan:
+
+fsl.data.melodicanalysis module
+===============================
+
+.. automodule:: fsl.data.melodicanalysis
+    :members:
+    :undoc-members:
+    :show-inheritance:
diff --git a/doc/fsl.data.melodiclabels.rst b/doc/fsl.data.melodiclabels.rst
new file mode 100644
index 000000000..6732f5a6f
--- /dev/null
+++ b/doc/fsl.data.melodiclabels.rst
@@ -0,0 +1,9 @@
+:orphan:
+
+fsl.data.melodiclabels module
+=============================
+
+.. automodule:: fsl.data.melodiclabels
+    :members:
+    :undoc-members:
+    :show-inheritance:
diff --git a/doc/fsl.data.melodicresults.rst b/doc/fsl.data.melodicresults.rst
deleted file mode 100644
index 8c74240d3..000000000
--- a/doc/fsl.data.melodicresults.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-:orphan:
-
-fsl.data.melodicresults module
-==============================
-
-.. automodule:: fsl.data.melodicresults
-    :members:
-    :undoc-members:
-    :show-inheritance:
diff --git a/doc/fsl.data.rst b/doc/fsl.data.rst
index d6c143d57..6575c268f 100644
--- a/doc/fsl.data.rst
+++ b/doc/fsl.data.rst
@@ -10,8 +10,9 @@ fsl.data package
    fsl.data.featdesign
    fsl.data.featimage
    fsl.data.image
+   fsl.data.melodicanalysis
    fsl.data.melodicimage
-   fsl.data.melodicresults
+   fsl.data.melodiclabels
    fsl.data.model
    fsl.data.tensorimage
 
diff --git a/fsl/data/melodicresults.py b/fsl/data/melodicanalysis.py
similarity index 99%
rename from fsl/data/melodicresults.py
rename to fsl/data/melodicanalysis.py
index 6117e9005..b86803a9a 100644
--- a/fsl/data/melodicresults.py
+++ b/fsl/data/melodicanalysis.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #
-# melodicresults.py - Utility functions for loading/querying the contents of a
-# MELODIC analysis directory.
+# melodicanalysis.py - Utility functions for loading/querying the contents of
+# a MELODIC analysis directory.
 # 
 # Author: Paul McCarthy <pauldmccarthy@gmail.com>
 #
diff --git a/fsl/data/melodicimage.py b/fsl/data/melodicimage.py
index fc0cb0670..91b3f08ff 100644
--- a/fsl/data/melodicimage.py
+++ b/fsl/data/melodicimage.py
@@ -14,8 +14,8 @@ import os.path as op
 
 import props
 
-from . import image          as fslimage
-from . import melodicresults as melresults
+from . import image           as fslimage
+from . import melodicanalysis as melanalysis
 
 
 class MelodicImage(fslimage.Image):
@@ -61,7 +61,7 @@ class MelodicImage(fslimage.Image):
         if op.isdir(path):
             path = op.join(path, 'melodic_IC')
 
-        if not melresults.isMelodicImage(path):
+        if not melanalysis.isMelodicImage(path):
             raise ValueError('{} does not appear to be a '
                              'MELODIC component file'.format(path)) 
             
@@ -69,9 +69,9 @@ class MelodicImage(fslimage.Image):
 
         meldir            = op.dirname(path)
         self.__meldir     = meldir
-        self.__melmix     = melresults.getComponentTimeSeries(  meldir)
-        self.__melFTmix   = melresults.getComponentPowerSpectra(meldir)
-        self.__melICClass = melresults.MelodicClassification(   self)
+        self.__melmix     = melanalysis.getComponentTimeSeries(  meldir)
+        self.__melFTmix   = melanalysis.getComponentPowerSpectra(meldir)
+        self.__melICClass = melanalysis.MelodicClassification(   self)
 
         # Automatically set the
         # TR value if possible
@@ -115,24 +115,25 @@ class MelodicImage(fslimage.Image):
         """Returns the top level analysis, if the melodic analysis for this
         ``MelodicImage`` is contained within another analysis. Otherwise,
         returns ``None``. See the
-        :func:`.melodicresults.getTopLevelAnalysisDir` function.
+        :func:`.melodicanalysis.getTopLevelAnalysisDir` function.
         """
-        return melresults.getTopLevelAnalysisDir(self.__meldir)
+        return melanalysis.getTopLevelAnalysisDir(self.__meldir)
 
 
     def getDataFile(self):
         """Returns the file name of the data image from which this
         ``MelodicImage`` was generated, if possible. See the
-        :func:`.melodicresults.getDataFile` function.
+        :func:`.melodicanalysis.getDataFile` function.
         """
-        return melresults.getDataFile(self.__meldir)
+        return melanalysis.getDataFile(self.__meldir)
 
 
     def getMeanFile(self):
         """Returns the file name of the mean data image associated with this
-        ``MelodicImage``. See the :func:`.melodicresults.getMeanFile` function.
+        ``MelodicImage``. See the :func:`.melodicanalysis.getMeanFile`
+        function.
         """
-        return melresults.getMeanFile(self.__meldir) 
+        return melanalysis.getMeanFile(self.__meldir) 
 
 
     def getICClassification(self):
diff --git a/fsl/data/melodiclabels.py b/fsl/data/melodiclabels.py
new file mode 100644
index 000000000..dfef502e6
--- /dev/null
+++ b/fsl/data/melodiclabels.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+#
+# melodiclabels.py - Loading/saving/managing melodic IC labels.
+#
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+#
+"""
+"""
+
+import logging
+log = logging.getLogger(__name__)
+
-- 
GitLab