diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
index e34491b0627187295c0bc615ca913f48b3af4742..6a473630755b94046dcaf99241e514d3b9c59cdc 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
@@ -247,6 +247,11 @@ public:
     return getSpectrum(index)->ptrX();
   }
 
+  /// Returns a pointer to the dX  (X Error) data
+  virtual Kernel::cow_ptr<MantidVec> refDx(const std::size_t index) const {
+    return getSpectrum(index)->ptrDx();
+  }
+
   /// Set the specified X array to point to the given existing array
   virtual void setX(const std::size_t index, const MantidVec &X) {
     getSpectrum(index)->setX(X);
@@ -265,6 +270,24 @@ public:
     invalidateCommonBinsFlag();
   }
 
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVec &Dx) {
+    getSpectrum(index)->setDx(Dx);
+    invalidateCommonBinsFlag();
+  }
+
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVecPtr &Dx) {
+    getSpectrum(index)->setDx(Dx);
+    invalidateCommonBinsFlag();
+  }
+
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVecPtr::ptr_type &Dx) {
+    getSpectrum(index)->setX(Dx);
+    invalidateCommonBinsFlag();
+  }
+
   /** Sets the data in the workspace
   @param index :: the workspace index to set.
   @param Y :: Y vector  */
diff --git a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
index 552b4b83ce15719cfd29fc735d1babca4ac46af0..af9e87a4543d1ffcca0320d676d52a9cf092f328 100644
--- a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
+++ b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
@@ -8,7 +8,10 @@
 #include "MantidGeometry/Instrument/DetectorGroup.h"
 #include "MantidGeometry/Instrument/NearestNeighboursFactory.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
 #include "MantidKernel/TimeSeriesProperty.h"
+#include "MantidKernel/MDUnit.h"
 
 #include <numeric>
 #include <boost/math/special_functions/fpclassify.hpp>
@@ -1277,7 +1280,7 @@ class MWDimension : public Mantid::Geometry::IMDDimension {
 public:
   MWDimension(const Axis *axis, const std::string &dimensionId)
       : m_axis(*axis), m_dimensionId(dimensionId),
-        m_haveEdges(dynamic_cast<const BinEdgeAxis *>(&m_axis) != NULL) {}
+        m_haveEdges(dynamic_cast<const BinEdgeAxis *>(&m_axis) != NULL), m_frame(new Geometry::GeneralFrame(m_axis.unit()->label(), m_axis.unit()->label())) {}
 
   /// the name of the dimennlsion as can be displayed along the axis
   virtual std::string getName() const {
@@ -1339,12 +1342,21 @@ public:
     throw std::runtime_error("Not implemented");
   }
 
+  const Kernel::MDUnit &getMDUnits() const{
+      return m_frame->getMDUnit();
+  }
+  const Geometry::MDFrame& getMDFrame() const{
+      return *m_frame;
+  }
+
   virtual ~MWDimension() {}
 
 private:
   const Axis &m_axis;
   const std::string m_dimensionId;
   const bool m_haveEdges;
+  const Geometry::MDFrame_const_uptr m_frame;
+
 };
 
 //===============================================================================
@@ -1354,7 +1366,7 @@ private:
 class MWXDimension : public Mantid::Geometry::IMDDimension {
 public:
   MWXDimension(const MatrixWorkspace *ws, const std::string &dimensionId)
-      : m_ws(ws), m_dimensionId(dimensionId) {
+      : m_ws(ws), m_dimensionId(dimensionId), m_frame(new Geometry::GeneralFrame(m_ws->getAxis(0)->unit()->label(), m_ws->getAxis(0)->unit()->label())) {
     m_X = ws->readX(0);
   }
 
@@ -1407,6 +1419,12 @@ public:
   virtual std::string toXMLString() const {
     throw std::runtime_error("Not implemented");
   }
+  const Kernel::MDUnit &getMDUnits() const{
+      return m_frame->getMDUnit();
+  }
+  const Geometry::MDFrame& getMDFrame() const{
+      return *m_frame;
+  }
 
 private:
   /// Workspace we refer to
@@ -1415,6 +1433,8 @@ private:
   MantidVec m_X;
   /// Dimension ID string
   const std::string m_dimensionId;
+  /// Unit
+  const Geometry::MDFrame_const_uptr m_frame;
 };
 
 boost::shared_ptr<const Mantid::Geometry::IMDDimension>
diff --git a/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp b/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
index 84050147560c09e2268ba1594ab78ab04416cb4a..352ebf45503ecdaee412e1f1733d1bd1dd4a5226 100644
--- a/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
@@ -149,17 +149,28 @@ void ExtractSpectra::execHistogram() {
     const MantidVec &oldX = m_inputWorkspace->readX(m_workspaceIndexList.front());
     newX.access().assign(oldX.begin() + m_minX, oldX.begin() + m_maxX);
   }
+
   Progress prog(this, 0.0, 1.0, (m_workspaceIndexList.size()));
   // Loop over the required workspace indices, copying in the desired bins
   for (int j = 0; j < static_cast<int>(m_workspaceIndexList.size()); ++j) {
     auto i = m_workspaceIndexList[j];
+
+    bool hasDx = m_inputWorkspace->hasDx(i);
+
     // Preserve/restore sharing if X vectors are the same
     if (m_commonBoundaries) {
       outputWorkspace->setX(j, newX);
+      if (hasDx) {
+        const MantidVec &oldDx = m_inputWorkspace->readDx(i);
+        outputWorkspace->dataDx(j).assign(oldDx.begin() + m_minX, oldDx.begin() + m_maxX);
+      }
     } else {
       // Safe to just copy whole vector 'cos can't be cropping in X if not
       // common
       outputWorkspace->setX(j, m_inputWorkspace->refX(i));
+      if (hasDx) {
+        outputWorkspace->setDx(j, m_inputWorkspace->refDx(i));
+      }
     }
 
     const MantidVec &oldY = m_inputWorkspace->readY(i);
@@ -323,13 +334,26 @@ void ExtractSpectra::execEvent() {
     // Copy spectrum number & detector IDs
     outEL.copyInfoFrom(el);
 
-    if (!m_commonBoundaries)
+    bool hasDx = eventW->hasDx(i);
+
+    if (!m_commonBoundaries) {
       // If the X axis is NOT common, then keep the initial X axis, just clear
       // the events
       outEL.setX(el.dataX());
-    else
+      if (hasDx) {
+        outEL.setDx(el.dataDx());
+      }
+    }
+    else {
       // Common bin boundaries get all set to the same value
       outEL.setX(XValues_new);
+      if (hasDx) {
+        const MantidVec &oldDx = m_inputWorkspace->readDx(i);
+        cow_ptr<MantidVec> DxValues_new;
+        DxValues_new.access().assign(oldDx.begin() + m_minX, oldDx.begin() + m_maxX);
+        outEL.setDx(DxValues_new);
+      }
+    }
 
     // Propagate bin masking if there is any
     if (m_inputWorkspace->hasMaskedBins(i)) {
diff --git a/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp b/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
index d2750c072444cb7bb4ebccc5e613f1aa181fbab1..623cc9cae2eeae69be611527bff3f226280b19e0 100644
--- a/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
@@ -44,16 +44,16 @@ void TOFSANSResolutionByPixel::init() {
                   "Name of the newly created workspace which contains the Q resolution.");
   auto positiveDouble = boost::make_shared<BoundedValidator<double>>();
   positiveDouble->setLower(0);
-  declareProperty("DeltaR", 0.0, positiveDouble, "Pixel size (mm).");
+  declareProperty("DeltaR", 0.0, positiveDouble, "Virtual ring width on the detector (mm).");
   declareProperty("SampleApertureRadius", 0.0, positiveDouble,
-                  "Sample aperture radius (mm).");
+                  "Sample aperture radius, R2 (mm).");
   declareProperty("SourceApertureRadius", 0.0, positiveDouble,
-                  "Source aperture radius (mm).");
+                  "Source aperture radius, R1 (mm).");
   declareProperty(new WorkspaceProperty<>(
                       "SigmaModerator", "", Direction::Input,
                       boost::make_shared<WorkspaceUnitValidator>("Wavelength")),
-                  "Sigma moderator spread in units of microsec as a function "
-                  "of wavelength.");
+                  "Moderator time spread (microseconds) as a"
+                  "function of wavelength (Angstroms).");
   declareProperty("CollimationLength", 0.0, positiveDouble, "Collimation length (m)");
   declareProperty("AccountForGravity", false,
                   "Whether to correct for the effects of gravity");
diff --git a/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h b/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
index 2fc6324ecc801cdad33e5f1ba0b111a3f0b2a068..caf31ae87f09bdc4d2fc450cf8d5bf4c5b0155e4 100644
--- a/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
+++ b/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
@@ -187,6 +187,18 @@ public:
     params.testDetectorList(*ws);
   }
 
+  void test_with_dx_data() {
+    // Arrange
+    Parameters params("histo-dx");
+
+    // Act
+    auto ws = runAlgorithm(params);
+    if (!ws) return;
+
+    // Assert
+    TS_ASSERT_EQUALS(ws->blocksize(), nBins);
+    params.testDx(*ws);
+  }
 
 
   // ---- test event ----
@@ -290,7 +302,7 @@ public:
   }
 
 
-    void test_index_and_detector_list_event()
+  void test_index_and_detector_list_event()
   {
     Parameters params("event-detector");
     params.setDetectorList().setIndexRange();
@@ -326,6 +338,13 @@ public:
     params.testDetectorList(*ws);
   }
 
+  void test_with_dx_data_event() {
+    Parameters params("event-dx");
+    auto ws = runAlgorithm(params);
+
+    if (!ws) return;
+    params.testDx(*ws);
+  }
 
   // ---- test histo-ragged ----
 
@@ -373,6 +392,7 @@ public:
     auto ws = runAlgorithm(params, false);
   }
 
+
 private:
 
   // -----------------------  helper methods ------------------------
@@ -393,6 +413,10 @@ private:
       return createInputWithDetectors("histo");
     else if (workspaceType == "event-detector")
       return createInputWithDetectors("event");
+    else if (workspaceType == "histo-dx")
+      return createInputWorkspaceHistWithDx();
+    else if (workspaceType == "event-dx")
+      return createInputWorkspaceEventWithDx();
     throw std::runtime_error("Undefined workspace type");
   }
 
@@ -410,6 +434,18 @@ private:
     return space;
   }
 
+  MatrixWorkspace_sptr createInputWorkspaceHistWithDx() const {
+    auto ws = createInputWorkspaceHisto();
+    // Add the delta x values
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k <= nBins; ++k) {
+        // Add a constant error to all spectra
+        ws->dataDx(j)[k] = sqrt(double(k));
+      }
+    }
+    return ws;
+  }
+
   MatrixWorkspace_sptr createInputWorkspaceHistoRagged() const
   {
     // Set up a small workspace for testing
@@ -436,6 +472,21 @@ private:
     return ws;
   }
 
+  MatrixWorkspace_sptr createInputWorkspaceEventWithDx() const {
+    auto ws = createInputWorkspaceEvent();
+    // Add the delta x values
+    for (size_t j = 0; j < nSpec; ++j) {
+      Mantid::MantidVecPtr dXvals;
+      Mantid::MantidVec &dX = dXvals.access();
+      dX.resize(nBins + 1, 0.0);
+      for (size_t k = 0; k <= nBins; ++k) {
+        dX[k] = sqrt(double(k)) + 1;
+      }
+      ws->setDx(j, dXvals);
+    }
+    return ws;
+  }
+
   MatrixWorkspace_sptr createInputWithDetectors(std::string workspaceType) const
   {
     MatrixWorkspace_sptr ws;
@@ -456,8 +507,6 @@ private:
     return ws;
   }
 
-
-
   struct Parameters
   {
     Parameters(const std::string& workspaceType = "histo")
@@ -612,6 +661,30 @@ private:
       StartWorkspaceIndex = 1000;
       EndWorkspaceIndex = 1002;
     }
+
+    // ---- test Dx -------
+    void testDx(const MatrixWorkspace& ws) const {
+      if (wsType == "histo-dx") {
+        TS_ASSERT(ws.hasDx(0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[0], 0.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[1], 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[2], sqrt(2.0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[3], sqrt(3.0));
+        // Check that the length of x and dx is the same
+        auto x = ws.readX(0);
+        auto dX = ws.readDx(0);
+        TS_ASSERT_EQUALS(x.size(), dX.size());
+
+      } else if (wsType == "event-dx"){
+        TS_ASSERT(ws.hasDx(0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[0], 0.0 + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[1], 1.0 + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[2], sqrt(2.0) + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[3], sqrt(3.0) + 1.0);
+      } else {
+        TSM_ASSERT("Should never reach here", false);
+      }
+    }
   };
 
   MatrixWorkspace_sptr runAlgorithm(const Parameters& params, bool expectSuccess = true) const
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
index ac3e99696f9b5a9f780a374fd116fe57a3115a74..04f4d559cefd4d001ef2d330d6e24d3658694be9 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
@@ -91,6 +91,9 @@ private:
 
   // Remove lines from an input stream
   void skipLines(std::istream &strm, int nlines);
+
+  /// Check if we the data set stores an X-Error values
+  bool hasXerror(std::ifstream &stream);
 };
 }
 }
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
index 0f3e2b96133d120c4e2ba53d32a9bf8d2ecddac7..9cffd124a302840793b0f2b8940737be8335fe0f 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
@@ -5,6 +5,7 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidAPI/Algorithm.h"
+#include "MantidDataObjects/Workspace2D.h"
 
 namespace Mantid {
 namespace DataHandling {
@@ -105,6 +106,9 @@ private:
   /// Overwrites Algorithm method
   void exec();
 
+  /// Saves out x errors
+  void saveXerrors(std::ofstream& stream, const Mantid::DataObjects::Workspace2D_sptr workspace, const size_t numberOfHist);
+
   /// The name of the file used for storing the workspace
   std::string m_filename;
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
index 6ee8786c72d63f3509a54a30fa83296af7899a76..c05af4bfa3f47d33cf42caed4f993dd1f14aa589 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
@@ -26,6 +26,45 @@ using namespace Mantid::Kernel;
 
 DECLARE_FILELOADER_ALGORITHM(LoadRKH)
 
+namespace {
+void readLinesForRKH1D(std::istream& stream, int readStart, int readEnd, std::vector<double>& columnOne,
+                       std::vector<double>& ydata, std::vector<double>& errdata, Progress& prog) {
+  std::string fileline = "";
+  for (int index = 1; index <= readEnd; ++index) {
+    getline(stream, fileline);
+    if (index < readStart)
+      continue;
+    double x(0.), y(0.), yerr(0.);
+    std::istringstream datastr(fileline);
+    datastr >> x >> y >> yerr;
+    columnOne.push_back(x);
+    ydata.push_back(y);
+    errdata.push_back(yerr);
+    prog.report();
+  }
+}
+
+void readLinesWithXErrorForRKH1D(std::istream& stream, int readStart, int readEnd, std::vector<double>& columnOne,
+                                 std::vector<double>& ydata, std::vector<double>& errdata, std::vector<double>& xError,
+                                 Progress& prog) {
+  std::string fileline = "";
+  for (int index = 1; index <= readEnd; ++index) {
+    getline(stream, fileline);
+    if (index < readStart)
+      continue;
+    double x(0.), y(0.), yerr(0.), xerr(0.);
+    std::istringstream datastr(fileline);
+    datastr >> x >> y >> yerr>>xerr;
+    columnOne.push_back(x);
+    ydata.push_back(y);
+    errdata.push_back(yerr);
+    xError.push_back(xerr);
+    prog.report();
+  }
+}
+}
+
+
 /**
  * Return the confidence with with this algorithm can load the file
  * @param descriptor A descriptor for the file
@@ -221,24 +260,22 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
 
   int pointsToRead = readEnd - readStart + 1;
   // Now stream sits at the first line of data
-  fileline = "";
-  std::vector<double> columnOne, ydata, errdata;
+  std::vector<double> columnOne, ydata, errdata, xError;
   columnOne.reserve(readEnd);
   ydata.reserve(readEnd);
   errdata.reserve(readEnd);
 
+  auto hasXError = hasXerror(m_fileIn);
+
   Progress prog(this, 0.0, 1.0, readEnd);
-  for (int index = 1; index <= readEnd; ++index) {
-    getline(m_fileIn, fileline);
-    if (index < readStart)
-      continue;
-    double x(0.), y(0.), yerr(0.);
-    std::istringstream datastr(fileline);
-    datastr >> x >> y >> yerr;
-    columnOne.push_back(x);
-    ydata.push_back(y);
-    errdata.push_back(yerr);
-    prog.report();
+
+  if (hasXError) {
+    xError.reserve(readEnd);
+    readLinesWithXErrorForRKH1D(m_fileIn, readStart, readEnd,
+                                columnOne, ydata, errdata, xError,  prog);
+  } else {
+    readLinesForRKH1D(m_fileIn, readStart, readEnd,
+                      columnOne, ydata, errdata, prog);
   }
   m_fileIn.close();
 
@@ -246,6 +283,10 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
   assert(pointsToRead == static_cast<int>(ydata.size()));
   assert(pointsToRead == static_cast<int>(errdata.size()));
 
+  if (hasXError) {
+    assert(pointsToRead == static_cast<int>(xError.size()));
+  }
+
   if (colIsUnit) {
     MatrixWorkspace_sptr localworkspace = WorkspaceFactory::Instance().create(
         "Workspace2D", 1, pointsToRead, pointsToRead);
@@ -254,7 +295,9 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
     localworkspace->dataX(0) = columnOne;
     localworkspace->dataY(0) = ydata;
     localworkspace->dataE(0) = errdata;
-
+    if (hasXError) {
+      localworkspace->dataDx(0) = xError;
+    }
     return localworkspace;
   } else {
     MatrixWorkspace_sptr localworkspace =
@@ -266,6 +309,12 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
       localworkspace->dataY(index)[0] = ydata[index];
       localworkspace->dataE(index)[0] = errdata[index];
     }
+
+    if (hasXError) {
+      for (int index = 0; index < pointsToRead; ++index) {
+        localworkspace->dataDx(index)[0] = xError[index];
+      }
+    }
     return localworkspace;
   }
 }
@@ -480,5 +529,27 @@ void LoadRKH::binCenter(const MantidVec oldBoundaries,
                         MantidVec &toCenter) const {
   VectorHelper::convertToBinCentre(oldBoundaries, toCenter);
 }
+
+/**
+ * Checks if there is an x error present in the data set
+ * @param stream:: the stream object 
+ */
+bool LoadRKH::hasXerror(std::ifstream &stream) {
+  auto containsXerror = false;
+  auto currentPutLocation = stream.tellg();
+  std::string line;
+  getline(stream, line);
+
+  std::string x,y, yerr, xerr;
+  std::istringstream datastr(line);
+  datastr >> x >> y >> yerr >> xerr;
+  if (!xerr.empty()) {
+    containsXerror = true;
+  }
+  // Reset the original location of the stream
+  stream.seekg(currentPutLocation, stream.beg);
+  return containsXerror;
+}
+
 }
 }
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp b/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
index 8f38c1b278723052cb99cc8c932cece6d1407b38..b3212a59e0d2a63a6d59d4f22013029cb856c0b1 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
@@ -70,6 +70,11 @@ void SaveCSV::init() {
   declareProperty("LineSeparator", "\n",
                   "The string to place at the end of lines (default new line\n"
                   "character)");
+  declareProperty(
+      new PropertyWithValue<bool>("SaveXerrors", 0, Direction::Input),
+      "This option saves out the x errors if any are present. If you have x errors\n"
+      "in your workspace and you do not select this option, then the x errors\n"
+      "are not saved to the file.");
 }
 
 /** Executes the algorithm. Retrieve the Filename, separator and Lineseparator
@@ -179,6 +184,11 @@ void SaveCSV::exec() {
       p.report();
     }
 
+    // Potentially save the x errors
+    if (getProperty("SaveXerrors")) {
+      saveXerrors(outCSV_File, localworkspace, numberOfHist);
+    }
+
   } else {
     outCSV_File.close(); // and should probably delete file from disk as well
     throw Exception::NotImplementedError(
@@ -189,5 +199,26 @@ void SaveCSV::exec() {
   return;
 }
 
+
+void SaveCSV::saveXerrors(std::ofstream& stream, const Mantid::DataObjects::Workspace2D_sptr workspace, const size_t numberOfHist) {
+  // If there isn't a dx values present in the first entry then return
+  if (!workspace->hasDx(0)) {
+    return;
+  }
+  Progress p(this, 0.0, 1.0, numberOfHist);
+  stream << "\nXERRORS\n";
+  for (size_t i = 0; i < numberOfHist; i++) {
+    const MantidVec &dXvalue = workspace->dataDx(i);
+
+    stream << i;
+
+    for (int j = 0; j < (int)dXvalue.size(); j++) {
+      stream<< std::setw(15) << dXvalue[j] << m_separator;
+    }
+    stream << m_lineSeparator;
+    p.report("Saving x errors...");
+  }
+}
+
 } // namespace DataHandling
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp b/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
index f590b3c5574ade374d69378aef6e0c2e7ccca526..3e7ff6d9eadb67d3ac57bf088bedf4ae3369b038 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
@@ -164,18 +164,35 @@ void SaveRKH::write1D() {
       specid = static_cast<specid_t>(i + 1);
     }
 
+    auto hasDx = m_workspace->hasDx(i);
+    //hasDx = false;
+    // We only want to access the dx values if they exist. In case they don't exist
+    // set the dXData const reference to the X value. The value will not be used later on.
+    const auto &dXdata = hasDx ? m_workspace->readDx(i) : m_workspace->readX(i);
+
     for (size_t j = 0; j < nbins; ++j) {
       // Calculate/retrieve the value to go in the first column
       double xval(0.0);
+      double dXval(0.0);
       if (horizontal)
         xval = histogram ? 0.5 * (xdata[j] + xdata[j + 1]) : xdata[j];
       else {
         xval = static_cast<double>(specid);
       }
 
+      if (hasDx) {
+        dXval = histogram ? 0.5 * (dXdata[j] + dXdata[j + 1]) : dXdata[j];
+      }
+
       m_outRKH << std::fixed << std::setw(12) << std::setprecision(5) << xval
                << std::scientific << std::setw(16) << std::setprecision(6)
-               << ydata[j] << std::setw(16) << edata[j] << "\n";
+               << ydata[j] << std::setw(16) << edata[j];
+
+      if (hasDx) {
+        m_outRKH << std::setw(16) << dXval;
+      }
+
+      m_outRKH << "\n";
 
       prg.report();
     }
diff --git a/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h b/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
index 477928bc782545467c3036d240d5e2693cbd4fa9..d8d05bde20282ba2c9222e7f2e95a67e379d205f 100644
--- a/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
@@ -21,7 +21,7 @@ public:
   static void destroySuite(LoadRKHTest *suite) { delete suite; }
 
   // A sample file is in the repository
-  LoadRKHTest() : dataFile(""), tempFile("LoadRKH_test_file_2D")
+  LoadRKHTest() : dataFile(""), tempFile("LoadRKH_test_file_2D"), tempFile2("LoadRKH_test_file_1D_with_DX")
   {    
     dataFile = "DIRECT.041";
   }
@@ -38,6 +38,7 @@ public:
 
   void testInit()
   {
+    Mantid::DataHandling::LoadRKH loadrkh;
     TS_ASSERT_THROWS_NOTHING( loadrkh.initialize());
     TS_ASSERT( loadrkh.isInitialized() );
   }
@@ -46,7 +47,7 @@ public:
   {
     // Set the facility
     ConfigService::Instance().setString("default.facility", "ISIS");
-
+     Mantid::DataHandling::LoadRKH loadrkh;
     if ( !loadrkh.isInitialized() ) loadrkh.initialize();
 
     //No parameters have been set yet, so it should throw
@@ -66,7 +67,7 @@ public:
     //Should now throw nothing
     TS_ASSERT_THROWS_NOTHING( loadrkh.execute() );
     TS_ASSERT( loadrkh.isExecuted() );
-    
+
     using namespace Mantid::API;
     using namespace Mantid::DataObjects;
     //Now need to test the resultant workspace, first retrieve it
@@ -108,8 +109,8 @@ public:
     TS_ASSERT_DELTA( data->dataE(0)[0], 0.122346, tolerance );
     TS_ASSERT_DELTA( data->dataE(0)[25], 0.018345, tolerance );
     TS_ASSERT_DELTA( data->dataE(0)[99], 0.0, tolerance );
-
   }
+
   void test2D()
   {
     // Set the facility
@@ -185,9 +186,69 @@ public:
     remove(tempFile.c_str());
   }
 
+
+  void test1DWithDx()
+  {
+
+    // Arrange
+    ConfigService::Instance().setString("default.facility", "ISIS");
+    writeTestFileWithDx();
+    std::string outputSpace = "outer_1d_with_dx";
+
+    // Act
+    Mantid::DataHandling::LoadRKH rkhAlg;
+    rkhAlg.initialize();
+    rkhAlg.setPropertyValue("Filename", tempFile2);
+    rkhAlg.setPropertyValue("OutputWorkspace", outputSpace);
+
+    // Assert
+    std::string result;
+    TS_ASSERT_THROWS_NOTHING( result = rkhAlg.getPropertyValue("Filename") )
+    TS_ASSERT_THROWS_NOTHING( result = rkhAlg.getPropertyValue("OutputWorkspace") )
+    TS_ASSERT( result == outputSpace );
+    TS_ASSERT_THROWS_NOTHING( rkhAlg.execute() );
+    TS_ASSERT( rkhAlg.isExecuted() );
+
+    using namespace Mantid::API;
+    using namespace Mantid::DataObjects;
+    //Now need to test the resultant workspace, first retrieve it
+    Workspace_sptr rkhspace;
+
+    TS_ASSERT_THROWS_NOTHING( rkhspace = AnalysisDataService::Instance().retrieve(outputSpace) );
+    Workspace2D_sptr data = boost::dynamic_pointer_cast<Workspace2D>(rkhspace);
+
+    TS_ASSERT_EQUALS( data->getNumberHistograms(), 1);
+
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataX(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataDx(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataY(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataY(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataE(0).size()), 10);
+
+    double tolerance(1e-06);
+
+    TS_ASSERT_DELTA( data->dataX(0)[0], 0.5, tolerance );
+    TS_ASSERT_DELTA( data->dataX(0)[1], 1.5 , tolerance );
+    TS_ASSERT_DELTA( data->dataX(0)[2], 2.5, tolerance ); 
+
+    TS_ASSERT_DELTA( data->dataY(0)[0], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataY(0)[1], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataY(0)[1], 1.000000e+00, tolerance );
+
+    TS_ASSERT_DELTA( data->dataE(0)[1], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataE(0)[0], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataE(0)[1], 1.000000e+00, tolerance );
+
+
+    TS_ASSERT_DELTA( data->dataDx(0)[0], 5.000000e-01, tolerance );
+    TS_ASSERT_DELTA( data->dataDx(0)[1], 1.207107e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataDx(0)[2], 1.573132e+00, tolerance ); 
+
+    remove(tempFile2.c_str());
+  }
+
 private:
-  Mantid::DataHandling::LoadRKH loadrkh;
-  std::string dataFile, tempFile;
+  std::string dataFile, tempFile, tempFile2;
   
   /** Create a tiny 2x2 workspace in a tempory file that should
   *  be deleted
@@ -213,6 +274,26 @@ private:
       file << "1 2 3 4\n";
       file.close();
     }
+
+  void writeTestFileWithDx() {
+      std::ofstream file(tempFile2.c_str());
+      file << "        Thu 20-AUG-2015 08:30 Workspace: testInputThree\n";
+      file << " \n";
+      file << "   10    0    0    0    1   10    0\n";
+      file << "         0         0         0         0\n";
+      file << " 3 (F12.5,2E16.6)\n";
+      file << "     0.50000    1.000000e+00    1.000000e+00    5.000000e-01\n";
+      file << "     1.50000    1.000000e+00    1.000000e+00    1.207107e+00\n";
+      file << "     2.50000    1.000000e+00    1.000000e+00    1.573132e+00\n";
+      file << "     3.50000    1.000000e+00    1.000000e+00    1.866025e+00\n";
+      file << "     4.50000    1.000000e+00    1.000000e+00    2.118034e+00\n";
+      file << "     5.50000    1.000000e+00    1.000000e+00    2.342779e+00\n";
+      file << "     6.50000    1.000000e+00    1.000000e+00    2.547621e+00\n";
+      file << "     7.50000    1.000000e+00    1.000000e+00    2.737089e+00\n";
+      file << "     8.50000    1.000000e+00    1.000000e+00    2.914214e+00\n";
+      file << "     9.50000    1.000000e+00    1.000000e+00    3.081139e+00\n";
+      file.close();
+  }
 };
 
 
diff --git a/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h b/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
index 85c77742ab8cc57aa7150346fdfd451c29d8b358..4d5f8a8059d17e5f66efa616bc4dd12b7cd9a11c 100644
--- a/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
@@ -23,6 +23,11 @@ using namespace Mantid::DataObjects;
 // Notice also that currently no tests have been added to test
 // this class when trying to save a 2D workspace with SaveCSV. 
 
+namespace {
+  const size_t nBins = 3;
+}
+
+
 class SaveCSVTest : public CxxTest::TestSuite
 {
 public: 
@@ -46,8 +51,7 @@ public:
     
     AnalysisDataService::Instance().add("SAVECSVTEST-testSpace", localWorkspace);
   }
-  
-  
+
   void testInit()
   {
     TS_ASSERT_THROWS_NOTHING(algToBeTested.initialize());
@@ -104,19 +108,156 @@ public:
     TS_ASSERT_DELTA(d2, 0.1, 1e-5);
     TS_ASSERT_DELTA(d3, 0.2, 1e-5);
     TS_ASSERT_EQUALS( number_plus_comma, "0.3," );
-    
-    
+
     // remove file created by this algorithm
     Poco::File(outputFile).remove();
     AnalysisDataService::Instance().remove("SAVECSVTEST-testSpace");
-  
   }
 
-  
+
+  void test_saving_1D_error_with_x_error() {
+    std::string fileName = "test_save_csv_with_x_errors_1D.csv";
+    const size_t numberOfSpectra = 1;
+    runTestWithDx(fileName, numberOfSpectra);
+  }
+
+  void test_saving_2D_error_with_x_error() {
+    std::string fileName = "test_save_csv_with_x_errors_2D.csv";
+    const size_t numberOfSpectra = 3;
+    runTestWithDx(fileName, numberOfSpectra);
+  }
+
 private:
   SaveCSV algToBeTested;
   std::string outputFile;
-  
+
+  MatrixWorkspace_sptr createWorkspaceWithDxValues(const size_t nSpec) const {
+    auto ws = WorkspaceFactory::Instance().create("Workspace2D", nSpec, nBins+1, nBins);
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k < nBins + 1; ++k) {
+        ws->dataX(j)[k] = double(k);
+      }
+      ws->dataY(j).assign(nBins, double(j));
+      ws->dataE(j).assign(nBins, sqrt(double(j)));
+      ws->dataDx(j).assign(nBins + 1, sqrt(double(j)));
+    }
+    return ws;
+  }
+
+  void runTestWithDx(std::string fileName, const size_t nSpec) {
+     // Arrange
+    auto ws = createWorkspaceWithDxValues(nSpec);
+
+    // Act
+    SaveCSV saveCSV;
+    TS_ASSERT_THROWS_NOTHING(saveCSV.initialize());
+    TS_ASSERT(saveCSV.isInitialized());
+    saveCSV.setProperty("InputWorkspace", ws);
+    saveCSV.setProperty("SaveXerrors", true);
+    saveCSV.setPropertyValue("Filename", fileName);
+    fileName = saveCSV.getPropertyValue("Filename");
+
+    TS_ASSERT_THROWS_NOTHING(saveCSV.execute());
+    TS_ASSERT(saveCSV.isExecuted() );  
+
+    // Assert
+    TS_ASSERT( Poco::File(fileName).exists() );
+    evaluateFileWithDX(fileName, nSpec);
+
+    // Clean up
+    Poco::File(fileName).remove();
+  }
+
+  void evaluateFileWithDX(std::string fileName, const size_t nSpec) const {
+    std::ifstream stream(fileName.c_str());
+    std::istringstream dataStream;
+    std::string line;
+
+    std::string stringMarker;
+    double indexMarker;
+    double d1, d2, d3, dEnd; // There are 3 bins
+    std::string separator;
+
+    // Evalute the first line. We are expecting only one line for the Xvalues here.
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator >> dEnd >> separator;
+
+    TS_ASSERT_EQUALS(stringMarker,"A" );
+    TS_ASSERT_EQUALS(separator,"," );
+    TS_ASSERT_DELTA(d1, 0.0, 1e-5);
+    TS_ASSERT_DELTA(d2, 1.0, 1e-5);
+    TS_ASSERT_DELTA(d3, 2.0, 1e-5);
+    TS_ASSERT_DELTA(dEnd, 3.0, 1e-5);
+
+    // Now evaluate the Y value entries which follow directly after
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator;
+      TS_ASSERT_EQUALS(indexMarker, double(spec));
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, double(spec), 1e-5);
+      TS_ASSERT_DELTA(d2, double(spec), 1e-5);
+      TS_ASSERT_DELTA(d3, double(spec), 1e-5);
+    }
+
+    // We expect an empty line here
+    getline(stream, line);
+
+    // Check the ERROR identifier
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker;
+    TS_ASSERT_EQUALS(stringMarker,"ERRORS" );
+
+    // Check the y errors
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator;
+      TS_ASSERT_EQUALS(indexMarker, spec);
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d2, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d3, sqrt(double(spec)), 1e-5);
+    }
+
+    // We expect an empty line here
+    getline(stream, line);
+
+    // Check the XERROR identifier
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker;
+    TS_ASSERT_EQUALS(stringMarker,"XERRORS" );
+
+    // Check the x errors
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator >> dEnd >> separator;
+      TS_ASSERT_EQUALS(indexMarker, spec);
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d2, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d3, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(dEnd, sqrt(double(spec)), 1e-5);
+    }
+    stream.close();
+  }
 };
   
 #endif /*SAVECSVTEST_H_*/
diff --git a/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h b/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
index 75a0ee1b7c4bd483b8943194ada32344e80d6669..3b943100d9ce28ee3bb935223065c0b59abcfddc 100644
--- a/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
@@ -7,12 +7,19 @@
 
 #include <fstream>
 #include <Poco/File.h>
+using namespace Mantid::API;
+
+namespace {
+  const size_t nSpec = 1;
+  const size_t nBins = 10;
+}
+
 
 class SaveRKHTest : public CxxTest::TestSuite
 {
 public:
 
-    static SaveRKHTest *createSuite() { return new SaveRKHTest(); }
+  static SaveRKHTest *createSuite() { return new SaveRKHTest(); }
   static void destroySuite(SaveRKHTest *suite) { delete suite; }
   ///Constructor
   SaveRKHTest() : outputFile("SAVERKH.out")
@@ -34,7 +41,6 @@ public:
  
     TS_ASSERT_THROWS_NOTHING(testAlgorithm2.initialize());
     TS_ASSERT_EQUALS(testAlgorithm2.isInitialized(), true);
- 
   }
 
   void testExecHorizontal()
@@ -43,9 +49,7 @@ public:
     
     //No parameters have been set yet, so it should throw
     TS_ASSERT_THROWS(testAlgorithm1.execute(), std::runtime_error);
-    
     //Need a test workspace to use as input
-    using namespace Mantid::API;
     MatrixWorkspace_sptr inputWS1 = WorkspaceCreationHelper::Create2DWorkspaceBinned(1, 10, 1.0);
     inputWS1->isDistribution(true);
 
@@ -177,12 +181,107 @@ public:
     file2.close();
   }
 
+  void testExecWithDx() {
+
+    if ( !testAlgorithm3.isInitialized() ) testAlgorithm3.initialize();
+
+    //No parameters have been set yet, so it should throw
+    TS_ASSERT_THROWS(testAlgorithm3.execute(), std::runtime_error);
+    //Need a test workspace to use as input
+    auto inputWS3 = createInputWorkspaceHistoWithXerror();
+    inputWS3->isDistribution(false);
+
+    //Register workspace
+    AnalysisDataService::Instance().add("testInputThree", inputWS3);
+
+    testAlgorithm3.setPropertyValue("InputWorkspace", "testInputThree");
+    testAlgorithm3.setPropertyValue("Filename", outputFile);
+    outputFile = testAlgorithm3.getPropertyValue("Filename"); //get absolute path
+    testAlgorithm3.setProperty<bool>("Append", false);
+
+    //Execute the algorithm
+    TS_ASSERT_THROWS_NOTHING( testAlgorithm3.execute() );
+    TS_ASSERT( testAlgorithm3.isExecuted() );
+
+    //Check if the file exists
+    TS_ASSERT( Poco::File(outputFile).exists() );
+
+    //Open it and check a few lines
+    std::ifstream file(outputFile.c_str());
+
+    TS_ASSERT(file);
+
+    //Bury the first 5 lines and then read the next
+    int count(0);
+    std::string fileline;
+    while( ++count < 7 )
+    {
+      getline(file, fileline);
+    }
+    std::istringstream strReader(fileline);
+    double x(0.0), y(0.0), err(0.0), dx(0.0);
+    strReader >> x >> y >> err >> dx;
+
+    //Test values
+    TSM_ASSERT_DELTA("Expecting mean of 0 and 1", x, 0.5, 1e-08);  
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1", y, 1.0, 1e-08);
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1",err, 1.0, 1e-06);
+    TSM_ASSERT_DELTA("Expecting mean of sqrt(0) and sqrt(1)",dx, 0.5, 1e-06);
+
+    //We are at the first data entry now. We step over
+    // Three more entries
+    count = 0;
+    while( ++count < 4)
+    {
+      getline(file, fileline);
+    }
+
+    x = 0.0;
+    y = 0.0;
+    err = 0.0;
+    dx = 0.0;
+    strReader.clear();
+    strReader.str(fileline.c_str());
+    strReader >> x >> y >> err >> dx;
+
+    //Test values
+    TSM_ASSERT_DELTA("Expecting mean of 3 and 4", x, 3.5, 1e-08);  
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1", y, 1.0, 1e-08);
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1",err, 1.0, 1e-06);
+    TSM_ASSERT_DELTA("Expecting mean of sqrt(3) and sqrt(4)",dx, (sqrt(3) + sqrt(4))/2, 1e-06);
+
+    file.close();
+  }
+
 private:
   ///The algorithm object
-  Mantid::DataHandling::SaveRKH testAlgorithm1, testAlgorithm2;
+  Mantid::DataHandling::SaveRKH testAlgorithm1, testAlgorithm2, testAlgorithm3;
 
   ///The name of the file to use as output
   std::string outputFile;
+
+  /// Provides a workpace with a x error value
+  MatrixWorkspace_sptr createInputWorkspaceHistoWithXerror(std::string type = "histo") const
+  {
+    size_t x_length = 0;
+    size_t y_length = nBins;
+    if (type == "histo") {
+      x_length = nBins + 1;
+    } else  {
+      x_length = nBins;
+    }
+    // Set up a small workspace for testing
+    MatrixWorkspace_sptr ws = WorkspaceFactory::Instance().create("Workspace2D", nSpec, x_length, y_length);
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k < x_length; ++k) {
+        ws->dataX(j)[k] = double(k);
+        ws->dataDx(j)[k] = sqrt(double(k));
+      }
+      ws->dataY(j).assign(y_length, double(1));
+      ws->dataE(j).assign(y_length, double(1));
+    }
+    return ws;
+  }
 };
 
 #endif  //SAVERKHTEST_H_
diff --git a/Code/Mantid/Framework/DataObjects/test/MDHistoWorkspaceTest.h b/Code/Mantid/Framework/DataObjects/test/MDHistoWorkspaceTest.h
index 6cd73109c4afca048a148c2fd8ccb174f1ef71a8..32df9050aac51bd29d85c8a4959d339d2f2ea955 100644
--- a/Code/Mantid/Framework/DataObjects/test/MDHistoWorkspaceTest.h
+++ b/Code/Mantid/Framework/DataObjects/test/MDHistoWorkspaceTest.h
@@ -393,6 +393,7 @@ public:
       "<Dimension ID=\"x\">" +
       "<Name>X</Name>" + 
       "<Units>m</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>10.0000</UpperBounds>" + 
       "<LowerBounds>-10.0000</LowerBounds>" + 
       "<NumberOfBins>5</NumberOfBins>" + 
@@ -400,6 +401,7 @@ public:
       "<Dimension ID=\"y\">" +
       "<Name>Y</Name>" + 
       "<Units>m</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>10.0000</UpperBounds>" + 
       "<LowerBounds>-10.0000</LowerBounds>" + 
       "<NumberOfBins>5</NumberOfBins>" + 
@@ -407,6 +409,7 @@ public:
       "<Dimension ID=\"z\">" +
       "<Name>Z</Name>" + 
       "<Units>m</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>10.0000</UpperBounds>" + 
       "<LowerBounds>-10.0000</LowerBounds>" + 
       "<NumberOfBins>5</NumberOfBins>" + 
@@ -414,6 +417,7 @@ public:
       "<Dimension ID=\"t\">" +
       "<Name>T</Name>" + 
       "<Units>m</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>10.0000</UpperBounds>" + 
       "<LowerBounds>-10.0000</LowerBounds>" + 
       "<NumberOfBins>5</NumberOfBins>" + 
diff --git a/Code/Mantid/Framework/Geometry/CMakeLists.txt b/Code/Mantid/Framework/Geometry/CMakeLists.txt
index 0bca7423c7c11d0d6d6e1986806be1da97953fb5..646e3bced034b83281e18bce2229a66fe900c136 100644
--- a/Code/Mantid/Framework/Geometry/CMakeLists.txt
+++ b/Code/Mantid/Framework/Geometry/CMakeLists.txt
@@ -1,4 +1,5 @@
 set ( SRC_FILES
+	${SRC_FILES} ${OPENCASCADE_SRC}
 	src/ComponentParser.cpp
 	src/Crystal/BraggScatterer.cpp
 	src/Crystal/BraggScattererFactory.cpp
@@ -57,9 +58,12 @@ set ( SRC_FILES
 	src/Instrument/ReferenceFrame.cpp
 	src/Instrument/XMLInstrumentParameter.cpp
 	src/MDGeometry/CompositeImplicitFunction.cpp
+	src/MDGeometry/GeneralFrame.cpp
+	src/MDGeometry/HKL.cpp
 	src/MDGeometry/IMDDimension.cpp
 	src/MDGeometry/IMDDimensionFactory.cpp
 	src/MDGeometry/MDBoxImplicitFunction.cpp
+	src/MDGeometry/MDFrameFactory.cpp
 	src/MDGeometry/MDGeometryXMLBuilder.cpp
 	src/MDGeometry/MDGeometryXMLParser.cpp
 	src/MDGeometry/MDHistoDimension.cpp
@@ -68,6 +72,8 @@ set ( SRC_FILES
 	src/MDGeometry/MDPlane.cpp
 	src/MDGeometry/MDPlaneImplicitFunction.cpp
 	src/MDGeometry/NullImplicitFunction.cpp
+	src/MDGeometry/QLab.cpp
+	src/MDGeometry/QSample.cpp
 	src/Math/Acomp.cpp
 	src/Math/Algebra.cpp
 	src/Math/BnId.cpp
@@ -190,10 +196,14 @@ set ( INC_FILES
 	inc/MantidGeometry/Instrument/ReferenceFrame.h
 	inc/MantidGeometry/Instrument/XMLInstrumentParameter.h
 	inc/MantidGeometry/MDGeometry/CompositeImplicitFunction.h
+	inc/MantidGeometry/MDGeometry/GeneralFrame.h
+	inc/MantidGeometry/MDGeometry/HKL.h
 	inc/MantidGeometry/MDGeometry/IMDDimension.h
 	inc/MantidGeometry/MDGeometry/IMDDimensionFactory.h
 	inc/MantidGeometry/MDGeometry/MDBoxImplicitFunction.h
 	inc/MantidGeometry/MDGeometry/MDDimensionExtents.h
+	inc/MantidGeometry/MDGeometry/MDFrame.h
+	inc/MantidGeometry/MDGeometry/MDFrameFactory.h
 	inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h
 	inc/MantidGeometry/MDGeometry/MDGeometryXMLDefinitions.h
 	inc/MantidGeometry/MDGeometry/MDGeometryXMLParser.h
@@ -205,6 +215,8 @@ set ( INC_FILES
 	inc/MantidGeometry/MDGeometry/MDTypes.h
 	inc/MantidGeometry/MDGeometry/MDWorkspaceConstants.h
 	inc/MantidGeometry/MDGeometry/NullImplicitFunction.h
+	inc/MantidGeometry/MDGeometry/QLab.h
+	inc/MantidGeometry/MDGeometry/QSample.h
 	inc/MantidGeometry/Math/Acomp.h
 	inc/MantidGeometry/Math/Algebra.h
 	inc/MantidGeometry/Math/BnId.h
@@ -256,17 +268,19 @@ set ( TEST_FILES
 	CompositeImplicitFunctionTest.h
 	ConeTest.h
 	ConventionalCellTest.h
-	ConvexPolygonTest.h
 	ConvexPolygonIteratorTest.h
+	ConvexPolygonTest.h
 	CrystalStructureTest.h
 	CyclicGroupTest.h
 	CylinderTest.h
 	DetectorGroupTest.h
 	DetectorTest.h
 	FitParameterTest.h
+	GeneralFrameTest.h
 	GeneralTest.h
 	GoniometerTest.h
 	GroupTest.h
+	HKLTest.h
 	IDFObjectTest.h
 	IMDDimensionFactoryTest.h
 	IMDDimensionTest.h
@@ -278,6 +292,7 @@ set ( TEST_FILES
 	LineIntersectVisitTest.h
 	LineTest.h
 	MDBoxImplicitFunctionTest.h
+	MDFrameFactoryTest.h
 	MDGeometryXMLParserTest.h
 	MDHistoDimensionBuilderTest.h
 	MDHistoDimensionTest.h
@@ -312,6 +327,8 @@ set ( TEST_FILES
 	PolygonEdgeTest.h
 	PolygonIntersectionTest.h
 	ProductOfCyclicGroupsTest.h
+	QLabTest.h
+	QSampleTest.h
 	QuadrilateralTest.h
 	RectangularDetectorPixelTest.h
 	RectangularDetectorTest.h
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/GeneralFrame.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/GeneralFrame.h
new file mode 100644
index 0000000000000000000000000000000000000000..26fed4c8d6fce989edcd6db06032e74761bc751d
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/GeneralFrame.h
@@ -0,0 +1,55 @@
+#ifndef MANTID_GEOMETRY_GENERALFRAME_H_
+#define MANTID_GEOMETRY_GENERALFRAME_H_
+
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/UnitLabel.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/** GeneralFrame : Any MDFrame that isn't related to momemtum transfer
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class DLLExport GeneralFrame : public MDFrame {
+public:
+  GeneralFrame(const std::string& frameName, const Kernel::UnitLabel& unit);
+  GeneralFrame(const std::string& frameName, std::unique_ptr<Mantid::Kernel::MDUnit> unit);
+  virtual ~GeneralFrame();
+  Kernel::UnitLabel getUnitLabel() const;
+  const Kernel::MDUnit &getMDUnit() const;
+  bool canConvertTo(const Kernel::MDUnit &otherUnit) const;
+  std::string name() const;
+  virtual GeneralFrame* clone() const;
+private:
+  /// Label unit
+  const std::unique_ptr<Mantid::Kernel::MDUnit> m_unit;
+  /// Frame name
+  const std::string m_frameName;
+};
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_GENERALFRAME_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/HKL.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/HKL.h
new file mode 100644
index 0000000000000000000000000000000000000000..303c0576f03d8396c672c59938eba047e1feb9be
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/HKL.h
@@ -0,0 +1,61 @@
+#ifndef MANTID_GEOMETRY_HKL_H_
+#define MANTID_GEOMETRY_HKL_H_
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/UnitLabel.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/DllConfig.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/** HKL : HKL MDFrame
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_GEOMETRY_DLL HKL : public MDFrame {
+public:
+  HKL(const HKL& other);
+  HKL& operator=(const HKL& other);
+  HKL(std::unique_ptr<Kernel::MDUnit>& unit);
+  HKL(Kernel::MDUnit* unit);
+  virtual ~HKL();
+  static const std::string HKLName;
+
+  // MDFrame interface
+  Kernel::UnitLabel getUnitLabel() const;
+  const Kernel::MDUnit& getMDUnit() const;
+  bool canConvertTo(const Kernel::MDUnit &otherUnit) const;
+  std::string name() const;
+  HKL* clone() const;
+
+private:
+
+  std::unique_ptr<Kernel::MDUnit> m_unit;
+};
+
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_HKL_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h
index fdee1b82db7950a6d7d5f1c5d2cdfed3ff170dea..6d5389fe559e9ac41b1ca258fa8d3c024e19a110 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h
@@ -3,6 +3,8 @@
 
 #include "MantidGeometry/DllConfig.h"
 #include "MantidGeometry/MDGeometry/MDTypes.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidKernel/MDUnit.h"
 #include "MantidKernel/V3D.h"
 #ifndef Q_MOC_RUN
 #include <boost/shared_ptr.hpp>
@@ -58,9 +60,15 @@ public:
   /// @return the name of the dimension as can be displayed along the axis
   virtual std::string getName() const = 0;
 
+  /// @return the MDFrame
+  virtual const Geometry::MDFrame& getMDFrame() const = 0;
+
   /// @return the units of the dimension as a string
   virtual const Kernel::UnitLabel getUnits() const = 0;
 
+  /// @return the mdunits of the dimension
+  virtual const Kernel::MDUnit& getMDUnits() const = 0;
+
   /// short name which identify the dimension among other dimension. A dimension
   /// can be usually find by its ID and various
   /// various method exist to manipulate set of dimensions by their names.
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrame.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrame.h
new file mode 100644
index 0000000000000000000000000000000000000000..058f5c82dffc2fe8be3c50e5499d59200f14e6ef
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrame.h
@@ -0,0 +1,53 @@
+#ifndef MANTID_GEOMETRY_MDFRAME_H_
+#define MANTID_GEOMETRY_MDFRAME_H_
+
+#include "MantidKernel/System.h"
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabel.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/** MDFrame : The coordinate frame for a dimension, or set of dimensions in a multidimensional workspace.
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class DLLExport MDFrame {
+public:
+    virtual Mantid::Kernel::UnitLabel getUnitLabel() const = 0;
+    virtual const Mantid::Kernel::MDUnit& getMDUnit() const = 0;
+    virtual bool canConvertTo(const Mantid::Kernel::MDUnit& otherUnit) const = 0;
+    virtual std::string name() const = 0;
+    virtual MDFrame* clone() const = 0;
+    virtual ~MDFrame(){}
+};
+
+typedef std::unique_ptr<MDFrame> MDFrame_uptr;
+typedef std::unique_ptr<const MDFrame> MDFrame_const_uptr;
+
+
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_MDFRAME_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrameFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrameFactory.h
new file mode 100644
index 0000000000000000000000000000000000000000..3e84b845ec976857d52720d6055072285bee1579
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDFrameFactory.h
@@ -0,0 +1,105 @@
+#ifndef MANTID_GEOMETRY_MDFRAMEFACTORY_H_
+#define MANTID_GEOMETRY_MDFRAMEFACTORY_H_
+
+#include "MantidKernel/ChainableFactory.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+#include "MantidGeometry/MDGeometry/QLab.h"
+#include "MantidGeometry/MDGeometry/QSample.h"
+#include "MantidGeometry/MDGeometry/HKL.h"
+#include "MantidGeometry/DllConfig.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/// Input argument type for MDFrameFactory chainable factory
+class MANTID_GEOMETRY_DLL MDFrameArgument{
+public:
+    const std::string unitString;
+    const std::string frameString;
+    MDFrameArgument(const std::string& _frameString, const std::string& _unitString) :
+        unitString(_unitString), frameString(_frameString){}
+    MDFrameArgument(const std::string& _frameString) :
+        unitString(""), frameString(_frameString){}
+
+};
+
+/** MDFrameFactory.h : Chain of repsonsibility factory for the MDFrameFactory
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_GEOMETRY_DLL MDFrameFactory
+    : public Kernel::ChainableFactory<MDFrameFactory, MDFrame, MDFrameArgument> {
+public:
+  virtual ~MDFrameFactory(){}
+};
+
+/// Helper typedef
+typedef std::unique_ptr<MDFrameFactory> MDFrameFactory_uptr;
+
+//-----------------------------------------------------------------------
+// Derived MDFrameFactory declarations
+//-----------------------------------------------------------------------
+
+/// GeneralFrameFactory derived MDFrameFactory type
+class MANTID_GEOMETRY_DLL GeneralFrameFactory : public MDFrameFactory {
+private:
+  GeneralFrame* createRaw(const MDFrameArgument &argument) const;
+public:
+  bool canInterpret(const MDFrameArgument &) const;
+};
+
+/// QLabFrameFactory derived MDFrameFactory type
+class MANTID_GEOMETRY_DLL QLabFrameFactory : public MDFrameFactory {
+  private:
+    QLab*   createRaw(const MDFrameArgument& argument) const;
+  public:
+    bool canInterpret(const MDFrameArgument& argument) const;
+};
+
+/// QSampleFrameFactory derived MDFrameFactory type
+class MANTID_GEOMETRY_DLL QSampleFrameFactory : public MDFrameFactory {
+  private:
+    QSample*   createRaw(const MDFrameArgument& argument) const;
+  public:
+    bool canInterpret(const MDFrameArgument& argument) const;
+};
+
+/// HKLFrame derived MDFrameFactory type
+class MANTID_GEOMETRY_DLL HKLFrameFactory : public MDFrameFactory {
+  private:
+    HKL*   createRaw(const MDFrameArgument& argument) const;
+  public:
+    bool canInterpret(const MDFrameArgument& argument) const;
+};
+
+
+
+
+/// Make a complete factory chain
+MDFrameFactory_uptr MANTID_GEOMETRY_DLL makeMDFrameFactoryChain();
+
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_MDFRAMEFACTORY_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
index bc36092c6e3118b6cecac1229f200dc6eb998acf..af79e14d51e994a144bd7146cbd0fedf4fa99e05 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
@@ -4,7 +4,10 @@
 #include "MantidGeometry/DllConfig.h"
 #include "MantidKernel/Exception.h"
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
-#include "MantidKernel/UnitLabel.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/MDUnitFactory.h"
 #include "MantidKernel/VMD.h"
 
 namespace Mantid {
@@ -31,7 +34,27 @@ public:
   MDHistoDimension(std::string name, std::string ID,
                    const Kernel::UnitLabel &units, coord_t min, coord_t max,
                    size_t numBins)
-      : m_name(name), m_dimensionId(ID), m_units(units), m_min(min), m_max(max),
+      : m_name(name), m_dimensionId(ID), m_frame(new GeneralFrame("Unknown frame", units)), m_min(min), m_max(max),
+        m_numBins(numBins),
+        m_binWidth((max - min) / static_cast<coord_t>(numBins)) {
+    if (max < min) {
+      throw std::invalid_argument("Error making MDHistoDimension. Cannot have "
+                                  "dimension with min > max");
+    }
+  }
+
+  /** Constructor for simple MDHistoDimension
+  * @param name :: full name of the axis
+  * @param ID :: identifier string
+  * @param frame :: MDFrame
+  * @param min :: minimum extent
+  * @param max :: maximum extent
+  * @param numBins :: number of bins (evenly spaced)
+  */
+  MDHistoDimension(std::string name, std::string ID,
+                   const MDFrame &frame, coord_t min, coord_t max,
+                   size_t numBins)
+      : m_name(name), m_dimensionId(ID), m_frame(frame.clone()), m_min(min), m_max(max),
         m_numBins(numBins),
         m_binWidth((max - min) / static_cast<coord_t>(numBins)) {
     if (max < min) {
@@ -45,7 +68,7 @@ public:
    */
   MDHistoDimension(const IMDDimension *other)
       : m_name(other->getName()), m_dimensionId(other->getDimensionId()),
-        m_units(other->getUnits()), m_min(other->getMinimum()),
+        m_frame(other->getMDFrame().clone()), m_min(other->getMinimum()),
         m_max(other->getMaximum()), m_numBins(other->getNBins()),
         m_binWidth(other->getBinWidth()) {}
 
@@ -55,8 +78,14 @@ public:
   /// Return the name of the dimension as can be displayed along the axis
   virtual std::string getName() const { return m_name; }
 
+  /// Return the md frame
+  const MDFrame &getMDFrame() const {return *m_frame;}
+
   /// Return the units of the dimension as a string
-  virtual const Kernel::UnitLabel getUnits() const { return m_units; }
+  virtual const Kernel::UnitLabel getUnits() const { return m_frame->getUnitLabel(); }
+
+  /// Returns the unit
+  virtual const Kernel::MDUnit& getMDUnits() const {return m_frame->getMDUnit();}
 
   /** Short name which identify the dimension among other dimension.
    * A dimension can be usually found by its ID and various
@@ -108,8 +137,8 @@ private:
   /// ID string
   std::string m_dimensionId;
 
-  /// Dimension units
-  Kernel::UnitLabel m_units;
+  /// Multidimensional frame
+  Geometry::MDFrame_uptr m_frame;
 
   /// Extent of dimension
   coord_t m_min;
@@ -122,6 +151,7 @@ private:
 
   /// Calculated bin size
   coord_t m_binWidth;
+
 };
 
 /// Shared pointer to a MDHistoDimension
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
index 34b1d55a18611a85fddd4ce341c5857c4c27076e..4d778d5d434bd630b17b53fb585d7b281ad49a17 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
@@ -2,6 +2,7 @@
 #define MANTID_GEOMETRY_MDHISTODIMENSION_BUILDER_H_
 
 #include "MantidGeometry/MDGeometry/MDHistoDimension.h"
+#include "MantidKernel/UnitLabel.h"
 
 namespace Mantid {
 namespace Geometry {
@@ -23,7 +24,7 @@ public:
   ~MDHistoDimensionBuilder();
   void setName(std::string name);
   void setId(std::string id);
-  void setUnits(std::string units);
+  void setUnits(const Kernel::UnitLabel& units);
   void setMin(double min);
   void setMax(double max);
   void setNumBins(size_t nbins);
@@ -40,7 +41,7 @@ private:
   /// Cached id
   std::string m_id;
   /// Cached units
-  std::string m_units;
+  Kernel::UnitLabel m_units;
   /// Cached min
   double m_min;
   /// Cached max
@@ -58,4 +59,4 @@ typedef std::vector<MDHistoDimensionBuilder> Vec_MDHistoDimensionBuilder;
 }
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QLab.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QLab.h
new file mode 100644
index 0000000000000000000000000000000000000000..51cdec31305e85edfdd853f1cb01540a7163c121
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QLab.h
@@ -0,0 +1,61 @@
+#ifndef MANTID_GEOMETRY_QLAB_H_
+#define MANTID_GEOMETRY_QLAB_H_
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/UnitLabel.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/DllConfig.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/** QLab : Q in the lab frame MDFrame.
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_GEOMETRY_DLL QLab : public MDFrame{
+public:
+
+  QLab();
+  virtual ~QLab();
+  Mantid::Kernel::UnitLabel getUnitLabel() const;
+  const Mantid::Kernel::MDUnit& getMDUnit() const;
+  bool canConvertTo(const Mantid::Kernel::MDUnit& otherUnit) const;
+  virtual std::string name() const;
+  QLab *clone() const;
+
+  // Type name
+  static const std::string QLabName;
+
+private:
+
+  /// Fixed to be inverse angstroms
+  const std::unique_ptr<const Mantid::Kernel::MDUnit> m_unit;
+
+};
+
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_QLAB_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QSample.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QSample.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b55d82d2262f8bdd24489fa86e9fb593dfa5bd9
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/QSample.h
@@ -0,0 +1,56 @@
+#ifndef MANTID_GEOMETRY_QSAMPLE_H_
+#define MANTID_GEOMETRY_QSAMPLE_H_
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/UnitLabel.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/DllConfig.h"
+#include <memory>
+
+namespace Mantid {
+namespace Geometry {
+
+/** QSample : Q in the sample frame
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_GEOMETRY_DLL QSample : public MDFrame {
+public:
+  static const std::string QSampleName;
+  QSample();
+  virtual ~QSample();
+  Kernel::UnitLabel getUnitLabel() const;
+  const Kernel::MDUnit &getMDUnit() const;
+  bool canConvertTo(const Kernel::MDUnit &otherUnit) const;
+  std::string name() const;
+  QSample* clone() const;
+private:
+  /// immutable unit for qlab.
+  const std::unique_ptr<const Mantid::Kernel::InverseAngstromsUnit> m_unit;
+
+};
+
+} // namespace Geometry
+} // namespace Mantid
+
+#endif /* MANTID_GEOMETRY_QSAMPLE_H_ */
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/GeneralFrame.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/GeneralFrame.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..93cd118a87b07f61d5a5cc3ecbbee4614ec06f28
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/GeneralFrame.cpp
@@ -0,0 +1,39 @@
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+
+namespace Mantid {
+namespace Geometry {
+
+GeneralFrame::GeneralFrame(const std::string &frameName,
+                           std::unique_ptr<Kernel::MDUnit> unit)
+    : m_unit(unit.release()), m_frameName(frameName) {}
+
+GeneralFrame::GeneralFrame(const std::string& frameName, const Kernel::UnitLabel& unit):
+    m_unit(new Mantid::Kernel::LabelUnit(unit)), m_frameName(frameName) {}
+
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+GeneralFrame::~GeneralFrame() {}
+
+Kernel::UnitLabel GeneralFrame::getUnitLabel() const {
+  return m_unit->getUnitLabel();
+}
+
+const Kernel::MDUnit &GeneralFrame::getMDUnit() const {
+  return *m_unit;
+}
+
+bool GeneralFrame::canConvertTo(const Kernel::MDUnit &otherUnit) const {
+  return *this->m_unit == otherUnit;
+}
+
+std::string GeneralFrame::name() const { return m_frameName; }
+
+GeneralFrame *GeneralFrame::clone() const
+{
+    return new GeneralFrame(m_frameName, std::unique_ptr<Kernel::MDUnit>(m_unit->clone()));
+}
+
+} // namespace Geometry
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/HKL.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/HKL.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e6a89df25bf06bc01282b99453a5b0b9dc8c524f
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/HKL.cpp
@@ -0,0 +1,85 @@
+#include "MantidGeometry/MDGeometry/HKL.h"
+#include <stdexcept>
+
+namespace {
+
+void checkUnitCompatibility(Mantid::Kernel::MDUnit const * const unit){
+    if(!unit->isQUnit()){
+        throw std::invalid_argument("HKL unit must be a QUnit");
+    }
+}
+
+}
+
+namespace Mantid {
+namespace Geometry {
+
+const std::string HKL::HKLName = "HKL";
+
+/**
+ * Constructor
+ * @param unit : Unit to use
+ */
+HKL::HKL(std::unique_ptr<Kernel::MDUnit>& unit){
+    checkUnitCompatibility(unit.get());
+    // Only change ownership once we are happy. Gives exception safety for input unit.
+    m_unit.swap(unit);
+}
+
+/**
+ * Constructor
+ * @param unit : Unit to use
+ */
+HKL::HKL(Kernel::MDUnit* unit) : m_unit(unit){
+    checkUnitCompatibility(unit);
+}
+
+/**
+ * Assignment
+ * @param other : Other unit
+ * @return assigned unit.
+ */
+HKL::HKL(const HKL &other) : m_unit(other.getMDUnit().clone())
+{
+
+}
+
+HKL& HKL::operator=(const HKL& other){
+    if(this == &other){
+        this->m_unit = std::unique_ptr<Mantid::Kernel::MDUnit>(other.getMDUnit().clone());
+    }
+    return *this;
+}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+HKL::~HKL() {}
+
+Kernel::UnitLabel HKL::getUnitLabel() const
+{
+    return m_unit->getUnitLabel();
+}
+
+const Kernel::MDUnit& HKL::getMDUnit() const
+{
+    return *m_unit;
+}
+
+bool HKL::canConvertTo(const Kernel::MDUnit &otherUnit) const
+{
+    return this->m_unit->canConvertTo(otherUnit);
+}
+
+std::string HKL::name() const
+{
+    return HKLName;
+}
+
+HKL *HKL::clone() const
+{
+    return new HKL(m_unit->clone());
+}
+
+} // namespace Geometry
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/IMDDimensionFactory.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/IMDDimensionFactory.cpp
index 0078de4147c65e7a914ee6183b4ed7426c8c22f6..b6b09c63642cc56eb05fc90151054f00996769ce 100644
--- a/Code/Mantid/Framework/Geometry/src/MDGeometry/IMDDimensionFactory.cpp
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/IMDDimensionFactory.cpp
@@ -1,5 +1,6 @@
 #include "MantidGeometry/MDGeometry/MDHistoDimension.h"
 #include "MantidGeometry/MDGeometry/IMDDimensionFactory.h"
+#include "MantidGeometry/MDGeometry/MDFrameFactory.h"
 
 #include <boost/make_shared.hpp>
 #include <Poco/AutoPtr.h>
@@ -59,6 +60,13 @@ IMDDimension_sptr createDimension(const Poco::XML::Element &dimensionXML) {
     units = unitsElement->innerText();
   }
 
+  Poco::XML::Element *frameElement = dimensionXML.getChildElement("Frame");
+  std::string frame = "Unknown frame";
+  if(NULL != frameElement){
+     // Set the frame if it exists
+    frame = frameElement->innerText();
+  }
+
   Poco::XML::Element *upperBoundsElement =
       dimensionXML.getChildElement("UpperBounds");
   if (NULL == upperBoundsElement) {
@@ -112,8 +120,12 @@ IMDDimension_sptr createDimension(const Poco::XML::Element &dimensionXML) {
     lowerBounds = lowerLimit;
   }
 
+  // Select the unit.
+  MDFrame_const_uptr mdframe = makeMDFrameFactoryChain()->create(MDFrameArgument(frame, units));
+
+
   return boost::make_shared<MDHistoDimension>(
-      name, id, units, static_cast<coord_t>(lowerBounds),
+      name, id, *mdframe, static_cast<coord_t>(lowerBounds),
       static_cast<coord_t>(upperBounds), nBins);
 }
 
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..63b2bedb51db5319191b575d543fa81d087fee92
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDFrameFactory.cpp
@@ -0,0 +1,75 @@
+#include "MantidGeometry/MDGeometry/MDFrameFactory.h"
+#include "MantidKernel/MDUnitFactory.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabelTypes.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+
+namespace Mantid {
+namespace Geometry {
+
+GeneralFrame *
+GeneralFrameFactory::createRaw(const MDFrameArgument &argument) const {
+  using namespace Mantid::Kernel;
+
+  // Try to generate a proper md unit, don't just assume a label unit.
+  auto unitFactoryChain = Kernel::makeMDUnitFactoryChain();
+  auto mdUnit = unitFactoryChain->create(argument.unitString);
+
+  return new GeneralFrame(argument.frameString, MDUnit_uptr(mdUnit->clone()));
+}
+
+/// Indicate an ability to intepret the string
+bool GeneralFrameFactory::canInterpret(const MDFrameArgument &) const {
+  return true; // This can interpret everything
+}
+
+QLab *QLabFrameFactory::createRaw(const MDFrameArgument &) const {
+  return new QLab;
+}
+
+bool QLabFrameFactory::canInterpret(const MDFrameArgument &argument) const {
+  // We only need to check the frame QLab only makes sense in inverse Angstroms
+  return argument.frameString == QLab::QLabName;
+}
+
+QSample *QSampleFrameFactory::createRaw(const MDFrameArgument &) const {
+  return new QSample;
+}
+
+bool QSampleFrameFactory::canInterpret(const MDFrameArgument &argument) const {
+  // We only need to check the frame QSample only makes sense in inverse
+  // Angstroms
+  return argument.frameString == QSample::QSampleName;
+}
+
+HKL *HKLFrameFactory::createRaw(const MDFrameArgument &argument) const {
+  using namespace Mantid::Kernel;
+  auto unitFactoryChain = Kernel::makeMDUnitFactoryChain();
+  auto productMDUnit = unitFactoryChain->create(argument.unitString);
+  return new HKL(productMDUnit);
+}
+
+bool HKLFrameFactory::canInterpret(const MDFrameArgument &argument) const {
+  using namespace Mantid::Kernel;
+  auto unitFactoryChain = Kernel::makeMDUnitFactoryChain();
+  auto mdUnit = unitFactoryChain->create(argument.unitString);
+  // We expect units to be RLU or A^-1
+  const bool compatibleUnit =
+      (mdUnit->getUnitLabel() == Units::Symbol::InverseAngstrom ||
+       mdUnit->getUnitLabel() == Units::Symbol::RLU);
+  // Check both the frame name and the unit name
+  return argument.frameString == HKL::HKLName && compatibleUnit;
+}
+
+MDFrameFactory_uptr makeMDFrameFactoryChain() {
+  typedef MDFrameFactory_uptr FactoryType;
+  auto first = FactoryType(new QLabFrameFactory);
+  first->setSuccessor(FactoryType(new QSampleFrameFactory))
+      .setSuccessor(FactoryType(new HKLFrameFactory))
+      // Make sure that GeneralFrameFactory is the last in the chain to give a fall-through option 
+      .setSuccessor(FactoryType(new GeneralFrameFactory));
+  return first;
+}
+
+} // namespace Geometry
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimension.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimension.cpp
index 0ab461406c9e537b171024b457a3a615d4c4774c..c21f5d0d1ec85fa0cb76a712841e43a1c1037b32 100644
--- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimension.cpp
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimension.cpp
@@ -39,6 +39,12 @@ std::string MDHistoDimension::toXMLString() const {
   unitsElement->appendChild(unitsText);
   pDimensionElement->appendChild(unitsElement);
 
+  // Set the frame.
+  AutoPtr<Element> frameElement = pDoc->createElement("Frame");
+  AutoPtr<Text> frameText = pDoc->createTextNode(this->getMDFrame().name());
+  frameElement->appendChild(frameText);
+  pDimensionElement->appendChild(frameElement);
+
   // Set the upper bounds
   AutoPtr<Element> upperBoundsElement = pDoc->createElement("UpperBounds");
   AutoPtr<Text> upperBoundsText = pDoc->createTextNode(
@@ -92,4 +98,4 @@ std::string MDHistoDimension::toXMLString() const {
   return xmlstream.str().c_str();
 }
 }
-}
\ No newline at end of file
+}
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
index d762c7a1e134996ac32e7138e7889bc8ab432e13..ffcf95233c15392dc51087cbcd454b98ff4a4fed 100644
--- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
@@ -1,12 +1,13 @@
 #include "MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h"
 #include "MantidKernel/Strings.h"
+#include "MantidKernel/UnitLabelTypes.h"
 
 namespace Mantid {
 namespace Geometry {
 
 /// Constructor
 MDHistoDimensionBuilder::MDHistoDimensionBuilder()
-    : m_min(0), m_max(0), m_nbins(0), m_minSet(false), m_maxSet(false) {}
+    : m_units(Kernel::Units::Symbol::EmptyLabel), m_min(0), m_max(0), m_nbins(0), m_minSet(false), m_maxSet(false) {}
 
 /// Destructor
 MDHistoDimensionBuilder::~MDHistoDimensionBuilder() {}
@@ -59,7 +60,7 @@ void MDHistoDimensionBuilder::setId(std::string id) { m_id = id; }
 Setter for the dimension units
 @param units : unit type of dimension
 */
-void MDHistoDimensionBuilder::setUnits(std::string units) { m_units = units; }
+void MDHistoDimensionBuilder::setUnits(const Kernel::UnitLabel& units) { m_units = units; }
 
 /*
 Setter for the dimension min
@@ -98,7 +99,7 @@ MDHistoDimension *MDHistoDimensionBuilder::createRaw() {
     throw std::invalid_argument(
         "Cannot create MDHistogramDimension without setting a id.");
   }
-  if (m_units.empty()) {
+  if (m_units.ascii().empty()) {
     throw std::invalid_argument(
         "Cannot create MDHistogramDimension without setting a unit type.");
   }
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/QLab.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/QLab.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..26e8f541e9e201f1e048704949a11d3bfb166b7c
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/QLab.cpp
@@ -0,0 +1,51 @@
+#include "MantidGeometry/MDGeometry/QLab.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+
+namespace Mantid {
+namespace Geometry {
+
+//----------------------------------------------------------------------------------------------
+/** Constructor
+ */
+QLab::QLab() : m_unit(new Mantid::Kernel::InverseAngstromsUnit) {}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+QLab::~QLab() {}
+
+
+const std::string QLab::QLabName = "QLab";
+
+Kernel::UnitLabel QLab::getUnitLabel() const
+{
+    // Forward request on
+    return m_unit->getUnitLabel();
+}
+
+const Kernel::MDUnit& QLab::getMDUnit() const
+{
+    return *m_unit;
+}
+
+bool QLab::canConvertTo(const Mantid::Kernel::MDUnit &otherUnit) const
+{
+    /*
+     Inter frame conversion is possible, but requires additional information.
+     Forbidden for time being.
+    */
+    return *this->m_unit == otherUnit;
+}
+
+std::string QLab::name() const
+{
+    return QLab::QLabName;
+}
+
+QLab *QLab::clone() const
+{
+    return new QLab;
+}
+
+} // namespace Geometry
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/QSample.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/QSample.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a93494b002ccaf5d0758951ddaa24d70e40f4f02
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/QSample.cpp
@@ -0,0 +1,46 @@
+#include "MantidGeometry/MDGeometry/QSample.h"
+#include "MantidKernel/MDUnit.h"
+
+namespace Mantid {
+namespace Geometry {
+
+const std::string QSample::QSampleName = "QSample";
+
+
+//----------------------------------------------------------------------------------------------
+/** Constructor
+ */
+QSample::QSample() : m_unit(new Mantid::Kernel::InverseAngstromsUnit) {}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+QSample::~QSample() {}
+
+Kernel::UnitLabel QSample::getUnitLabel() const
+{
+    return m_unit->getUnitLabel();
+}
+
+const Kernel::MDUnit &QSample::getMDUnit() const
+{
+    return *m_unit;
+}
+
+bool QSample::canConvertTo(const Kernel::MDUnit &otherUnit) const
+{
+    return this->getMDUnit() == otherUnit;
+}
+
+std::string QSample::name() const
+{
+    return QSampleName;
+}
+
+QSample *QSample::clone() const
+{
+    return new QSample;
+}
+
+} // namespace Geometry
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Geometry/test/GeneralFrameTest.h b/Code/Mantid/Framework/Geometry/test/GeneralFrameTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..a09936a9f196bcafb6e70f01c358e5fa6fb715a5
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/test/GeneralFrameTest.h
@@ -0,0 +1,41 @@
+#ifndef MANTID_GEOMETRY_GENERALFRAMETEST_H_
+#define MANTID_GEOMETRY_GENERALFRAMETEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidKernel/UnitLabel.h"
+#include "MantidKernel/UnitLabelTypes.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+
+using Mantid::Geometry::GeneralFrame;
+using namespace Mantid::Kernel;
+
+class GeneralFrameTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static GeneralFrameTest *createSuite() { return new GeneralFrameTest(); }
+  static void destroySuite( GeneralFrameTest *suite ) { delete suite; }
+
+
+  void test_string_construction()
+  {
+      GeneralFrame frame("Temperature", "DegC");
+      TS_ASSERT_EQUALS("Temperature", frame.name());
+      TS_ASSERT_EQUALS(UnitLabel("DegC"), frame.getUnitLabel());
+  }
+
+  void test_string_unit_construction(){
+      std::unique_ptr<LabelUnit> unit(new LabelUnit(Units::Symbol::Metre));
+      GeneralFrame frame("Distance", std::move(unit) /*sink transfer ownership*/);
+      TS_ASSERT(unit.get() == NULL);
+      TS_ASSERT_EQUALS(Units::Symbol::Metre, frame.getUnitLabel());
+      TS_ASSERT_EQUALS("Distance", frame.name() );
+
+  }
+
+
+};
+
+
+#endif /* MANTID_GEOMETRY_GENERALFRAMETEST_H_ */
diff --git a/Code/Mantid/Framework/Geometry/test/HKLTest.h b/Code/Mantid/Framework/Geometry/test/HKLTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..fbdbe88b885ee38a158689905fde16d5a7f312be
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/test/HKLTest.h
@@ -0,0 +1,43 @@
+#ifndef MANTID_GEOMETRY_HKLTEST_H_
+#define MANTID_GEOMETRY_HKLTEST_H_
+
+#include <cxxtest/TestSuite.h>
+#include <memory>
+#include "MantidKernel/MDUnit.h"
+#include "MantidGeometry/MDGeometry/HKL.h"
+
+using Mantid::Geometry::HKL;
+
+class HKLTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static HKLTest *createSuite() { return new HKLTest(); }
+  static void destroySuite(HKLTest *suite) { delete suite; }
+
+  void test_check_unit_compatibility() {
+
+    TSM_ASSERT_THROWS("Input unit for this frame must be a QUnit",
+                      HKL(new Mantid::Kernel::LabelUnit("MeV")),
+                      std::invalid_argument &);
+  }
+
+  void test_check_unit_compatibility_unique_ptr(){
+      std::unique_ptr<Mantid::Kernel::MDUnit> badUnit(new Mantid::Kernel::LabelUnit("MeV"));
+
+
+      HKL* testHKL = NULL;
+      TSM_ASSERT_THROWS("Input unit for this frame must be a QUnit",
+                        testHKL = new HKL(badUnit),
+                        std::invalid_argument&);
+      TSM_ASSERT("Construction should not have succeeded", testHKL == NULL );
+      TSM_ASSERT("Ownership of input should not have changed", badUnit.get() != NULL );
+  }
+
+  void test_name() {
+    HKL frame(new Mantid::Kernel::ReciprocalLatticeUnit);
+    TS_ASSERT_EQUALS(HKL::HKLName, frame.name());
+  }
+};
+
+#endif /* MANTID_GEOMETRY_HKLTEST_H_ */
diff --git a/Code/Mantid/Framework/Geometry/test/IMDDimensionFactoryTest.h b/Code/Mantid/Framework/Geometry/test/IMDDimensionFactoryTest.h
index f864b06c58941f71affd179a726a2b91ee0bb05f..fb9d917a7426ca61bb9ca7676a5f0dacc56f3b41 100644
--- a/Code/Mantid/Framework/Geometry/test/IMDDimensionFactoryTest.h
+++ b/Code/Mantid/Framework/Geometry/test/IMDDimensionFactoryTest.h
@@ -23,7 +23,7 @@ private:
         + "<Units>Cubits</Units>"
         + "<UpperBounds>3</UpperBounds>" + "<LowerBounds>-3</LowerBounds>"
         + "<NumberOfBins>8</NumberOfBins>"
-        + "<ReciprocalDimensionMapping>q3</ReciprocalDimensionMapping>" + "</Dimension>";
+        + "</Dimension>";
 
     return xmlToParse;
   }
@@ -33,7 +33,7 @@ private:
     std::string xmlToParse = std::string("<Dimension ID=\"qz\">") + "<Name>Qz</Name>"
         + "<UpperBounds>3</UpperBounds>" + "<LowerBounds>-3</LowerBounds>"
         + "<NumberOfBins>8</NumberOfBins>"
-        + "<ReciprocalDimensionMapping>q3</ReciprocalDimensionMapping>" + "</Dimension>";
+        + "</Dimension>";
 
     return xmlToParse;
   }
@@ -45,6 +45,18 @@ private:
         + "<NumberOfBins>4</NumberOfBins>" + "</Dimension>";
   }
 
+  std::string constructDimensionWithFrameXMLString()
+  {
+    std::string xmlToParse = std::string("<Dimension ID=\"qz\">") + "<Name>Qz</Name>"
+        + "<Units></Units>"
+        + "<Frame>QSample</Frame>"
+        + "<UpperBounds>3</UpperBounds>" + "<LowerBounds>-3</LowerBounds>"
+        + "<NumberOfBins>8</NumberOfBins>"
+        + "</Dimension>";
+
+    return xmlToParse;
+  }
+
   Poco::AutoPtr<Poco::XML::Document> constructNonReciprocalDimensionXML()
   {
     std::string xmlToParse = constructNonReciprocalDimensionXMLString();
@@ -120,5 +132,12 @@ public:
     std::string missingNumberOfBinsValue = constructNonReciprocalDimensionXMLString().erase(110,1);
     TS_ASSERT_THROWS( createDimension(missingNumberOfBins), std::invalid_argument );
   }
+
+  void testExtractFrame(){
+    IMDDimension_const_sptr dimension = createDimension(constructDimensionWithFrameXMLString());
+    const auto& frame = dimension->getMDFrame();
+    TS_ASSERT_EQUALS(frame.name(), "QSample");
+  }
+
 };
 #endif
diff --git a/Code/Mantid/Framework/Geometry/test/MDFrameFactoryTest.h b/Code/Mantid/Framework/Geometry/test/MDFrameFactoryTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..2212f146a9d415b636f42c02e553d41754c3cdf2
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/test/MDFrameFactoryTest.h
@@ -0,0 +1,143 @@
+#ifndef MANTID_KERNEL_MDFRAMEFACTORYTEST_H_
+#define MANTID_KERNEL_MDFRAMEFACTORYTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidGeometry/MDGeometry/MDFrameFactory.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+#include "MantidGeometry/MDGeometry/QLab.h"
+#include "MantidGeometry/MDGeometry/QSample.h"
+#include "MantidGeometry/MDGeometry/HKL.h"
+#include "MantidKernel/UnitLabelTypes.h"
+#include "MantidKernel/MDUnit.h"
+
+using namespace Mantid::Geometry;
+using namespace Mantid::Kernel;
+
+class MDFrameFactoryTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static MDFrameFactoryTest *createSuite() { return new MDFrameFactoryTest(); }
+  static void destroySuite(MDFrameFactoryTest *suite) { delete suite; }
+
+  void test_GeneralFrameFactory_all_general() {
+    GeneralFrameFactory factory;
+    const MDFrameArgument argument("any_frame", "any_unit");
+    TS_ASSERT(factory.canInterpret(argument));
+
+    std::unique_ptr<MDFrame> product = factory.create(argument);
+    TSM_ASSERT("Should be creating a GeneralFrame",
+               dynamic_cast<GeneralFrame *>(product.get()));
+
+    const auto& heldMDUnit = product->getMDUnit();
+    TSM_ASSERT("Expect that we have a label unit", dynamic_cast<const Mantid::Kernel::LabelUnit*>(&heldMDUnit));
+  }
+
+  void test_GeneralFrameFactory_known_units() {
+
+    GeneralFrameFactory factory;
+
+    const MDFrameArgument argument("any_frame", Units::Symbol::InverseAngstrom);
+
+    std::unique_ptr<MDFrame> product = factory.create(argument);
+    TSM_ASSERT("Should be creating a GeneralFrame",
+               dynamic_cast<GeneralFrame *>(product.get()));
+
+    const auto& heldMDUnit = product->getMDUnit();
+    TSM_ASSERT("Expect that we have a label unit", dynamic_cast<const Mantid::Kernel::InverseAngstromsUnit*>(&heldMDUnit));
+  }
+
+  void test_QLabFrameFactory() {
+    QLabFrameFactory factory;
+
+    const MDFrameArgument badArgument("any_frame");
+    TSM_ASSERT("Should NOT offer to produce QLab products for this frame key",
+               !factory.canInterpret(badArgument));
+
+    const MDFrameArgument argument = MDFrameArgument(QLab::QLabName);
+    TSM_ASSERT("Should offer to produce QLab products for this frame key",
+               factory.canInterpret(argument));
+
+    std::unique_ptr<MDFrame> product = factory.create(argument);
+    TSM_ASSERT("Should be creating a QLab frame",
+               dynamic_cast<QLab *>(product.get()));
+  }
+
+  void test_QSampleFrameFactory() {
+    QSampleFrameFactory factory;
+
+    const MDFrameArgument badArgument("any_frame");
+    TSM_ASSERT(
+        "Should NOT offer to produce QSample products for this frame key",
+        !factory.canInterpret(badArgument));
+
+    const MDFrameArgument argument = MDFrameArgument(QSample::QSampleName);
+    TSM_ASSERT("Should offer to produce QSample products for this frame key",
+               factory.canInterpret(argument));
+
+    std::unique_ptr<MDFrame> product = factory.create(argument);
+    TSM_ASSERT("Should be creating a QSample frame",
+               dynamic_cast<QSample *>(product.get()));
+  }
+
+  void test_HKLFrameFactory_interpretation() {
+    HKLFrameFactory factory;
+
+    TSM_ASSERT(
+        "Should NOT offer to produce HKL products for this frame key",
+        !factory.canInterpret(MDFrameArgument("any_frame")));
+
+    TSM_ASSERT(
+        "Should NOT offer to produce HKL products as units are incompatible",
+        !factory.canInterpret(MDFrameArgument(HKL::HKLName, Units::Symbol::Metre)));
+
+    TSM_ASSERT(
+        "Should offer to produce HKL products",
+        factory.canInterpret(MDFrameArgument(HKL::HKLName, Units::Symbol::InverseAngstrom)));
+
+    TSM_ASSERT(
+        "Should offer to produce HKL products",
+        factory.canInterpret(MDFrameArgument(HKL::HKLName, Units::Symbol::RLU)));
+
+  }
+
+  void test_HKLFrameFactory_create_inverse_angstroms() {
+    HKLFrameFactory factory;
+
+    std::unique_ptr<MDFrame> product = factory.create(
+        MDFrameArgument(HKL::HKLName, Units::Symbol::InverseAngstrom));
+
+
+    TSM_ASSERT("Should be creating a HKL frame, in inverse angstroms",
+               dynamic_cast<HKL *>(product.get()));
+
+    TSM_ASSERT_EQUALS("Units carried across incorrectly", Units::Symbol::InverseAngstrom, product->getUnitLabel());
+
+  }
+
+  void test_HKLFrameFactory_create_rlu() {
+    HKLFrameFactory factory;
+
+    std::unique_ptr<MDFrame> product = factory.create(
+        MDFrameArgument(HKL::HKLName, Units::Symbol::RLU));
+    TSM_ASSERT("Should be creating a HKL frame, in rlu",
+               dynamic_cast<HKL *>(product.get()));
+
+    TSM_ASSERT_EQUALS("Units carried across incorrectly", Units::Symbol::RLU, product->getUnitLabel());
+
+  }
+
+  void test_make_standard_chain(){
+      MDFrameFactory_uptr chain = makeMDFrameFactoryChain();
+      // Now lets try the chain of factories out
+      TS_ASSERT(dynamic_cast<GeneralFrame*>(chain->create(MDFrameArgument("any_frame")).get()));
+      TS_ASSERT(dynamic_cast<QLab*>(chain->create(MDFrameArgument(QLab::QLabName)).get()));
+      TS_ASSERT(dynamic_cast<QSample*>(chain->create(MDFrameArgument(QSample::QSampleName)).get()));
+      TS_ASSERT(dynamic_cast<HKL*>(chain->create(MDFrameArgument(HKL::HKLName, Units::Symbol::RLU)).get()));
+
+  }
+};
+
+#endif /* MANTID_KERNEL_MDFRAMEFACTORYTEST_H_ */
diff --git a/Code/Mantid/Framework/Geometry/test/MDGeometryXMLBuilderTest.h b/Code/Mantid/Framework/Geometry/test/MDGeometryXMLBuilderTest.h
index bbc1b0fec6ad06cbb174c5a4affa94115300ef16..2a4aeb9db43a339ee38be588c8cff57065d88365 100644
--- a/Code/Mantid/Framework/Geometry/test/MDGeometryXMLBuilderTest.h
+++ b/Code/Mantid/Framework/Geometry/test/MDGeometryXMLBuilderTest.h
@@ -53,6 +53,8 @@ private:
       coord_t(size_t ind));
     MOCK_METHOD3(setRange,
       void(size_t nBins, coord_t min, coord_t max));
+    MOCK_CONST_METHOD0(getMDUnits, const Kernel::MDUnit&());
+    MOCK_CONST_METHOD0(getMDFrame, const Geometry::MDFrame&());
   };
 
 static std::string createDimensionXMLString(unsigned int nbins, int min, int max, std::string name, std::string id)
diff --git a/Code/Mantid/Framework/Geometry/test/MDHistoDimensionTest.h b/Code/Mantid/Framework/Geometry/test/MDHistoDimensionTest.h
index b1fb977086f06cc14da7f2450281ca1e23fae546..a1bf34cfa9bd127f5945cac4780fba8a8093d4e1 100644
--- a/Code/Mantid/Framework/Geometry/test/MDHistoDimensionTest.h
+++ b/Code/Mantid/Framework/Geometry/test/MDHistoDimensionTest.h
@@ -3,6 +3,7 @@
 
 #include "MantidGeometry/MDGeometry/MDHistoDimension.h"
 #include "MantidGeometry/MDGeometry/MDTypes.h"
+#include "MantidGeometry/MDGeometry/QLab.h"
 #include "MantidKernel/System.h"
 #include "MantidKernel/Timer.h"
 #include <cxxtest/TestSuite.h>
@@ -41,6 +42,7 @@ public:
       "<Dimension ID=\"id\">") +
       "<Name>name</Name>" +
       "<Units>Furlongs</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>20.0000</UpperBounds>" +
       "<LowerBounds>-10.0000</LowerBounds>" +
       "<NumberOfBins>1</NumberOfBins>" +
@@ -61,6 +63,7 @@ public:
       "<Dimension ID=\"id\">") +
       "<Name>name</Name>" +
       "<Units>Furlongs</Units>" +
+      "<Frame>Unknown frame</Frame>" +
       "<UpperBounds>20.0000</UpperBounds>" +
       "<LowerBounds>-10.0000</LowerBounds>" +
       "<NumberOfBins>15</NumberOfBins>" +
@@ -71,6 +74,39 @@ public:
     TS_ASSERT_EQUALS(expectedXML, actualXML);
   }
 
+  void test_getMDUnits_gives_label_unit(){
+
+   Kernel::UnitLabel unitLabel("Meters");
+   MDHistoDimension dimension("Distance", "Dist", unitLabel, 0, 10, 1);
+   const Mantid::Kernel::MDUnit & unit = dimension.getMDUnits();
+   TS_ASSERT_EQUALS(unit.getUnitLabel(), unitLabel);
+   TS_ASSERT(dynamic_cast<const Mantid::Kernel::LabelUnit*>(&unit));
+
+  }
+
+  void test_construct_with_frame_type(){
+   QLab frame;
+   MDHistoDimension dimension("QLabX", "QLabX", frame, 0, 10, 2);
+   const auto & mdFrame = dimension.getMDFrame();
+
+   TS_ASSERT_EQUALS(frame.name(), mdFrame.name());
+   TS_ASSERT_EQUALS(frame.getUnitLabel(), mdFrame.getUnitLabel());
+
+   std::string actualXML = dimension.toXMLString();
+
+   std::string expectedXML =std::string(
+     "<Dimension ID=\"QLabX\">") +
+     "<Name>QLabX</Name>" +
+     "<Units>Angstrom^-1</Units>" +
+     "<Frame>QLab</Frame>" +
+     "<UpperBounds>10.0000</UpperBounds>" +
+     "<LowerBounds>0.0000</LowerBounds>" +
+     "<NumberOfBins>2</NumberOfBins>" +
+     "</Dimension>";
+
+   TS_ASSERT_EQUALS(expectedXML, actualXML);
+  }
+
 
 };
 
diff --git a/Code/Mantid/Framework/Geometry/test/QLabTest.h b/Code/Mantid/Framework/Geometry/test/QLabTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ca7559d5807915dd328d710ad079ce23e2e15ef
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/test/QLabTest.h
@@ -0,0 +1,41 @@
+#ifndef MANTID_GEOMETRY_QLABTEST_H_
+#define MANTID_GEOMETRY_QLABTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidGeometry/MDGeometry/QLab.h"
+
+using Mantid::Geometry::QLab;
+using namespace Mantid::Kernel;
+
+class QLabTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static QLabTest *createSuite() { return new QLabTest(); }
+  static void destroySuite( QLabTest *suite ) { delete suite; }
+
+
+  void test_name()
+  {
+    QLab frame;
+    TS_ASSERT_EQUALS(QLab::QLabName, frame.name());
+  }
+
+  void test_canConvertTo_unit(){
+    QLab frame;
+    InverseAngstromsUnit unit;
+    TSM_ASSERT("Same unit type as is used for QLab", frame.canConvertTo(unit));
+  }
+
+  void test_cannotConvertTo_unit(){
+    QLab frame;
+    ReciprocalLatticeUnit unit;
+    TSM_ASSERT("Not same unit type as is used for QLab", !frame.canConvertTo(unit));
+  }
+
+};
+
+
+#endif /* MANTID_GEOMETRY_QLABTEST_H_ */
diff --git a/Code/Mantid/Framework/Geometry/test/QSampleTest.h b/Code/Mantid/Framework/Geometry/test/QSampleTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..2438700801952bfc10220642c3fbec565c6a30e7
--- /dev/null
+++ b/Code/Mantid/Framework/Geometry/test/QSampleTest.h
@@ -0,0 +1,43 @@
+#ifndef MANTID_GEOMETRY_QSAMPLETEST_H_
+#define MANTID_GEOMETRY_QSAMPLETEST_H_
+
+#include <cxxtest/TestSuite.h>
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabelTypes.h"
+#include "MantidGeometry/MDGeometry/QSample.h"
+
+using Mantid::Geometry::QSample;
+using namespace Mantid::Kernel;
+
+class QSampleTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static QSampleTest *createSuite() { return new QSampleTest(); }
+  static void destroySuite( QSampleTest *suite ) { delete suite; }
+
+
+  void test_name()
+  {
+    QSample frame;
+    TS_ASSERT_EQUALS(QSample::QSampleName, frame.name());
+  }
+
+  void test_canConvertTo_unit(){
+    QSample frame;
+    InverseAngstromsUnit unit;
+    TSM_ASSERT("Same unit type as is used for QLab", frame.canConvertTo(unit));
+  }
+
+  void test_cannotConvertTo_unit(){
+    QSample frame;
+    ReciprocalLatticeUnit unit;
+    TSM_ASSERT("Not same unit type as is used for QLab", !frame.canConvertTo(unit));
+  }
+
+
+
+};
+
+
+#endif /* MANTID_GEOMETRY_QSAMPLETEST_H_ */
diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt
index 30453b5c29193aa694dfefe576cd47f4f82babb8..8c41a1a9a4b6c44d2bca8a65e92225eea6de2889 100644
--- a/Code/Mantid/Framework/Kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt
@@ -42,6 +42,8 @@ set ( SRC_FILES
 	src/LogFilter.cpp
 	src/LogParser.cpp
 	src/Logger.cpp
+	src/MDUnit.cpp
+	src/MDUnitFactory.cpp
 	src/MagneticFormFactorTable.cpp
 	src/MagneticIon.cpp
 	src/MandatoryValidator.cpp
@@ -129,6 +131,8 @@ set ( INC_FILES
 	inc/MantidKernel/CPUTimer.h
 	inc/MantidKernel/Cache.h
 	inc/MantidKernel/CatalogInfo.h
+	inc/MantidKernel/Chainable.h
+	inc/MantidKernel/ChainableFactory.h
 	inc/MantidKernel/ChecksumHelper.h
 	inc/MantidKernel/CompositeValidator.h
 	inc/MantidKernel/ComputeResourceInfo.h
@@ -174,6 +178,8 @@ set ( INC_FILES
 	inc/MantidKernel/LogFilter.h
 	inc/MantidKernel/LogParser.h
 	inc/MantidKernel/Logger.h
+	inc/MantidKernel/MDUnit.h
+	inc/MantidKernel/MDUnitFactory.h
 	inc/MantidKernel/MRUList.h
 	inc/MantidKernel/MagneticFormFactorTable.h
 	inc/MantidKernel/MagneticIon.h
@@ -302,6 +308,8 @@ set ( TEST_FILES
 	LogFilterTest.h
 	LogParserTest.h
 	LoggerTest.h
+	MDUnitFactoryTest.h
+	MDUnitTest.h
 	MRUListTest.h
 	MagneticFormFactorTableTest.h
 	MagneticIonTest.h
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Chainable.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Chainable.h
new file mode 100644
index 0000000000000000000000000000000000000000..07a5865fc676e69d5466be267ce4ce96da122ebb
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Chainable.h
@@ -0,0 +1,68 @@
+#ifndef MANTID_KERNEL_CHAINABLE_H_
+#define MANTID_KERNEL_CHAINABLE_H_
+
+#include "MantidKernel/System.h"
+#include <memory>
+
+namespace Mantid {
+namespace Kernel {
+
+/** Chainable
+
+ CRTP class
+
+ Chainable gives the ability to set successors, but chainable items do not define create. This is important
+ because the return from setSuccessor should not be the factory directly. Otherwise you could do this
+
+ factory.setSuccessor(new Factory).create()
+
+ and create would be bypass the chain of resposibility, which should be executed along the chain top to bottom.
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+**/
+
+template <typename ChainableType> class DLLExport Chainable {
+protected:
+  /// Successor factory
+  ///boost::optional<std::unique_ptr<ChainableType>> m_successor;
+  std::unique_ptr<ChainableType> m_successor;
+public:
+  /// Set the successor
+  Chainable &setSuccessor(std::unique_ptr<ChainableType>& successor) {
+    m_successor = std::move(successor);
+    return *m_successor;
+  }
+  Chainable &setSuccessor(std::unique_ptr<ChainableType>&& successor) {
+    m_successor = std::move(successor);
+    return *m_successor;
+  }
+  bool hasSuccessor() const { return m_successor.get() != NULL; }
+  virtual ~Chainable() = 0;
+};
+
+/// Keep our destructor pure virtual, but require an implementation.
+template <typename ChainableType> Chainable<ChainableType>::~Chainable() {}
+
+} // namespace Kernel
+} // namespace Mantid
+
+#endif /* MANTID_KERNEL_CHAINABLE_H_ */
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChainableFactory.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChainableFactory.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed41e6304f021ad473df52e5679f672d5e967e39
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChainableFactory.h
@@ -0,0 +1,69 @@
+#ifndef MANTID_KERNEL_CHAINABLEFACTORY_H_
+#define MANTID_KERNEL_CHAINABLEFACTORY_H_
+
+#include "MantidKernel/Chainable.h"
+#include "MantidKernel/System.h"
+#include <memory>
+#include <stdexcept>
+
+namespace Mantid {
+namespace Kernel {
+
+/** ChainableFactory : Chain of Responsiblity generic factory
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+template <typename Factory, typename Product, typename Argument>
+class DLLExport ChainableFactory : public Chainable<Factory> {
+public:
+  /// Destructor
+  virtual ~ChainableFactory() {}
+
+  /**
+   * Factory method wrapper. Wraps results in smart pointer.
+   * @param argument : creational arguments
+   * @return Product
+   */
+  std::unique_ptr<Product> create(const Argument &argument) const {
+    if (this->canInterpret(argument)) {
+      return std::unique_ptr<Product>(this->createRaw(argument));
+    } else {
+      if (this->hasSuccessor()) {
+        return Chainable<Factory>::m_successor->create(argument);
+      } else {
+        throw std::invalid_argument("No successor MDUnitFactory");
+      }
+    }
+  }
+
+private:
+  /// Create the product
+  virtual Product *createRaw(const Argument &argument) const = 0;
+
+  /// Indicate an ability to intepret the string
+  virtual bool canInterpret(const Argument &unitString) const = 0;
+};
+
+} // namespace Kernel
+} // namespace Mantid
+
+#endif /* MANTID_KERNEL_CHAINABLEFACTORY_H_ */
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnit.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnit.h
new file mode 100644
index 0000000000000000000000000000000000000000..9d02a579ec2ab10f3c1ec59fbb2a6b42f000db4b
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnit.h
@@ -0,0 +1,90 @@
+#ifndef MANTID_KERNEL_MDUNIT_H_
+#define MANTID_KERNEL_MDUNIT_H_
+
+#include "MantidKernel/System.h"
+#include "MantidKernel/UnitLabel.h"
+#include <string>
+#include <memory>
+
+namespace Mantid {
+namespace Kernel {
+
+/** MDUnit : Unit type for multidimensional data types. Not convertable to/from
+  TOF unlike Unit.
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class DLLExport MDUnit {
+public:
+  MDUnit();
+  virtual UnitLabel getUnitLabel() const = 0;
+  virtual bool canConvertTo(const MDUnit &other) const = 0;
+  virtual bool isQUnit() const = 0;
+  virtual MDUnit* clone() const = 0;
+  bool operator==(const MDUnit& other) const;
+  virtual ~MDUnit();
+};
+
+/// QUnit base
+class DLLExport QUnit : public MDUnit {
+public:
+  virtual ~QUnit();
+  bool isQUnit() const;
+};
+
+/// Dimensionless RLU
+class DLLExport ReciprocalLatticeUnit : public QUnit {
+public:
+  UnitLabel getUnitLabel() const;
+  bool canConvertTo(const MDUnit &other) const;
+  ReciprocalLatticeUnit* clone() const;
+  virtual ~ReciprocalLatticeUnit();
+};
+
+/// Inverse Angstroms unit
+class DLLExport InverseAngstromsUnit : public QUnit {
+public:
+  UnitLabel getUnitLabel() const;
+  bool canConvertTo(const MDUnit &other) const;
+  InverseAngstromsUnit* clone() const;
+  virtual ~InverseAngstromsUnit();
+};
+
+class DLLExport LabelUnit : public MDUnit {
+private:
+  UnitLabel m_unitLabel;
+public:
+  LabelUnit(const UnitLabel& unitLabel);
+  UnitLabel getUnitLabel() const;
+  bool canConvertTo(const MDUnit &other) const;
+  bool isQUnit() const;
+  virtual ~LabelUnit();
+  LabelUnit* clone() const;
+};
+
+typedef std::unique_ptr<MDUnit> MDUnit_uptr;
+typedef std::unique_ptr<const MDUnit> MDUnit_const_uptr;
+
+} // namespace Kernel
+} // namespace Mantid
+
+#endif /* MANTID_KERNEL_MDUNIT_H_ */
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h
new file mode 100644
index 0000000000000000000000000000000000000000..11f99a75658a088b6bb3f8620d6afb7367494b92
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h
@@ -0,0 +1,83 @@
+#ifndef MANTID_KERNEL_MDUNITFACTORY_H_
+#define MANTID_KERNEL_MDUNITFACTORY_H_
+
+#include "MantidKernel/ChainableFactory.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/DllConfig.h"
+#include <memory>
+
+namespace Mantid {
+namespace Kernel {
+
+
+/** MDUnitFactory : Abstract type. Factory method with chain of reponsibility succession for creating MDUnits.
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  This file is part of Mantid.
+
+  Mantid is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  Mantid is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+  File change history is stored at: <https://github.com/mantidproject/mantid>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_KERNEL_DLL MDUnitFactory : public ChainableFactory<MDUnitFactory, MDUnit, std::string> {
+
+public:
+
+  /// Destructor
+  virtual ~MDUnitFactory(){}
+
+private:
+
+  /// Create the product
+  virtual MDUnit* createRaw(const std::string& unitString) const = 0;
+
+  /// Indicate an ability to intepret the string
+  virtual bool canInterpret(const std::string& unitString) const = 0;
+};
+
+//-----------------------------------------------------------------------
+// Derived MDUnitFactory declarations
+//-----------------------------------------------------------------------
+
+class MANTID_KERNEL_DLL LabelUnitFactory : public MDUnitFactory {
+    LabelUnit *createRaw(const std::string &unitString) const;
+    bool canInterpret(const std::string &unitString) const;
+};
+
+class MANTID_KERNEL_DLL InverseAngstromsUnitFactory : public MDUnitFactory {
+    InverseAngstromsUnit *createRaw(const std::string &unitString) const;
+    bool canInterpret(const std::string &unitString) const;
+};
+
+class MANTID_KERNEL_DLL ReciprocalLatticeUnitFactory : public MDUnitFactory {
+    ReciprocalLatticeUnit *createRaw(const std::string &unitString) const;
+    bool canInterpret(const std::string &unitString) const;
+};
+
+typedef std::unique_ptr<MDUnitFactory> MDUnitFactory_uptr;
+
+typedef std::unique_ptr<const MDUnitFactory> MDUnitFactory_const_uptr;
+
+/// Convience method. Pre-constructed builder chain.
+MDUnitFactory_uptr MANTID_KERNEL_DLL makeMDUnitFactoryChain();
+
+
+} // namespace Kernel
+} // namespace Mantid
+
+#endif /* MANTID_KERNEL_MDUNITFACTORY_H_ */
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabelTypes.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabelTypes.h
index 5d589afc311c508cf79c473443e4a4b8b0a899a0..d10f30dc2f38997c3a81fa2630c1c9337b325cf1 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabelTypes.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabelTypes.h
@@ -56,6 +56,8 @@ public:
   static const UnitLabel Nanometre;
   /// Inverse centimeters
   static const UnitLabel InverseCM;
+  /// Reciprocal lattice units
+  static const UnitLabel RLU;
 };
 
 } // namespace Units
diff --git a/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp b/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
index 6a3189f807723f5ae9013bbb9c075d527c5e057f..b8d7f7bc480f4d73ef3d1b056deaa33503bdf191 100644
--- a/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
+++ b/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
@@ -144,9 +144,8 @@ DateAndTime::DateAndTime(const int64_t total_nanoseconds) {
 /** Construct a time from an ISO8601 string
  *
  * @param ISO8601_string: and ISO8601 formatted string.
- *    "yyyy-mm-ddThh:mm:ss[Z+-]tz:tz"; although the T can be replaced by a
- *space,
- *    and the time is optional, as is the time-zone specification.
+ *    "yyyy-mm-ddThh:mm:ss[Z+-]tz:tz"; although the T can be replaced by a space.
+ *    The time must included, but the time-zone specification is optional.
  */
 DateAndTime::DateAndTime(const std::string ISO8601_string) : _nanoseconds(0) {
   this->setFromISO8601(ISO8601_string);
@@ -452,8 +451,7 @@ void DateAndTime::setFromISO8601(const std::string str) {
   // seem to accept only a date as valid, whereas later versions do not. We want
   // the
   // string to always denote the full timestamp so we check for a colon and if
-  // it is
-  // not present then assume the time has not been given
+  // it is not present then throw an exception.
   if (time.find(":") == std::string::npos)
     throw std::invalid_argument("Error interpreting string '" + str +
                                 "' as a date/time.");
diff --git a/Code/Mantid/Framework/Kernel/src/MDUnit.cpp b/Code/Mantid/Framework/Kernel/src/MDUnit.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..bc15b9b31ef0286bde7b3311f3a5e8d3b8eec87c
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/src/MDUnit.cpp
@@ -0,0 +1,93 @@
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabelTypes.h"
+
+namespace Mantid {
+namespace Kernel {
+
+//----------------------------------------------------------------------------------------------
+/** Constructor
+ */
+MDUnit::MDUnit() {}
+
+bool MDUnit::operator==(const MDUnit &other) const {
+  return typeid(*this) == typeid(other) && this->canConvertTo(other);
+}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+MDUnit::~MDUnit() {}
+
+//----------------------------------------------------------------------------------------------
+// QUnit
+//----------------------------------------------------------------------------------------------
+QUnit::~QUnit() {}
+
+bool QUnit::isQUnit() const { return true; }
+
+//----------------------------------------------------------------------------------------------
+// End QUnit
+//----------------------------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------------------------
+// RLU
+//----------------------------------------------------------------------------------------------
+UnitLabel ReciprocalLatticeUnit::getUnitLabel() const {
+  return Units::Symbol::RLU;
+}
+
+bool ReciprocalLatticeUnit::canConvertTo(const MDUnit &other) const {
+  return other.isQUnit();
+}
+
+ReciprocalLatticeUnit* ReciprocalLatticeUnit::clone() const {return new ReciprocalLatticeUnit;}
+
+ReciprocalLatticeUnit::~ReciprocalLatticeUnit() {}
+//----------------------------------------------------------------------------------------------
+// End RLU
+//----------------------------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------------------------
+// Inverse Angstrom Unit
+//----------------------------------------------------------------------------------------------
+
+UnitLabel InverseAngstromsUnit::getUnitLabel() const {
+  return Units::Symbol::InverseAngstrom;
+}
+
+bool InverseAngstromsUnit::canConvertTo(const MDUnit &other) const {
+  return other.isQUnit();
+}
+
+InverseAngstromsUnit::~InverseAngstromsUnit() {}
+
+InverseAngstromsUnit* InverseAngstromsUnit::clone() const {return new InverseAngstromsUnit;}
+
+//----------------------------------------------------------------------------------------------
+// Inverse Angstrom Unit
+//----------------------------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------------------------
+//  LabelUnit
+//----------------------------------------------------------------------------------------------
+
+LabelUnit::LabelUnit(const UnitLabel& unitLabel): m_unitLabel(unitLabel) {}
+
+UnitLabel LabelUnit::getUnitLabel() const { return m_unitLabel; }
+
+bool LabelUnit::canConvertTo(const MDUnit &other) const {
+  return this->getUnitLabel() == other.getUnitLabel();
+}
+
+bool LabelUnit::isQUnit() const { return false; }
+
+LabelUnit::~LabelUnit() {}
+
+LabelUnit* LabelUnit::clone() const {return new LabelUnit(m_unitLabel);}
+
+//----------------------------------------------------------------------------------------------
+// End RLU
+//----------------------------------------------------------------------------------------------
+
+} // namespace Kernel
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Kernel/src/MDUnitFactory.cpp b/Code/Mantid/Framework/Kernel/src/MDUnitFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4cd9af38875d4ba238b3ae1cc347e9bd9a09632
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/src/MDUnitFactory.cpp
@@ -0,0 +1,51 @@
+#include "MantidKernel/MDUnitFactory.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabel.h"
+#include "MantidKernel/UnitLabelTypes.h"
+#include <memory>
+#include <boost/regex.hpp>
+
+namespace Mantid {
+namespace Kernel {
+
+LabelUnit *LabelUnitFactory::createRaw(const std::string &unitString) const {
+  return new LabelUnit(UnitLabel(unitString));
+}
+
+bool LabelUnitFactory::canInterpret(const std::string &) const {
+  return true; // Can always treat a unit as a label unit.
+}
+
+InverseAngstromsUnit *
+InverseAngstromsUnitFactory::createRaw(const std::string &) const {
+  return new InverseAngstromsUnit;
+}
+
+bool
+InverseAngstromsUnitFactory::canInterpret(const std::string &unitString) const {
+  boost::regex pattern(".*(Angstrom\\^-1)|(A\\^-1)$");
+  return boost::regex_match(unitString, pattern);
+}
+
+ReciprocalLatticeUnit *
+ReciprocalLatticeUnitFactory::createRaw(const std::string &) const {
+  return new ReciprocalLatticeUnit;
+}
+
+bool ReciprocalLatticeUnitFactory::canInterpret(
+    const std::string &unitString) const {
+  return unitString == Units::Symbol::RLU.ascii();
+}
+
+MDUnitFactory_uptr makeMDUnitFactoryChain() {
+  typedef MDUnitFactory_uptr FactoryType;
+  auto first = FactoryType(new InverseAngstromsUnitFactory);
+  first->setSuccessor(FactoryType(new ReciprocalLatticeUnitFactory))
+   // Add more factories here! 
+   // Make sure that LabelUnitFactory is the last in the chain to give a fall through
+    .setSuccessor(FactoryType(new LabelUnitFactory));
+  return first;
+}
+
+} // namespace Kernel
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Kernel/src/UnitLabelTypes.cpp b/Code/Mantid/Framework/Kernel/src/UnitLabelTypes.cpp
index 3c3ceff1d36deca75f3ccf11fafa9db28e8db948..37317c9ad3197356728fdb0cb3817aac5a49a5de 100644
--- a/Code/Mantid/Framework/Kernel/src/UnitLabelTypes.cpp
+++ b/Code/Mantid/Framework/Kernel/src/UnitLabelTypes.cpp
@@ -27,6 +27,8 @@ const UnitLabel Symbol::Metre("m");
 const UnitLabel Symbol::Nanometre("nm");
 /// Inverse centimeters
 const UnitLabel Symbol::InverseCM("cm^-1", L"cm\u207b\u00b9", "cm^{-1}");
+/// Reciprocal lattice (dimensionless)
+const UnitLabel Symbol::RLU("r.l.u");
 
 } // namespace Units
 }
diff --git a/Code/Mantid/Framework/Kernel/test/MDUnitFactoryTest.h b/Code/Mantid/Framework/Kernel/test/MDUnitFactoryTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..251e8034ea86abb16c8dc4d14ac8ab193469cb07
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/test/MDUnitFactoryTest.h
@@ -0,0 +1,130 @@
+#ifndef MANTID_KERNEL_MDUNITFACTORYTEST_H_
+#define MANTID_KERNEL_MDUNITFACTORYTEST_H_
+
+#include <cxxtest/TestSuite.h>
+#include <gmock/gmock.h>
+#include "MantidKernel/MDUnitFactory.h"
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabelTypes.h"
+
+using namespace Mantid::Kernel;
+using namespace testing;
+
+/**
+ * Helper Mock MDUnit
+ */
+class MockMDUnit : public MDUnit {
+public:
+  MOCK_CONST_METHOD0(getUnitLabel, UnitLabel());
+  MOCK_CONST_METHOD1(canConvertTo, bool(const MDUnit &other));
+  MOCK_CONST_METHOD0(isQUnit, bool());
+  MOCK_CONST_METHOD0(clone, MDUnit *());
+  virtual ~MockMDUnit() {}
+};
+
+/**
+ * Helper Mock MDUnitFactory
+ */
+class MockMDUnitFactory : public MDUnitFactory {
+public:
+  MOCK_CONST_METHOD1(createRaw, MDUnit *(const std::string &));
+  MOCK_CONST_METHOD1(canInterpret, bool(const std::string &));
+  virtual ~MockMDUnitFactory() {}
+};
+
+class MDUnitFactoryTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static MDUnitFactoryTest *createSuite() { return new MDUnitFactoryTest(); }
+  static void destroySuite(MDUnitFactoryTest *suite) { delete suite; }
+
+  void test_checks_before_creates() {
+    MockMDUnitFactory factory;
+
+    // We say that the string is interpretable
+    EXPECT_CALL(factory, canInterpret(_)).WillOnce(Return(true));
+    // So we expect to then be asked to create an instance of the product
+    EXPECT_CALL(factory, createRaw(_))
+        .Times(1)
+        .WillOnce(Return(new MockMDUnit));
+
+    factory.create("");
+
+    TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
+  }
+
+  void test_asks_successor_to_create() {
+
+    MockMDUnitFactory factoryPrimary;
+    // We say that the string is uknown on the primary factory
+    EXPECT_CALL(factoryPrimary, canInterpret(_)).WillOnce(Return(false));
+    // So we DONT expect to then be asked to create an instance of THAT product
+    EXPECT_CALL(factoryPrimary, createRaw(_)).Times(0);
+
+    MockMDUnitFactory *factorySecondary = new MockMDUnitFactory;
+    // We say that the string is interpretable
+    EXPECT_CALL(*factorySecondary, canInterpret(_)).WillOnce(Return(true));
+    // So we expect to then be asked to create an instance of the product
+    EXPECT_CALL(*factorySecondary, createRaw(_))
+        .Times(1)
+        .WillOnce(Return(new MockMDUnit));
+
+    factoryPrimary.setSuccessor(
+        std::unique_ptr<MDUnitFactory>(factorySecondary));
+    factoryPrimary.create("");
+
+    TS_ASSERT(Mock::VerifyAndClearExpectations(&factoryPrimary));
+    TS_ASSERT(Mock::VerifyAndClearExpectations(factorySecondary));
+  }
+
+  void test_no_successor_throws() {
+
+    MockMDUnitFactory factoryPrimary;
+    // We say that the string is uknown on the primary factory
+    EXPECT_CALL(factoryPrimary, canInterpret(_)).WillOnce(Return(false));
+    // So we DONT expect to then be asked to create an instance of THAT product
+    EXPECT_CALL(factoryPrimary, createRaw(_)).Times(0);
+
+    TSM_ASSERT_THROWS("No successor. This has to throw", factoryPrimary.create(""), std::invalid_argument&);
+
+    TS_ASSERT(Mock::VerifyAndClearExpectations(&factoryPrimary));
+  }
+
+  void test_label_unit_factory(){
+      LabelUnitFactory factory;
+      auto product = factory.create("anything");
+      TS_ASSERT(dynamic_cast<LabelUnit*>(product.get()));
+  }
+
+  void test_RLU_factory(){
+      ReciprocalLatticeUnitFactory factory;
+      auto product = factory.create(Units::Symbol::RLU);
+      TS_ASSERT(dynamic_cast<ReciprocalLatticeUnit*>(product.get()));
+  }
+
+  void test_InverseAngstroms_factory(){
+      InverseAngstromsUnitFactory factory;
+
+      auto product = factory.create(Units::Symbol::InverseAngstrom);
+      TS_ASSERT(dynamic_cast<InverseAngstromsUnit*>(product.get()));
+
+      product = factory.create("A^-1");
+      TS_ASSERT(dynamic_cast<InverseAngstromsUnit*>(product.get()));
+  }
+
+  void test_make_standard_chain(){
+      MDUnitFactory_uptr chain = makeMDUnitFactoryChain();
+      // Now lets try the chain of factories out
+      TS_ASSERT(dynamic_cast<InverseAngstromsUnit*>(chain->create(Units::Symbol::InverseAngstrom).get()));
+      TS_ASSERT(dynamic_cast<ReciprocalLatticeUnit*>(chain->create(Units::Symbol::RLU).get()));
+      TS_ASSERT(dynamic_cast<LabelUnit*>(chain->create("Anything else").get()));
+
+  }
+
+
+
+
+};
+
+#endif /* MANTID_KERNEL_MDUNITFACTORYTEST_H_ */
diff --git a/Code/Mantid/Framework/Kernel/test/MDUnitTest.h b/Code/Mantid/Framework/Kernel/test/MDUnitTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..d82e9b73db33b63dea999b83cf325440adf6cf3f
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/test/MDUnitTest.h
@@ -0,0 +1,93 @@
+#ifndef MANTID_KERNEL_MDUNITTEST_H_
+#define MANTID_KERNEL_MDUNITTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidKernel/MDUnit.h"
+#include "MantidKernel/UnitLabelTypes.h"
+
+using namespace Mantid::Kernel;
+
+class MDUnitTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static MDUnitTest *createSuite() { return new MDUnitTest(); }
+  static void destroySuite( MDUnitTest *suite ) { delete suite; }
+
+
+  void test_RLU_getUnitLabel(){
+      ReciprocalLatticeUnit unit;
+      TS_ASSERT_EQUALS(Units::Symbol::RLU, unit.getUnitLabel());
+  }
+
+  void test_RLU_canConvertTo_does_not_convert_to_just_anything(){
+      ReciprocalLatticeUnit unit;
+      LabelUnit other("MeV");
+      TSM_ASSERT("Conversion forbidden", !unit.canConvertTo(other));
+      TSM_ASSERT_DIFFERS("Different types", unit, other);
+  }
+
+  void test_RLU_canConvertTo_InverseAngstroms(){
+      ReciprocalLatticeUnit unit;
+      InverseAngstromsUnit other;
+      TSM_ASSERT("Simple conversion possible", unit.canConvertTo(other));
+      TSM_ASSERT_DIFFERS("Convertable, but not the same", unit, other);
+  }
+
+  void test_InverseAngstroms_getUnitLabel(){
+      InverseAngstromsUnit unit;
+      TS_ASSERT_EQUALS(Units::Symbol::InverseAngstrom, unit.getUnitLabel());
+  }
+
+  void test_InverseAngstroms_canConvertTo_does_not_convert_to_just_anything(){
+      InverseAngstromsUnit unit;
+      LabelUnit other("MeV");
+      TSM_ASSERT("Conversion forbidden", !unit.canConvertTo(other));
+      TSM_ASSERT_DIFFERS("Different types", unit, other);
+  }
+
+  void test_InverseAnstroms_canConvertTo_RLU(){
+      ReciprocalLatticeUnit unit;
+      InverseAngstromsUnit other;
+      TSM_ASSERT("Simple conversion possible", unit.canConvertTo(other));
+      TSM_ASSERT_DIFFERS("Convertable, but not the same", unit, other);
+  }
+
+  void test_labelUnit_getUnitLabel(){
+      // Negative test
+      LabelUnit tUnit("DegC");
+      TSM_ASSERT_DIFFERS("Not same unit label", UnitLabel("SomethingElse"), tUnit.getUnitLabel());
+
+      // Positive test
+      TSM_ASSERT_EQUALS("Same unit label", UnitLabel("DegC"), tUnit.getUnitLabel());
+  }
+
+  void test_LabelUnit_canConvert_to_same(){
+      LabelUnit a("Bar");
+      LabelUnit b("Bar");
+      TS_ASSERT(a.canConvertTo(b));
+      TSM_ASSERT_EQUALS("Convertable, and same type", a, b);
+  }
+
+  void test_LabelUnit_canConvert_to_other(){
+      LabelUnit a("DegC");
+      LabelUnit b("Bar");
+      TS_ASSERT(!a.canConvertTo(b));
+      TS_ASSERT_DIFFERS(a, b);
+  }
+
+  void test_cloneLabelUnit(){
+      LabelUnit a("CustomUnit");
+      LabelUnit* b = a.clone();
+      TS_ASSERT_EQUALS(a, *b);
+      delete b;
+  }
+
+
+
+
+};
+
+
+#endif /* MANTID_KERNEL_MDUNITTEST_H_ */
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDEventWSWrapper.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDEventWSWrapper.h
index c16730dfa1761c61c831f1f141c18363b557eb4f..6c8b7823fc5478fc995fa617e70bc74a68795601 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDEventWSWrapper.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDEventWSWrapper.h
@@ -53,11 +53,7 @@ typedef void (MDEventWSWrapper::*fpVoidMethod)();
 typedef void (MDEventWSWrapper::*fpAddData)(float *, uint16_t *, uint32_t *,
                                             coord_t *, size_t) const;
 /// signature for the internal templated function pointer to create workspace
-typedef void (MDEventWSWrapper::*fpCreateWS)(const Strings &, const Strings &t,
-                                             const Strings &,
-                                             const std::vector<double> &,
-                                             const std::vector<double> &,
-                                             const std::vector<size_t> &);
+typedef void (MDEventWSWrapper::*fpCreateWS)(const MDWSDescription& mwsd);
 
 class DLLExport MDEventWSWrapper {
 public:
@@ -135,12 +131,7 @@ private:
   template <size_t nd> void calcCentroidND(void);
 
   template <size_t nd>
-  void createEmptyEventWS(const Strings &targ_dim_names,
-                          const Strings &targ_dim_ID,
-                          const Strings &targ_dim_units,
-                          const std::vector<double> &dimMin,
-                          const std::vector<double> &dimMax,
-                          const std::vector<size_t> &numBins);
+  void createEmptyEventWS(const MDWSDescription& description);
 
   template <size_t nd> void splitBoxList(void); // for the time being
   // void splitBoxList(Kernel::ThreadScheduler * ts);
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
index 0f38390bbebb6a645731660a7901e4b66676ca09..410314c1a1c105c0782b55749a0d2c1000187ba9 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
@@ -6,6 +6,7 @@
 #include "MantidAPI/MatrixWorkspace.h"
 
 #include "MantidGeometry/Crystal/OrientedLattice.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
 
 #include "MantidKernel/Logger.h"
 #include "MantidKernel/PhysicalConstants.h"
@@ -101,6 +102,7 @@ public: // for the time being
   void setWS(API::MatrixWorkspace_sptr otherMatrixWS);
   std::string getWSName() const { return m_InWS->name(); }
   bool isPowder() const;
+  bool isQ3DMode() const;
   bool hasLattice() const { return m_InWS->sample().hasOrientedLattice(); }
 
   boost::shared_ptr<Geometry::OrientedLattice> getLattice() const {
@@ -155,6 +157,12 @@ public: // for the time being
   void setCoordinateSystem(const Mantid::Kernel::SpecialCoordinateSystem system);
   /// @return the special coordinate system if any.
   Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const;
+  /// Set the md frame
+  void setFrame(const std::string frameKey);
+  /// Retrieve the md frame
+  Geometry::MDFrame_uptr getFrame(size_t d) const;
+
+
   /// sets number of bins each dimension is split
   void setNumBins(const std::vector<int> &nBins);
 
@@ -195,6 +203,8 @@ protected: // until MDWSDesctiptionDepricatedExist
 private:
   /// Coordinate system.
   Mantid::Kernel::SpecialCoordinateSystem m_coordinateSystem;
+  /// Frame key. For frame to use.
+  std::string m_frameKey;
 };
 }
 }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp
index 99ed4c2e6fe62cf2a7e94add345d5a5e47acf472..0226204f7e277415cc9fbbfaa76e2679ef54193d 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp
@@ -352,7 +352,7 @@ parameters are defined
 * @param dimMax     -- the vector of maximal values for all dimensions of the
 workspace; is set up similarly to dimMin
 * @param QFrame      -- in Q3D case this describes target coordinate system and
-is ignored in any other caste
+is ignored in any other case
 * @param convertTo_  -- The parameter describing Q-scaling transformations
 * @param targWSDescr -- the resulting class used to interpret all parameters
 together and used to describe selected transformation.
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
index 4a2654c756d13a4c4763bffda1778285aef1dc23..0964094126fe42e732b40326338a18df155ba529 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
@@ -5,9 +5,13 @@
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 #include "MantidGeometry/MDGeometry/IMDDimensionFactory.h"
 #include "MantidGeometry/MDGeometry/MDDimensionExtents.h"
+#include "MantidGeometry/MDGeometry/MDFrameFactory.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
 #include "MantidKernel/CPUTimer.h"
 #include "MantidKernel/EnabledWhenProperty.h"
 #include "MantidKernel/Memory.h"
+#include "MantidKernel/MDUnitFactory.h"
+#include "MantidKernel/MDUnit.h"
 #include "MantidKernel/PropertyWithValue.h"
 #include "MantidKernel/System.h"
 #include "MantidMDAlgorithms/LoadMD.h"
@@ -297,6 +301,7 @@ void LoadMD::loadDimensions() {
 /** Load all the dimensions into this->m_dims
 * The dimensions are stored as an nxData array */
 void LoadMD::loadDimensions2() {
+  using namespace Geometry;
   m_dims.clear();
 
   std::string axes;
@@ -313,14 +318,22 @@ void LoadMD::loadDimensions2() {
   for (size_t d = splitAxes.size(); d > 0; d--) {
     std::string long_name;
     std::string units;
+    std::string frame;
     std::vector<double> axis;
     m_file->openData(splitAxes[d - 1]);
     m_file->getAttr("long_name", long_name);
     m_file->getAttr("units", units);
+    try {
+        m_file->getAttr("frame", frame);
+    } catch (std::exception&)
+    {
+        frame = "Unknown frame";
+    }
+    Geometry::MDFrame_const_uptr mdFrame = Geometry::makeMDFrameFactoryChain()->create(MDFrameArgument(frame, units));
     m_file->getData(axis);
     m_file->closeData();
     m_dims.push_back(boost::make_shared<MDHistoDimension>(
-        long_name, splitAxes[d - 1], units, static_cast<coord_t>(axis.front()),
+        long_name, splitAxes[d - 1], *mdFrame, static_cast<coord_t>(axis.front()),
         static_cast<coord_t>(axis.back()), axis.size() - 1));
   }
   m_file->closeGroup();
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
index 533603184968eaf186d48da676d36e0f1e7b3a45..a7586ccdb57fda588dfee283bad4f658a9022050 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
@@ -1,4 +1,5 @@
 #include "MantidMDAlgorithms/MDEventWSWrapper.h"
+#include "MantidGeometry/MDGeometry/MDTypes.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -8,60 +9,52 @@ namespace MDAlgorithms {
   template parameter:
   * nd -- number of dimensions
 
- *@param  targ_dim_names -- size-nd vector of string containing names of nd
- dimensions of the wrapped workspace
- *@param  targ_dim_ID    -- size-nd vector of strings containing id of the
- wrapped workspace dimensions
- *@param  targ_dim_units -- size-nd vector of strings containing units of the
- wrapped workspace dimensions
- *
- *@param  dimMin         -- size-nd vector of min values of dimensions of the
- target workspace
- *@param  dimMax         -- size-nd vector of max values of dimensions of the
- target workspace
- *@param  numBins        -- size-nd vector of number of bins, each dimension is
- split on single level          */
+ *@param  description : MDWorkspaceDescription memento.
+*/
 template <size_t nd>
-void MDEventWSWrapper::createEmptyEventWS(const Strings &targ_dim_names,
-                                          const Strings &targ_dim_ID,
-                                          const Strings &targ_dim_units,
-                                          const std::vector<double> &dimMin,
-                                          const std::vector<double> &dimMax,
-                                          const std::vector<size_t> &numBins) {
-
-  boost::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>> ws =
-      boost::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>(
+void MDEventWSWrapper::createEmptyEventWS(const MDWSDescription &description) {
+
+  boost::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>
+      ws = boost::shared_ptr<
+          DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>(
           new DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>());
 
-  size_t nBins(10);
+  auto numBins = description.getNBins();
+  size_t nBins(10); // HACK. this means we have 10 bins artificially. This can't
+                    // be right.
   // Give all the dimensions
   for (size_t d = 0; d < nd; d++) {
     if (!numBins.empty())
       nBins = numBins[d];
 
-    Geometry::MDHistoDimension *dim = new Geometry::MDHistoDimension(
-        targ_dim_names[d], targ_dim_ID[d], targ_dim_units[d],
-        coord_t(dimMin[d]), coord_t(dimMax[d]), nBins);
+    Geometry::MDHistoDimension *dim = NULL;
+    if (d < 3 && description.isQ3DMode()) {
+      // We should have frame and scale information that we can use correctly
+      // for our Q dimensions.
+      auto mdFrame = description.getFrame(d);
+
+      dim = new Geometry::MDHistoDimension(
+          description.getDimNames()[d], description.getDimIDs()[d], *mdFrame,
+          Mantid::coord_t(description.getDimMin()[d]),
+          Mantid::coord_t(description.getDimMax()[d]), nBins);
+
+    } else {
+      dim = new Geometry::MDHistoDimension(
+          description.getDimNames()[d], description.getDimIDs()[d],
+          description.getDimUnits()[d],
+          Mantid::coord_t(description.getDimMin()[d]),
+          Mantid::coord_t(description.getDimMax()[d]), nBins);
+    }
+
     ws->addDimension(Geometry::MDHistoDimension_sptr(dim));
   }
   ws->initialize();
 
-  // Build up the box controller
-  // bc = ws->getBoxController();
-  // Build up the box controller, using the properties in
-  // BoxControllerSettingsAlgorithm
-  //     this->setBoxController(bc);
-  // We always want the box to be split (it will reject bad ones)
-  // ws->splitBox();
   m_Workspace = ws;
 }
 /// terminator for attempting initiate 0 dimensions workspace, will throw.
 template <>
-void MDEventWSWrapper::createEmptyEventWS<0>(const Strings &, const Strings &,
-                                             const Strings &,
-                                             const std::vector<double> &,
-                                             const std::vector<double> &,
-                                             const std::vector<size_t> &) {
+void MDEventWSWrapper::createEmptyEventWS<0>(const MDWSDescription &) {
   throw(std::invalid_argument("MDEventWSWrapper:createEmptyEventWS can not be "
                               "initiated with 0 dimensions"));
 }
@@ -90,7 +83,8 @@ void MDEventWSWrapper::addMDDataND(float *sigErr, uint16_t *runIndex,
                                    size_t dataSize) const {
 
   DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *const pWs =
-      dynamic_cast<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
+      dynamic_cast<
+          DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
           m_Workspace.get());
   if (pWs) {
     for (size_t i = 0; i < dataSize; i++) {
@@ -99,8 +93,8 @@ void MDEventWSWrapper::addMDDataND(float *sigErr, uint16_t *runIndex,
           *(detId + i), (Coord + i * nd)));
     }
   } else {
-    DataObjects::MDEventWorkspace<DataObjects::MDLeanEvent<nd>, nd> *const pLWs =
-        dynamic_cast<
+    DataObjects::MDEventWorkspace<DataObjects::MDLeanEvent<nd>, nd> *const
+        pLWs = dynamic_cast<
             DataObjects::MDEventWorkspace<DataObjects::MDLeanEvent<nd>, nd> *>(
             m_Workspace.get());
 
@@ -126,31 +120,14 @@ void MDEventWSWrapper::addMDDataND<0>(float *, uint16_t *, uint32_t *,
 }
 
 /***/
-// void MDEventWSWrapper::splitBoxList(Kernel::ThreadScheduler * ts)
 template <size_t nd> void MDEventWSWrapper::splitBoxList() {
   DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *const pWs =
-      dynamic_cast<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
+      dynamic_cast<
+          DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
           m_Workspace.get());
   if (!pWs)
     throw(std::bad_cast());
 
-  // std::vector<API::splitBoxList> &BoxList =
-  // pWs->getBoxController()->getBoxesToSplit();
-  // API::splitBoxList RootBox;
-  //  for(size_t i=0;i<BoxList.size();i++)
-  //  {
-  // bool
-  // rootFolderReplaced=DataObjects::MDBox<DataObjects::MDEvent<nd>,nd>::splitAllIfNeeded(BoxList[i],NULL);
-  // if(rootFolderReplaced)
-  // {
-  //   RootBox = BoxList[i];
-  // }
-
-  //  }
-  //   if(RootBox.boxPointer)pWs->setBox(reinterpret_cast<DataObjects::MDBoxBase<DataObjects::MDEvent<nd>,nd>
-  //   *>(RootBox.boxPointer));
-
-  //    BoxList.clear();
   m_needSplitting = false;
 }
 
@@ -163,7 +140,8 @@ template <> void MDEventWSWrapper::splitBoxList<0>() {
 template <size_t nd> void MDEventWSWrapper::calcCentroidND(void) {
 
   DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *const pWs =
-      dynamic_cast<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
+      dynamic_cast<
+          DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd> *>(
           this->m_Workspace.get());
   if (!pWs)
     throw(std::bad_cast());
@@ -207,9 +185,7 @@ MDEventWSWrapper::createEmptyMDWS(const MDWSDescription &WSD) {
 
   m_NDimensions = (int)WSD.nDimensions();
   // call the particular function, which creates the workspace with n_dimensions
-  (this->*(wsCreator[m_NDimensions]))(WSD.getDimNames(), WSD.getDimIDs(),
-                                      WSD.getDimUnits(), WSD.getDimMin(),
-                                      WSD.getDimMax(), WSD.getNBins());
+  (this->*(wsCreator[m_NDimensions]))(WSD);
 
   // set up the matrix, which convert momentums from Q in orthogonal crystal
   // coordinate system and units of Angstrom^-1 to hkl or orthogonal hkl or
@@ -297,4 +273,4 @@ MDEventWSWrapper::MDEventWSWrapper()
 }
 
 } // endnamespace MDAlgorithms
-} // endnamespace Mantid
\ No newline at end of file
+} // endnamespace Mantid
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
index 96a904a245f7000be5617cf937b54fedae345ea8..d7156d579623ed328c9b17c879f31ffcf84183ec 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
@@ -8,6 +8,7 @@
 #include "MantidKernel/Strings.h"
 
 #include "MantidMDAlgorithms/MDTransfFactory.h"
+#include "MantidGeometry/MDGeometry/MDFrameFactory.h"
 
 #include <boost/lexical_cast.hpp>
 
@@ -424,11 +425,37 @@ void MDWSDescription::setCoordinateSystem(
   m_coordinateSystem = system;
 }
 
+/**
+ * create the frame
+ * @param d : dimension index to get the frame for.
+ * @return MDFrame
+ */
+Geometry::MDFrame_uptr MDWSDescription::getFrame(size_t d) const{
+    auto factory = Geometry::makeMDFrameFactoryChain();
+    return factory->create(Geometry::MDFrameArgument(m_frameKey, m_DimUnits[d]));
+}
+
+/**
+ * Sets the frame.
+ * @param frameKey : Frame key desired.
+ */
+void MDWSDescription::setFrame(const std::string frameKey){
+    m_frameKey = frameKey;
+}
+
 /// @return the special coordinate system if any.
 Mantid::Kernel::SpecialCoordinateSystem
 MDWSDescription::getCoordinateSystem() const {
   return m_coordinateSystem;
 }
 
+/**
+ * Is the algorithm running in Q3D mode?
+ * @return True only if in Q3D mode
+ */
+bool MDWSDescription::isQ3DMode() const{
+    return this->AlgID.compare("Q3D") == 0;
+}
+
 } // end namespace MDAlgorithms
 } // end namespace Mantid
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDWSTransform.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDWSTransform.cpp
index 3944f5b34bdb7217e2d254d9a761c2b7394ba29c..056e04cd28ae56ccca00e70fc9359d621c62afb0 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDWSTransform.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDWSTransform.cpp
@@ -2,6 +2,10 @@
 
 #include "MantidKernel/Strings.h"
 #include "MantidMDAlgorithms/MDTransfAxisNames.h"
+#include "MantidGeometry/MDGeometry/HKL.h"
+#include "MantidGeometry/MDGeometry/QLab.h"
+#include "MantidGeometry/MDGeometry/QSample.h"
+#include "MantidKernel/MDUnit.h"
 
 #include <cfloat>
 
@@ -48,7 +52,7 @@ MDWSTransform::getTransfMatrix(MDWSDescription &TargWSDescription,
   std::vector<double> transf =
       getTransfMatrix(TargWSDescription, FrameID, ScaleID);
 
-  if (TargWSDescription.AlgID.compare("Q3D") == 0) {
+  if (TargWSDescription.isQ3DMode()) {
     this->setQ3DDimensionsNames(TargWSDescription, FrameID, ScaleID);
   }
 
@@ -323,6 +327,7 @@ void MDWSTransform::setQ3DDimensionsNames(
     dimNames[1] = "Q_lab_y";
     dimNames[2] = "Q_lab_z";
     TargWSDescription.setCoordinateSystem(Mantid::Kernel::QLab);
+    TargWSDescription.setFrame(Geometry::QLab::QLabName);
     break;
   }
   case (CnvrtToMD::SampleFrame): {
@@ -330,13 +335,17 @@ void MDWSTransform::setQ3DDimensionsNames(
     dimNames[1] = "Q_sample_y";
     dimNames[2] = "Q_sample_z";
     TargWSDescription.setCoordinateSystem(Mantid::Kernel::QSample);
+    TargWSDescription.setFrame(Geometry::QSample::QSampleName);
     break;
   }
   case (CnvrtToMD::HKLFrame): {
     dimNames[0] = "H";
     dimNames[1] = "K";
     dimNames[2] = "L";
+
+    Kernel::MDUnit_uptr mdUnit(new Kernel::InverseAngstromsUnit);
     TargWSDescription.setCoordinateSystem(Mantid::Kernel::HKL);
+    TargWSDescription.setFrame(Geometry::HKL::HKLName);
     break;
   }
   default:
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SaveMD2.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SaveMD2.cpp
index 068061edf103f332d69006641d66f6d70750ca3f..52dc7428df7aa47662828c563267a511999ec936 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/SaveMD2.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/SaveMD2.cpp
@@ -146,6 +146,7 @@ void SaveMD2::doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws) {
     file->putData(&axis[0]);
     file->putAttr("units", std::string(dim->getUnits()));
     file->putAttr("long_name", std::string(dim->getName()));
+    file->putAttr("frame", dim->getMDFrame().name());
     file->closeData();
     if (d != 0)
       axes_label.insert(0, ":");
diff --git a/Code/Mantid/Framework/MDAlgorithms/test/ConvertToMDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/ConvertToMDTest.h
index abbcc48112b3eb7532361bb7af1c0f87ef0ab5e2..77dbf2f7b62f04fab92957fe92c6d988d363585c 100644
--- a/Code/Mantid/Framework/MDAlgorithms/test/ConvertToMDTest.h
+++ b/Code/Mantid/Framework/MDAlgorithms/test/ConvertToMDTest.h
@@ -163,6 +163,15 @@ void testExecQ3D()
     auto outWS = AnalysisDataService::Instance().retrieveWS<IMDWorkspace>("WS5DQ3D");
     TS_ASSERT_EQUALS(Mantid::Kernel::HKL, outWS->getSpecialCoordinateSystem());
 
+    // Check that we are getting good frame information back for each dimension.
+    TS_ASSERT_EQUALS("HKL", outWS->getDimension(0)->getMDFrame().name());
+    TS_ASSERT_EQUALS(true, outWS->getDimension(0)->getMDUnits().isQUnit());
+    TS_ASSERT_EQUALS("HKL", outWS->getDimension(1)->getMDFrame().name());
+    TS_ASSERT_EQUALS(true, outWS->getDimension(1)->getMDUnits().isQUnit());
+    TS_ASSERT_EQUALS("HKL", outWS->getDimension(2)->getMDFrame().name());
+    TS_ASSERT_EQUALS(true, outWS->getDimension(2)->getMDUnits().isQUnit());
+    TS_ASSERT_EQUALS(false, outWS->getDimension(3)->getMDUnits().isQUnit());
+
     AnalysisDataService::Instance().remove("WS5DQ3D");
 }
 
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
index 572d8e749562c094b8920cf8aa2d20ba388a05e6..fbd249555c005b3d792c150b4c195d1a2876b5be 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
@@ -103,6 +103,18 @@ void setEFromPyObject(MatrixWorkspace &self, const size_t wsIndex,
   setSpectrumFromPyObject(self, &MatrixWorkspace::dataE, wsIndex, values);
 }
 
+
+/**
+ * Set the Dx values from an python array-style object
+ * @param self :: A reference to the calling object
+ * @param wsIndex :: The workspace index for the spectrum to set
+ * @param values :: A numpy array. The length must match the size of the
+ */
+void setDxFromPyObject(MatrixWorkspace &self, const size_t wsIndex,
+                      numeric::array values) {
+  setSpectrumFromPyObject(self, &MatrixWorkspace::dataDx, wsIndex, values);
+}
+
 /**
  * Adds a deprecation warning to the getNumberBins call to warn about using
  * blocksize instead
@@ -258,6 +270,9 @@ void export_MatrixWorkspace() {
       .def("setE", &setEFromPyObject, args("self", "workspaceIndex", "e"),
            "Set E values from a python list or numpy array. It performs a "
            "simple copy into the array.")
+      .def("setDx", &setDxFromPyObject, args("self", "workspaceIndex", "dX"),
+           "Set Dx values from a python list or numpy array. It performs a "
+           "simple copy into the array.")
 
       // --------------------------------------- Extract data
       // ------------------------------
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
index 79a8366fad82bb4b37262da198e8069f8d812523..b268c7b2f7b1854ec9b3dcd25e76286f88455ce5 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/CMakeLists.txt
@@ -20,6 +20,7 @@ set ( EXPORT_FILES
   src/Exports/RectangularDetector.cpp
   src/Exports/Instrument.cpp
   src/Exports/UnitCell.cpp
+  src/Exports/MDFrame.cpp
   src/Exports/OrientedLattice.cpp
   src/Exports/ReferenceFrame.cpp
   src/Exports/Goniometer.cpp
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp
index 0c4766adf6e7598d4a4bebe720b3d07503727ea6..8c8d9818e9dda072fc34979b8fb2b4186290676d 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp
@@ -1,13 +1,21 @@
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
+#include "MantidGeometry/MDGeometry/MDFrame.h"
 #include "MantidKernel/UnitLabel.h"
+#include "MantidKernel/WarningSuppressions.h"
+#include <boost/shared_ptr.hpp>
 
 #include <boost/python/class.hpp>
 #include <boost/python/register_ptr_to_python.hpp>
+#include <boost/python/return_internal_reference.hpp>
+#include <boost/python/copy_const_reference.hpp>
 
-using Mantid::Geometry::IMDDimension;
-using Mantid::Geometry::IMDDimension_sptr;
+using namespace Mantid::Geometry;
 using namespace boost::python;
 
+// clang-format off
+GCC_DIAG_OFF(strict-aliasing)
+// clang-format on
+
 namespace {
 /**
  * @param self A reference to the calling object
@@ -16,6 +24,16 @@ namespace {
 std::string getUnitsAsStr(IMDDimension &self) {
   return self.getUnits().ascii();
 }
+
+/**
+ * @brief getMDFrame
+ * @param self : A reference to the calling object
+ * @return cloned MDFrame wrapped as a shared pointer.
+ */
+boost::shared_ptr<MDFrame> getMDFrame(const IMDDimension& self){
+    return boost::shared_ptr<MDFrame>(self.getMDFrame().clone());
+}
+
 }
 
 void export_IMDDimension() {
@@ -39,5 +57,7 @@ void export_IMDDimension() {
            "dimension."
            "A dimension can be usually find by its ID and various  ")
       .def("getUnits", &getUnitsAsStr,
-           "Return the units associated with this dimension.");
+           "Return the units associated with this dimension.")
+      .def("getMDFrame", &getMDFrame,
+           "Return the multidimensional frame for this dimension.");
 }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3f6a3e2ed811775b0019107a4cce1f7a29f1114b
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp
@@ -0,0 +1,18 @@
+#include "MantidGeometry/MDGeometry/MDFrame.h"
+#include <boost/python/class.hpp>
+#include <boost/python/register_ptr_to_python.hpp>
+
+using namespace Mantid::Geometry;
+
+using namespace boost::python;
+
+void export_MDFrame() {
+
+  using namespace Mantid::Geometry;
+
+  register_ptr_to_python<boost::shared_ptr<MDFrame>>();
+
+  class_<MDFrame, boost::noncopyable>("MDFrame", no_init)
+      .def("getUnitLabel", &MDFrame::getUnitLabel)
+      .def("name", &MDFrame::name);
+}
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
index db0259e8c7fe6a3fb3ac80cf19ba552d55ba9fba..3962dbd4e9da615f4828bad363b0b5238a734f76 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
@@ -81,18 +81,22 @@ class EnggCalibrate(PythonAlgorithm):
 
         import EnggUtils
 
+        # Get peaks in dSpacing from file
+        expectedPeaksD = EnggUtils.readInExpectedPeaks(self.getPropertyValue("ExpectedPeaksFromFile"),
+                                                       self.getProperty('ExpectedPeaks').value)
+
+        prog = Progress(self, start=0, end=1, nreports=2)
+
+        prog.report('Focusing the input workspace')
         focussed_ws = self._focusRun(self.getProperty('InputWorkspace').value,
                                      self.getProperty("VanadiumWorkspace").value,
                                      self.getProperty('Bank').value,
                                      self.getProperty(self.INDICES_PROP_NAME).value)
 
-        # Get peaks in dSpacing from file
-        expectedPeaksD = EnggUtils.readInExpectedPeaks(self.getPropertyValue("ExpectedPeaksFromFile"),
-                                                       self.getProperty('ExpectedPeaks').value)
-
         if len(expectedPeaksD) < 1:
             raise ValueError("Cannot run this algorithm without any input expected peaks")
 
+        prog.report('Fitting parameters for the focused run')
         difc, zero = self._fitParams(focussed_ws, expectedPeaksD)
 
         self._produceOutputs(difc, zero)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
index 4b733a523017923fbd60a97e6a2f1b6a8318d379..e7a5d7ec3968329856c2418a28cc8b4ec16ae48b 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
@@ -139,7 +139,10 @@ class EnggFitPeaks(PythonAlgorithm):
         foundPeaks = peaks[0]
         fittedPeaks = self._createFittedPeaksTable(peaksTableName)
 
+        prog = Progress(self, start=0, end=1, nreports=foundPeaks.rowCount())
+
         for i in range(foundPeaks.rowCount()):
+            prog.report('Fitting peak number ' + str(i+1))
 
             row = foundPeaks.row(i)
             # Peak parameters estimated by FindPeaks
@@ -171,18 +174,15 @@ class EnggFitPeaks(PythonAlgorithm):
             COEF_LEFT = 2
             COEF_RIGHT = 3
 
-            # Try to predict a fit window for the peak
-            xMin = centre - (width * COEF_LEFT)
-            xMax = centre + (width * COEF_RIGHT)
-
             # Fit using predicted window and a proper function with approximated initital values
             fitAlg = self.createChildAlgorithm('Fit')
             fitAlg.setProperty('Function', 'name=LinearBackground;' + str(peak))
             fitAlg.setProperty('InputWorkspace', inWS)
             fitAlg.setProperty('WorkspaceIndex', wsIndex)
-            fitAlg.setProperty('StartX', xMin)
-            fitAlg.setProperty('EndX', xMax)
             fitAlg.setProperty('CreateOutput', True)
+            # Try to predict a fit window for the peak (using magic numbers)
+            fitAlg.setProperty('StartX', centre - (width * COEF_LEFT))
+            fitAlg.setProperty('EndX', centre + (width * COEF_RIGHT))
             fitAlg.execute()
             paramTable = fitAlg.getProperty('OutputParameters').value
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
index f883edbfcb16925084ec771ac9d393433773c894..6e2ad54bec16809c02d05540a0031c7f6d2088c7 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
@@ -73,6 +73,9 @@ class EnggFocus(PythonAlgorithm):
     	# Leave the data for the bank we are interested in only
         wks = EnggUtils.cropData(self, wks, indices)
 
+        prog = Progress(self, start=0, end=1, nreports=3)
+
+        prog.report('Preparing input workspace')
         # Leave data for the same bank in the vanadium workspace too
         vanWS = self.getProperty('VanadiumWorkspace').value
         vanIntegWS = self.getProperty('VanIntegrationWorkspace').value
@@ -87,9 +90,11 @@ class EnggFocus(PythonAlgorithm):
     	# Convert to dSpacing
         wks = EnggUtils.convertToDSpacing(self, wks)
 
+        prog.report('Summing spectra')
     	# Sum the values
         wks = EnggUtils.sumSpectra(self, wks)
 
+        prog.report('Preparing output workspace')
     	# Convert back to time of flight
         wks = EnggUtils.convertToToF(self, wks)
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
index 1125fff13be22ee5d468dd1769f928ae60873931..dfbe55a42447658be109d110c2bc4e3a6f86fbc0 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
@@ -71,6 +71,12 @@ class EnggVanadiumCorrections(PythonAlgorithm):
         integWS = self.getProperty('IntegrationWorkspace').value
         curvesWS = self.getProperty('CurvesWorkspace').value
 
+        preports = 1
+        if ws:
+            preports += 1
+        prog = Progress(self, start=0, end=1, nreports=preports)
+
+        prog.report('Checking availability of vanadium correction features')
         # figure out if we are calculating or re-using pre-calculated corrections
         if vanWS:
             self.log().information("A workspace with reference Vanadium data was passed. Calculating "
@@ -83,6 +89,7 @@ class EnggVanadiumCorrections(PythonAlgorithm):
             raise ValueError('When a VanadiumWorkspace is not passed, both the IntegrationWorkspace and '
                              'the CurvesWorkspace are required inputs. One or both of them were not given')
 
+        prog.report('Applying corrections on the input workspace')
         if ws:
             self._applyVanadiumCorrections(ws, integWS, curvesWS)
             self.setProperty('Workspace', ws)
@@ -103,7 +110,10 @@ class EnggVanadiumCorrections(PythonAlgorithm):
                              "than the number of spectra (rows) in the integration workspace (%d)"%
                              (spectra, integSpectra))
 
+        prog = Progress(self, start=0, end=1, nreports=2)
+        prog.report('Applying sensitivity correction')
         self._applySensitivityCorrection(ws, integWS, curvesWS)
+        prog.report('Applying pixel-by-pixel correction')
         self._applyPixByPixCorrection(ws, curvesWS)
 
     def _applySensitivityCorrection(self, ws, integWS, curvesWS):
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
index d201961ff55bc661e45c05de0bb7e39dcd02cf8d..36d4104f4772d739a1dbdd6792fcb40389b0f280 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
@@ -5,6 +5,7 @@ from mantid.kernel import *
 from mantid.api import *
 
 import numpy as np
+import scipy.constants as sc
 import ast
 import fnmatch
 import re
@@ -82,6 +83,10 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                 v_axis = self._load_axis(function[2][0])
                 x_axis = self._load_axis(function[2][1])
 
+                # Perform axis unit conversions
+                v_axis = self._axis_conversion(*v_axis)
+                x_axis = self._axis_conversion(*x_axis)
+
                 # Create the workspace for function
                 create_workspace = AlgorithmManager.Instance().create('CreateWorkspace')
                 create_workspace.initialize()
@@ -93,7 +98,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                 create_workspace.setProperty('UnitX', x_axis[1])
                 create_workspace.setProperty('YUnitLabel', function[1])
                 create_workspace.setProperty('VerticalAxisValues', v_axis[0])
-                create_workspace.setProperty('VerticalAxisUnit', 'Empty')
+                create_workspace.setProperty('VerticalAxisUnit', v_axis[1])
                 create_workspace.setProperty('WorkspaceTitle', func_name)
                 create_workspace.execute()
 
@@ -173,7 +178,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
         Loads an axis by name from the data directory.
 
         @param axis_name Name of axis to load
-        @return Tuple of (Numpy array of data, unit)
+        @return Tuple of (Numpy array of data, unit, name)
         @exception ValueError If axis is not found
         """
         if axis_name in self._axis_cache:
@@ -212,7 +217,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                         # Now parse the data
                         data = self._load_1d_slice(f_handle, length)
 
-        return (data, unit)
+        return (data, unit, axis_name)
 
 #------------------------------------------------------------------------------
 
@@ -261,6 +266,47 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
 
         return data
 
+#------------------------------------------------------------------------------
+
+    def _axis_conversion(self, data, unit, name):
+        """
+        Converts an axis to a Mantid axis type (possibly performing a unit
+        conversion).
+
+        @param data The axis data as Numpy array
+        @param unit The axis unit as read from the file
+        @param name The axis name as read from the file
+        @return Tuple containing updated axis details
+        """
+        logger.debug('Axis for conversion: name={0}, unit={1}'.format(name, unit))
+
+        # Q (nm**-1) to Q (Angstrom**-1)
+        if name.lower() == 'q' and unit.lower() == 'inv_nm':
+            logger.information('Axis {0} will be converted to Q in Angstrom**-1'.format(name))
+            unit = 'MomentumTransfer'
+            data /= sc.nano # nm to m
+            data *= sc.angstrom # m to Angstrom
+
+        # Frequency (THz) to Energy (meV)
+        elif name.lower() == 'frequency' and unit.lower() == 'thz':
+            logger.information('Axis {0} will be converted to energy in meV'.format(name))
+            unit = 'Energy'
+            data *= sc.tera # THz to Hz
+            data *= sc.value('Planck constant in eV s') # Hz to eV
+            data /= sc.milli # eV to meV
+
+        # Time (ps) to TOF (s)
+        elif name.lower() == 'time' and unit.lower() == 'ps':
+            logger.information('Axis {0} will be converted to time in microsecond'.format(name))
+            unit = 'TOF'
+            data *= sc.micro # ps to us
+
+        # No conversion
+        else:
+            unit = 'Empty'
+
+        return (data, unit, name)
+
 #------------------------------------------------------------------------------
 
 AlgorithmFactory.subscribe(LoadNMoldyn4Ascii)
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
index c60e8ea989323602d20092a8b27dec20f76303c0..6fe68ac41369b044254703ab9536be65cf1aaacb 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
@@ -29,7 +29,8 @@ class LoadNMoldyn4AsciiTest(unittest.TestCase):
         self.assertTrue(isinstance(workspace, MatrixWorkspace))
         self.assertEqual(workspace.getNumberHistograms(), 21)
         self.assertEqual(workspace.blocksize(), 100)
-        self.assertEqual(str(workspace.getAxis(0).getUnit().symbol()), 'ps')
+        self.assertEqual(str(workspace.getAxis(0).getUnit().unitID()), 'TOF')
+        self.assertEqual(str(workspace.getAxis(1).getUnit().unitID()), 'MomentumTransfer')
 
 
     def _validate_sqf_ws(self, workspace):
@@ -41,7 +42,8 @@ class LoadNMoldyn4AsciiTest(unittest.TestCase):
         self.assertTrue(isinstance(workspace, MatrixWorkspace))
         self.assertEqual(workspace.getNumberHistograms(), 21)
         self.assertEqual(workspace.blocksize(), 199)
-        self.assertEqual(str(workspace.getAxis(0).getUnit().symbol()), 'THz')
+        self.assertEqual(str(workspace.getAxis(0).getUnit().unitID()), 'Energy')
+        self.assertEqual(str(workspace.getAxis(1).getUnit().unitID()), 'MomentumTransfer')
 
 
     def test_load_single_fqt_function(self):
diff --git a/Code/Mantid/MantidQt/SliceViewer/test/MockObjects.h b/Code/Mantid/MantidQt/SliceViewer/test/MockObjects.h
index 1a5a50c4feb03077cea2f2b47d54d659d352b8c6..62c8661bd471658806dc9923d58fb9f11d73e6df 100644
--- a/Code/Mantid/MantidQt/SliceViewer/test/MockObjects.h
+++ b/Code/Mantid/MantidQt/SliceViewer/test/MockObjects.h
@@ -22,289 +22,228 @@ using namespace Mantid::Geometry;
 using namespace Mantid;
 using boost::regex;
 
-namespace
-{
+namespace {
 
-  /*------------------------------------------------------------
-  Zoomable Peaks View
-  ------------------------------------------------------------*/
-  class MockZoomablePeaksView : public ZoomablePeaksView
-  {
-  public:
-    MOCK_METHOD1(zoomToRectangle, void(const PeakBoundingBox&));
-    MOCK_METHOD0(resetView, void());
-    MOCK_METHOD0(detach, void());
-    virtual ~MockZoomablePeaksView(){}
-  };
-
-  /*------------------------------------------------------------
-  Mock Peaks Presenter
-  ------------------------------------------------------------*/
-  class MockPeaksPresenter : public PeaksPresenter
-  {
-  public:
-    MOCK_METHOD0(update, void());
-    MOCK_METHOD1(updateWithSlicePoint, void(const PeakBoundingBox&));
-    MOCK_METHOD0(changeShownDim, bool());
-    MOCK_CONST_METHOD1(isLabelOfFreeAxis, bool(const std::string&));
-    MOCK_CONST_METHOD0(presentedWorkspaces, SetPeaksWorkspaces());
-    MOCK_METHOD1(setForegroundColor, void(const QColor));
-    MOCK_METHOD1(setBackgroundColor, void(const QColor));
-    MOCK_CONST_METHOD0(getTransformName, std::string());
-    MOCK_METHOD1(showBackgroundRadius, void(const bool));
-    MOCK_METHOD1(setShown, void(const bool));
-    MOCK_CONST_METHOD1(getBoundingBox, PeakBoundingBox(const int peakIndex));
-    MOCK_METHOD2(sortPeaksWorkspace, void(const std::string&, const bool));
-    MOCK_METHOD1(setPeakSizeOnProjection, void(const double));
-    MOCK_METHOD1(setPeakSizeIntoProjection, void(const double));
-    MOCK_CONST_METHOD0(getPeakSizeOnProjection, double());
-    MOCK_CONST_METHOD0(getPeakSizeIntoProjection, double());
-    MOCK_METHOD1(registerOwningPresenter, void(UpdateableOnDemand*));
-    MOCK_CONST_METHOD0(getShowBackground, bool());
-    MOCK_METHOD1(zoomToPeak, void(const int));
-    MOCK_CONST_METHOD0(isHidden, bool());
-    MOCK_METHOD1(reInitialize, void(boost::shared_ptr<Mantid::API::IPeaksWorkspace> peaksWS));
-    MOCK_CONST_METHOD1(contentsDifferent,
-          bool(const PeaksPresenter*  other));
-    MOCK_METHOD1(deletePeaksIn, bool(PeakBoundingBox));
-    MOCK_METHOD1(peakEditMode, void(EditMode));
-    MOCK_METHOD2(addPeakAt, bool(double, double));
-    MOCK_CONST_METHOD0(hasPeakAddMode, bool());
-    virtual ~MockPeaksPresenter(){}
-  };
+/*------------------------------------------------------------
+Zoomable Peaks View
+------------------------------------------------------------*/
+class MockZoomablePeaksView : public ZoomablePeaksView {
+public:
+  MOCK_METHOD1(zoomToRectangle, void(const PeakBoundingBox &));
+  MOCK_METHOD0(resetView, void());
+  MOCK_METHOD0(detach, void());
+  virtual ~MockZoomablePeaksView() {}
+};
 
+/*------------------------------------------------------------
+Mock Peaks Presenter
+------------------------------------------------------------*/
+class MockPeaksPresenter : public PeaksPresenter {
+public:
+  MOCK_METHOD0(update, void());
+  MOCK_METHOD1(updateWithSlicePoint, void(const PeakBoundingBox &));
+  MOCK_METHOD0(changeShownDim, bool());
+  MOCK_CONST_METHOD1(isLabelOfFreeAxis, bool(const std::string &));
+  MOCK_CONST_METHOD0(presentedWorkspaces, SetPeaksWorkspaces());
+  MOCK_METHOD1(setForegroundColor, void(const QColor));
+  MOCK_METHOD1(setBackgroundColor, void(const QColor));
+  MOCK_CONST_METHOD0(getTransformName, std::string());
+  MOCK_METHOD1(showBackgroundRadius, void(const bool));
+  MOCK_METHOD1(setShown, void(const bool));
+  MOCK_CONST_METHOD1(getBoundingBox, PeakBoundingBox(const int peakIndex));
+  MOCK_METHOD2(sortPeaksWorkspace, void(const std::string &, const bool));
+  MOCK_METHOD1(setPeakSizeOnProjection, void(const double));
+  MOCK_METHOD1(setPeakSizeIntoProjection, void(const double));
+  MOCK_CONST_METHOD0(getPeakSizeOnProjection, double());
+  MOCK_CONST_METHOD0(getPeakSizeIntoProjection, double());
+  MOCK_METHOD1(registerOwningPresenter, void(UpdateableOnDemand *));
+  MOCK_CONST_METHOD0(getShowBackground, bool());
+  MOCK_METHOD1(zoomToPeak, void(const int));
+  MOCK_CONST_METHOD0(isHidden, bool());
+  MOCK_METHOD1(reInitialize,
+               void(boost::shared_ptr<Mantid::API::IPeaksWorkspace> peaksWS));
+  MOCK_CONST_METHOD1(contentsDifferent, bool(const PeaksPresenter *other));
+  MOCK_METHOD1(deletePeaksIn, bool(PeakBoundingBox));
+  MOCK_METHOD1(peakEditMode, void(EditMode));
+  MOCK_METHOD2(addPeakAt, bool(double, double));
+  MOCK_CONST_METHOD0(hasPeakAddMode, bool());
+  virtual ~MockPeaksPresenter() {}
+};
 
-  /*------------------------------------------------------------
-  Mock Peaks Presenter, with additional hooks for verifying destruction.
-  ------------------------------------------------------------*/
-  class DyingMockPeaksPresenter : public MockPeaksPresenter
-  {
-  public:
-    MOCK_METHOD0(die, void());
-    virtual ~DyingMockPeaksPresenter(){die();}
-  };
+/*------------------------------------------------------------
+Mock Peaks Presenter, with additional hooks for verifying destruction.
+------------------------------------------------------------*/
+class DyingMockPeaksPresenter : public MockPeaksPresenter {
+public:
+  MOCK_METHOD0(die, void());
+  virtual ~DyingMockPeaksPresenter() { die(); }
+};
 
-  /*------------------------------------------------------------
-  Mock Peak Transform
-  ------------------------------------------------------------*/
-  class MockPeakTransform : public Geometry::PeakTransform
-  {
-  public:
-    MockPeakTransform()
-      :PeakTransform("H (Lattice)", "K (Lattice)", regex("^H.*$"), regex("^K.*$"), regex("^L.*$"))
-    {
-    }
-    ~MockPeakTransform()
-    {
-    }
-    MOCK_CONST_METHOD0(clone, PeakTransform_sptr());
-    MOCK_CONST_METHOD1(transform, Mantid::Kernel::V3D(const Mantid::Kernel::V3D&));
-    MOCK_CONST_METHOD1(transformPeak, Mantid::Kernel::V3D(const Mantid::Geometry::IPeak&));
-    MOCK_CONST_METHOD0(getFriendlyName, std::string());
-    MOCK_CONST_METHOD0(getCoordinateSystem, Mantid::Kernel::SpecialCoordinateSystem());
-  };
+/*------------------------------------------------------------
+Mock Peak Transform
+------------------------------------------------------------*/
+class MockPeakTransform : public Geometry::PeakTransform {
+public:
+  MockPeakTransform()
+      : PeakTransform("H (Lattice)", "K (Lattice)", regex("^H.*$"),
+                      regex("^K.*$"), regex("^L.*$")) {}
+  ~MockPeakTransform() {}
+  MOCK_CONST_METHOD0(clone, PeakTransform_sptr());
+  MOCK_CONST_METHOD1(transform,
+                     Mantid::Kernel::V3D(const Mantid::Kernel::V3D &));
+  MOCK_CONST_METHOD1(transformPeak,
+                     Mantid::Kernel::V3D(const Mantid::Geometry::IPeak &));
+  MOCK_CONST_METHOD0(getFriendlyName, std::string());
+  MOCK_CONST_METHOD0(getCoordinateSystem,
+                     Mantid::Kernel::SpecialCoordinateSystem());
+};
 
-  /*------------------------------------------------------------
-  Mock Peak Transform Factory
-  ------------------------------------------------------------*/
-class MockPeakTransformFactory : public Geometry::PeakTransformFactory
-{
- public:
+/*------------------------------------------------------------
+Mock Peak Transform Factory
+------------------------------------------------------------*/
+class MockPeakTransformFactory : public Geometry::PeakTransformFactory {
+public:
   MOCK_CONST_METHOD0(createDefaultTransform, PeakTransform_sptr());
-  MOCK_CONST_METHOD2(createTransform, PeakTransform_sptr(const std::string&, const std::string&));
+  MOCK_CONST_METHOD2(createTransform, PeakTransform_sptr(const std::string &,
+                                                         const std::string &));
 };
 
-  /*------------------------------------------------------------
-  Mock Peak Overlay View
-  ------------------------------------------------------------*/
-  class MockPeakOverlayView : public PeakOverlayView
-  {
-  public:
-    MOCK_METHOD1(setPlaneDistance, void(const double&));
-    MOCK_METHOD0(updateView, void());
-    MOCK_METHOD2(setSlicePoint, void(const double&, const std::vector<bool>&));
-    MOCK_METHOD0(hideView, void());
-    MOCK_METHOD0(showView, void());
-    MOCK_METHOD1(movePosition, void(PeakTransform_sptr));
-    MOCK_METHOD1(changeForegroundColour, void(const QColor));
-    MOCK_METHOD1(changeBackgroundColour, void(const QColor));
-    MOCK_METHOD1(showBackgroundRadius, void(const bool));
-    MOCK_CONST_METHOD1(getBoundingBox, PeakBoundingBox(const int));
-    MOCK_METHOD1(changeOccupancyInView, void(const double));
-    MOCK_METHOD1(changeOccupancyIntoView, void(const double));
-    MOCK_CONST_METHOD0(getOccupancyInView, double());
-    MOCK_CONST_METHOD0(getOccupancyIntoView, double());
-    MOCK_CONST_METHOD0(positionOnly, bool());
-    MOCK_CONST_METHOD0(getRadius, double());
-    MOCK_CONST_METHOD0(isBackgroundShown, bool());
-    MOCK_CONST_METHOD0(getForegroundColour, QColor());
-    MOCK_CONST_METHOD0(getBackgroundColour, QColor());
-    MOCK_METHOD0(peakDeletionMode, void());
-    MOCK_METHOD0(peakAdditionMode, void());
-    MOCK_METHOD0(peakDisplayMode, void());
-    MOCK_METHOD1(takeSettingsFrom, void(PeakOverlayView const * const));
-    virtual ~MockPeakOverlayView(){}
-  };
+/*------------------------------------------------------------
+Mock Peak Overlay View
+------------------------------------------------------------*/
+class MockPeakOverlayView : public PeakOverlayView {
+public:
+  MOCK_METHOD1(setPlaneDistance, void(const double &));
+  MOCK_METHOD0(updateView, void());
+  MOCK_METHOD2(setSlicePoint, void(const double &, const std::vector<bool> &));
+  MOCK_METHOD0(hideView, void());
+  MOCK_METHOD0(showView, void());
+  MOCK_METHOD1(movePosition, void(PeakTransform_sptr));
+  MOCK_METHOD1(changeForegroundColour, void(const QColor));
+  MOCK_METHOD1(changeBackgroundColour, void(const QColor));
+  MOCK_METHOD1(showBackgroundRadius, void(const bool));
+  MOCK_CONST_METHOD1(getBoundingBox, PeakBoundingBox(const int));
+  MOCK_METHOD1(changeOccupancyInView, void(const double));
+  MOCK_METHOD1(changeOccupancyIntoView, void(const double));
+  MOCK_CONST_METHOD0(getOccupancyInView, double());
+  MOCK_CONST_METHOD0(getOccupancyIntoView, double());
+  MOCK_CONST_METHOD0(positionOnly, bool());
+  MOCK_CONST_METHOD0(getRadius, double());
+  MOCK_CONST_METHOD0(isBackgroundShown, bool());
+  MOCK_CONST_METHOD0(getForegroundColour, QColor());
+  MOCK_CONST_METHOD0(getBackgroundColour, QColor());
+  MOCK_METHOD0(peakDeletionMode, void());
+  MOCK_METHOD0(peakAdditionMode, void());
+  MOCK_METHOD0(peakDisplayMode, void());
+  MOCK_METHOD1(takeSettingsFrom, void(PeakOverlayView const *const));
+  virtual ~MockPeakOverlayView() {}
+};
 
-  /*------------------------------------------------------------
-  Mock Widget Factory.
-  ------------------------------------------------------------*/
-  class MockPeakOverlayFactory : public PeakOverlayViewFactory
-  {
-  public:
-    MOCK_CONST_METHOD2(createView, boost::shared_ptr<PeakOverlayView>(PeaksPresenter*, PeakTransform_const_sptr));
-    MOCK_CONST_METHOD0(getPlotXLabel, std::string());
-    MOCK_CONST_METHOD0(getPlotYLabel, std::string());
-    MOCK_METHOD0(updateView, void());
-    MOCK_CONST_METHOD0(FOM, int());
-    MOCK_METHOD1(swapPeaksWorkspace, void(boost::shared_ptr<Mantid::API::IPeaksWorkspace>&));
-  };
-  
-  
-  /*------------------------------------------------------------
-  Mock IPeak
-  ------------------------------------------------------------*/
-  class MockIPeak : public Mantid::Geometry::IPeak
-  {
-  public:
-    MOCK_METHOD1(setInstrument,
-      void(Geometry::Instrument_const_sptr inst));
-    MOCK_CONST_METHOD0(getDetectorID,
-      int());
-    MOCK_METHOD1(setDetectorID,
-      void(int m_DetectorID));
-    MOCK_CONST_METHOD0(getDetector,
-      Geometry::IDetector_const_sptr());
-    MOCK_CONST_METHOD0(getInstrument,
-      Geometry::Instrument_const_sptr());
-    MOCK_CONST_METHOD0(getRunNumber,
-      int());
-    MOCK_METHOD1(setRunNumber,
-      void(int m_RunNumber));
-    MOCK_CONST_METHOD0(getMonitorCount,
-      double());
-    MOCK_METHOD1(setMonitorCount,
-      void(double m_MonitorCount));
-    MOCK_CONST_METHOD0(getH,
-      double());
-    MOCK_CONST_METHOD0(getK,
-      double());
-    MOCK_CONST_METHOD0(getL,
-      double());
-    MOCK_CONST_METHOD0(getHKL,
-      Mantid::Kernel::V3D());
-    MOCK_METHOD1(setH,
-      void(double m_H));
-    MOCK_METHOD1(setK,
-      void(double m_K));
-    MOCK_METHOD1(setL,
-      void(double m_L));
-    MOCK_METHOD3(setHKL,
-      void(double H, double K, double L));
-    MOCK_METHOD1(setHKL,
-      void(Mantid::Kernel::V3D HKL));
-    MOCK_CONST_METHOD0(getQLabFrame,
-      Mantid::Kernel::V3D());
-    MOCK_CONST_METHOD0(getQSampleFrame,
-      Mantid::Kernel::V3D());
-    MOCK_METHOD0(findDetector,
-      bool());
-    MOCK_METHOD2(setQSampleFrame,
-      void(Mantid::Kernel::V3D QSampleFrame, boost::optional<double> detectorDistance));
-    MOCK_METHOD2(setQLabFrame,
-      void(Mantid::Kernel::V3D QLabFrame, boost::optional<double> detectorDistance));
-    MOCK_METHOD1(setWavelength,
-      void(double wavelength));
-    MOCK_CONST_METHOD0(getWavelength,
-      double());
-    MOCK_CONST_METHOD0(getScattering,
-      double());
-    MOCK_CONST_METHOD0(getDSpacing,
-      double());
-    MOCK_CONST_METHOD0(getTOF,
-      double());
-    MOCK_CONST_METHOD0(getInitialEnergy,
-      double());
-    MOCK_CONST_METHOD0(getFinalEnergy,
-      double());
-    MOCK_METHOD1(setInitialEnergy,
-      void(double m_InitialEnergy));
-    MOCK_METHOD1(setFinalEnergy,
-      void(double m_FinalEnergy));
-    MOCK_CONST_METHOD0(getIntensity,
-      double());
-    MOCK_CONST_METHOD0(getSigmaIntensity,
-      double());
-    MOCK_METHOD1(setIntensity,
-      void(double m_Intensity));
-    MOCK_METHOD1(setSigmaIntensity,
-      void(double m_SigmaIntensity));
-    MOCK_CONST_METHOD0(getBinCount,
-      double());
-    MOCK_METHOD1(setBinCount,
-      void(double m_BinCount));
-    MOCK_CONST_METHOD0(getGoniometerMatrix,
-      Mantid::Kernel::Matrix<double>());
-    MOCK_METHOD1(setGoniometerMatrix,
-      void(Mantid::Kernel::Matrix<double> m_GoniometerMatrix));
-    MOCK_CONST_METHOD0(getBankName,
-      std::string());
-    MOCK_CONST_METHOD0(getRow,
-      int());
-    MOCK_CONST_METHOD0(getCol,
-      int());
-    MOCK_CONST_METHOD0(getDetPos,
-      Mantid::Kernel::V3D());
-    MOCK_CONST_METHOD0(getL1,
-      double());
-    MOCK_CONST_METHOD0(getL2,
-      double());
-    MOCK_CONST_METHOD0(getDetectorPosition,
-      Mantid::Kernel::V3D());
-    MOCK_CONST_METHOD0(getDetectorPositionNoCheck,
-          Mantid::Kernel::V3D());
-    MOCK_CONST_METHOD0(getPeakShape, const Mantid::Geometry::PeakShape&());
+/*------------------------------------------------------------
+Mock Widget Factory.
+------------------------------------------------------------*/
+class MockPeakOverlayFactory : public PeakOverlayViewFactory {
+public:
+  MOCK_CONST_METHOD2(
+      createView, boost::shared_ptr<PeakOverlayView>(PeaksPresenter *,
+                                                     PeakTransform_const_sptr));
+  MOCK_CONST_METHOD0(getPlotXLabel, std::string());
+  MOCK_CONST_METHOD0(getPlotYLabel, std::string());
+  MOCK_METHOD0(updateView, void());
+  MOCK_CONST_METHOD0(FOM, int());
+  MOCK_METHOD1(swapPeaksWorkspace,
+               void(boost::shared_ptr<Mantid::API::IPeaksWorkspace> &));
 };
 
-  /*------------------------------------------------------------
-  Mock MDGeometry
-  ------------------------------------------------------------*/
-  class MockMDGeometry : public Mantid::API::MDGeometry
-  {
-  public:
-    MOCK_CONST_METHOD0(getNumDims, size_t());
-    MOCK_CONST_METHOD1(getDimension, boost::shared_ptr<const Mantid::Geometry::IMDDimension>(size_t));
-    virtual ~MockMDGeometry() {}
-  };
+/*------------------------------------------------------------
+Mock IPeak
+------------------------------------------------------------*/
+class MockIPeak : public Mantid::Geometry::IPeak {
+public:
+  MOCK_METHOD1(setInstrument, void(Geometry::Instrument_const_sptr inst));
+  MOCK_CONST_METHOD0(getDetectorID, int());
+  MOCK_METHOD1(setDetectorID, void(int m_DetectorID));
+  MOCK_CONST_METHOD0(getDetector, Geometry::IDetector_const_sptr());
+  MOCK_CONST_METHOD0(getInstrument, Geometry::Instrument_const_sptr());
+  MOCK_CONST_METHOD0(getRunNumber, int());
+  MOCK_METHOD1(setRunNumber, void(int m_RunNumber));
+  MOCK_CONST_METHOD0(getMonitorCount, double());
+  MOCK_METHOD1(setMonitorCount, void(double m_MonitorCount));
+  MOCK_CONST_METHOD0(getH, double());
+  MOCK_CONST_METHOD0(getK, double());
+  MOCK_CONST_METHOD0(getL, double());
+  MOCK_CONST_METHOD0(getHKL, Mantid::Kernel::V3D());
+  MOCK_METHOD1(setH, void(double m_H));
+  MOCK_METHOD1(setK, void(double m_K));
+  MOCK_METHOD1(setL, void(double m_L));
+  MOCK_METHOD3(setHKL, void(double H, double K, double L));
+  MOCK_METHOD1(setHKL, void(Mantid::Kernel::V3D HKL));
+  MOCK_CONST_METHOD0(getQLabFrame, Mantid::Kernel::V3D());
+  MOCK_CONST_METHOD0(getQSampleFrame, Mantid::Kernel::V3D());
+  MOCK_METHOD0(findDetector, bool());
+  MOCK_METHOD2(setQSampleFrame, void(Mantid::Kernel::V3D QSampleFrame,
+                                     boost::optional<double> detectorDistance));
+  MOCK_METHOD2(setQLabFrame, void(Mantid::Kernel::V3D QLabFrame,
+                                  boost::optional<double> detectorDistance));
+  MOCK_METHOD1(setWavelength, void(double wavelength));
+  MOCK_CONST_METHOD0(getWavelength, double());
+  MOCK_CONST_METHOD0(getScattering, double());
+  MOCK_CONST_METHOD0(getDSpacing, double());
+  MOCK_CONST_METHOD0(getTOF, double());
+  MOCK_CONST_METHOD0(getInitialEnergy, double());
+  MOCK_CONST_METHOD0(getFinalEnergy, double());
+  MOCK_METHOD1(setInitialEnergy, void(double m_InitialEnergy));
+  MOCK_METHOD1(setFinalEnergy, void(double m_FinalEnergy));
+  MOCK_CONST_METHOD0(getIntensity, double());
+  MOCK_CONST_METHOD0(getSigmaIntensity, double());
+  MOCK_METHOD1(setIntensity, void(double m_Intensity));
+  MOCK_METHOD1(setSigmaIntensity, void(double m_SigmaIntensity));
+  MOCK_CONST_METHOD0(getBinCount, double());
+  MOCK_METHOD1(setBinCount, void(double m_BinCount));
+  MOCK_CONST_METHOD0(getGoniometerMatrix, Mantid::Kernel::Matrix<double>());
+  MOCK_METHOD1(setGoniometerMatrix,
+               void(Mantid::Kernel::Matrix<double> m_GoniometerMatrix));
+  MOCK_CONST_METHOD0(getBankName, std::string());
+  MOCK_CONST_METHOD0(getRow, int());
+  MOCK_CONST_METHOD0(getCol, int());
+  MOCK_CONST_METHOD0(getDetPos, Mantid::Kernel::V3D());
+  MOCK_CONST_METHOD0(getL1, double());
+  MOCK_CONST_METHOD0(getL2, double());
+  MOCK_CONST_METHOD0(getDetectorPosition, Mantid::Kernel::V3D());
+  MOCK_CONST_METHOD0(getDetectorPositionNoCheck, Mantid::Kernel::V3D());
+  MOCK_CONST_METHOD0(getPeakShape, const Mantid::Geometry::PeakShape &());
+};
 
-  /*------------------------------------------------------------
-  Mock IMDDimension
-  ------------------------------------------------------------*/
-  class MockIMDDimension : public Mantid::Geometry::IMDDimension 
-  {
-  public:
-    MOCK_CONST_METHOD0(getName,
-      std::string());
-    MOCK_CONST_METHOD0(getUnits,
-      const Mantid::Kernel::UnitLabel());
-    MOCK_CONST_METHOD0(getDimensionId,
-      std::string());
-    MOCK_CONST_METHOD0(getMaximum,
-      coord_t());
-    MOCK_CONST_METHOD0(getMinimum,
-      coord_t());
-    MOCK_CONST_METHOD0(getNBins,
-      size_t());
-    MOCK_CONST_METHOD0(toXMLString,
-      std::string());
-    MOCK_CONST_METHOD0(getIsIntegrated,
-      bool());
-    MOCK_CONST_METHOD1(getX,
-      coord_t(size_t ind));
-    MOCK_METHOD3(setRange,
-      void(size_t nBins, coord_t min, coord_t max));
-  };
+/*------------------------------------------------------------
+Mock MDGeometry
+------------------------------------------------------------*/
+class MockMDGeometry : public Mantid::API::MDGeometry {
+public:
+  MOCK_CONST_METHOD0(getNumDims, size_t());
+  MOCK_CONST_METHOD1(
+      getDimension,
+      boost::shared_ptr<const Mantid::Geometry::IMDDimension>(size_t));
+  virtual ~MockMDGeometry() {}
+};
 
+/*------------------------------------------------------------
+Mock IMDDimension
+------------------------------------------------------------*/
+class MockIMDDimension : public Mantid::Geometry::IMDDimension {
+public:
+  MOCK_CONST_METHOD0(getName, std::string());
+  MOCK_CONST_METHOD0(getUnits, const Mantid::Kernel::UnitLabel());
+  MOCK_CONST_METHOD0(getMDFrame, const Mantid::Geometry::MDFrame &());
+  MOCK_CONST_METHOD0(getMDUnits, const Mantid::Kernel::MDUnit &());
+  MOCK_CONST_METHOD0(getDimensionId, std::string());
+  MOCK_CONST_METHOD0(getMaximum, coord_t());
+  MOCK_CONST_METHOD0(getMinimum, coord_t());
+  MOCK_CONST_METHOD0(getNBins, size_t());
+  MOCK_CONST_METHOD0(toXMLString, std::string());
+  MOCK_CONST_METHOD0(getIsIntegrated, bool());
+  MOCK_CONST_METHOD1(getX, coord_t(size_t ind));
+  MOCK_METHOD3(setRange, void(size_t nBins, coord_t min, coord_t max));
+};
 }
 
 #endif
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
index d5fc3f1ecd90bf8286eb31eb5521fdab56cbfff8..c781ebe3bf3eac17f1056065fe625678b245eb4e 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
@@ -180,11 +180,14 @@ int vtkMDHWNexusReader::RequestInformation(
   
   m_presenter->executeLoadMetadata();
   setTimeRange(outputVector);
-  std::vector<int> extents = dynamic_cast<MDHWNexusLoadingPresenter*>(m_presenter)->getExtents();
-  outputVector->GetInformationObject(0)
-      ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
-            static_cast<int>(extents.size()));
-
+  MDHWNexusLoadingPresenter *castPresenter =
+      dynamic_cast<MDHWNexusLoadingPresenter *>(m_presenter);
+  if (castPresenter) {
+    std::vector<int> extents = castPresenter->getExtents();
+    outputVector->GetInformationObject(0)
+        ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
+              static_cast<int>(extents.size()));
+  }
   return 1;
 }
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
index 4da0e7596018b4c47c01891cd5bd2a6f6c62c97f..ad8e2080bfd5757de5c7e7329749aebb89fc43b1 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
@@ -234,12 +234,14 @@ int vtkMDHWSource::RequestInformation(vtkInformation *vtkNotUsed(request), vtkIn
     } else {
       m_presenter->executeLoadMetadata();
       setTimeRange(outputVector);
-      std::vector<int> extents =
-          dynamic_cast<MDHWInMemoryLoadingPresenter *>(m_presenter)
-              ->getExtents();
-      outputVector->GetInformationObject(0)
-          ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
-                static_cast<int>(extents.size()));
+      MDHWInMemoryLoadingPresenter *castPresenter =
+          dynamic_cast<MDHWInMemoryLoadingPresenter *>(m_presenter);
+      if (castPresenter) {
+        std::vector<int> extents = castPresenter->getExtents();
+        outputVector->GetInformationObject(0)
+            ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
+                  static_cast<int>(extents.size()));
+      }
       return 1;
     }
   } else //(m_presenter == NULL)
diff --git a/Code/Mantid/Vates/VatesAPI/src/Common.cpp b/Code/Mantid/Vates/VatesAPI/src/Common.cpp
index e2e19d031e714e363d3a70444b707b3583babcde..e48e5f16614c44d9e7be15f6977aff3dec902a9a 100644
--- a/Code/Mantid/Vates/VatesAPI/src/Common.cpp
+++ b/Code/Mantid/Vates/VatesAPI/src/Common.cpp
@@ -9,6 +9,7 @@
 #include "vtkPVChangeOfBasisHelper.h"
 
 #include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/regex.hpp>
 
 // using namespace Mantid::Geometry;
 namespace Mantid {
@@ -18,7 +19,11 @@ std::string makeAxisTitle(Dimension_const_sptr dim) {
   title += " (";
   title += dim->getUnits();
   title += ")";
-  return title;
+  // update inverse angstrom symbol so it is rendered in mathtex.
+  // Consider removing after ConvertToMD provides unit labels with latex
+  // symbols.
+  boost::regex re("A\\^-1");
+  return boost::regex_replace(title, re, "$\\\\AA^{-1}$");
 }
 
 void setAxisLabel(std::string metadataLabel, std::string labelString,
diff --git a/Code/Mantid/Vates/VatesAPI/test/DimensionPresenterTest.h b/Code/Mantid/Vates/VatesAPI/test/DimensionPresenterTest.h
index cef639df06443896de90b3213003f6ff0ed64ed9..3285bebef6dc854b6ac065a48cee367aa6ef5f5d 100644
--- a/Code/Mantid/Vates/VatesAPI/test/DimensionPresenterTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/DimensionPresenterTest.h
@@ -9,24 +9,21 @@
 #include "MantidKernel/UnitLabel.h"
 #include "gtest/gtest.h"
 #include "gmock/gmock.h"
- 
+
 using namespace Mantid;
 using namespace Mantid::VATES;
 using namespace Mantid::Geometry;
 using namespace testing;
 
-class DimensionPresenterTest: public CxxTest::TestSuite
-{
+class DimensionPresenterTest : public CxxTest::TestSuite {
 private:
-
-  class MockDimensionView : public DimensionView
-  {
+  class MockDimensionView : public DimensionView {
   public:
     MOCK_METHOD0(configureStrongly, void());
     MOCK_METHOD0(configureWeakly, void());
     MOCK_METHOD1(showAsNotIntegrated, void(VecIMDDimension_sptr));
     MOCK_METHOD0(showAsIntegrated, void());
-    MOCK_METHOD1(accept, void(DimensionPresenter*));
+    MOCK_METHOD1(accept, void(DimensionPresenter *));
     MOCK_CONST_METHOD0(getMinimum, float());
     MOCK_CONST_METHOD0(getMaximum, float());
     MOCK_CONST_METHOD0(getNBins, unsigned int());
@@ -38,49 +35,39 @@ private:
     ~MockDimensionView(){};
   };
 
-  class MockGeometryPresenter : public GeometryPresenter
-  {
+  class MockGeometryPresenter : public GeometryPresenter {
   public:
-    MOCK_METHOD1(dimensionRealigned, void(DimensionPresenter*));
-    MOCK_METHOD1(dimensionResized, void(DimensionPresenter*));
+    MOCK_METHOD1(dimensionRealigned, void(DimensionPresenter *));
+    MOCK_METHOD1(dimensionResized, void(DimensionPresenter *));
     MOCK_CONST_METHOD0(getNonIntegratedDimensions, VecIMDDimension_sptr());
     MOCK_CONST_METHOD0(getGeometryXML, std::string());
-    MOCK_METHOD1(acceptView, void(GeometryView*));
+    MOCK_METHOD1(acceptView, void(GeometryView *));
     MOCK_METHOD0(setModified, void());
     MOCK_METHOD0(setDimensionModeChanged, void());
     MOCK_CONST_METHOD0(getMappings, GeometryPresenter::MappingType());
-    ~MockGeometryPresenter(){}
+    ~MockGeometryPresenter() {}
   };
 
-    /// Mock IMDDimension allows tests to specify exact expected behavior of dependency.
+  /// Mock IMDDimension allows tests to specify exact expected behavior of
+  /// dependency.
   class MockIMDDimension : public IMDDimension {
   public:
-    MOCK_CONST_METHOD0(getName,
-      std::string());
-    MOCK_CONST_METHOD0(getUnits,
-      const Mantid::Kernel::UnitLabel());
-    MOCK_CONST_METHOD0(getDimensionId,
-      std::string());
-    MOCK_CONST_METHOD0(getMaximum,
-      coord_t());
-    MOCK_CONST_METHOD0(getMinimum,
-        coord_t());
-    MOCK_CONST_METHOD0(getNBins,
-      size_t());
-    MOCK_CONST_METHOD0(toXMLString,
-      std::string());
-    MOCK_CONST_METHOD0(getIsIntegrated,
-      bool());
-    MOCK_CONST_METHOD1(getX,
-        coord_t(size_t ind));
-    MOCK_METHOD3(setRange,
-      void(size_t, coord_t, coord_t));
+    MOCK_CONST_METHOD0(getName, std::string());
+    MOCK_CONST_METHOD0(getUnits, const Mantid::Kernel::UnitLabel());
+    MOCK_CONST_METHOD0(getMDFrame, const Mantid::Geometry::MDFrame &());
+    MOCK_CONST_METHOD0(getMDUnits, const Mantid::Kernel::MDUnit &());
+    MOCK_CONST_METHOD0(getDimensionId, std::string());
+    MOCK_CONST_METHOD0(getMaximum, coord_t());
+    MOCK_CONST_METHOD0(getMinimum, coord_t());
+    MOCK_CONST_METHOD0(getNBins, size_t());
+    MOCK_CONST_METHOD0(toXMLString, std::string());
+    MOCK_CONST_METHOD0(getIsIntegrated, bool());
+    MOCK_CONST_METHOD1(getX, coord_t(size_t ind));
+    MOCK_METHOD3(setRange, void(size_t, coord_t, coord_t));
   };
 
 public:
-
-  void testSetMapping()
-  {
+  void testSetMapping() {
     IMDDimension_sptr model(new MockIMDDimension());
     MockDimensionView view;
     MockGeometryPresenter gPresenter;
@@ -89,138 +76,174 @@ public:
     TSM_ASSERT("Should have no mapping", presenter.getMapping().empty());
 
     presenter.setMapping("Z-AXIS");
-    TSM_ASSERT_EQUALS("Should now have mapping set", "Z-AXIS", presenter.getMapping());
+    TSM_ASSERT_EQUALS("Should now have mapping set", "Z-AXIS",
+                      presenter.getMapping());
   }
 
-  void testWithoutProperConstructionThrows()
-  {
+  void testWithoutProperConstructionThrows() {
     IMDDimension_sptr model(new MockIMDDimension());
     MockDimensionView view;
     MockGeometryPresenter gPresenter;
     DimensionPresenter presenter(&view, &gPresenter);
 
-    TSM_ASSERT_THROWS("::acceptModel not called first, so should have thrown", presenter.updateModel(), std::runtime_error);
+    TSM_ASSERT_THROWS("::acceptModel not called first, so should have thrown",
+                      presenter.updateModel(), std::runtime_error);
   }
 
-  void testAcceptModelStrongly()
-  {
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getDimensionId()).Times(2).WillRepeatedly(Return("1"));
+  void testAcceptModelStrongly() {
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getDimensionId())
+        .Times(2)
+        .WillRepeatedly(Return("1"));
     EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(1);
     IMDDimension_sptr model(pMockDimension);
-    
+
     MockDimensionView view;
     EXPECT_CALL(view, configureStrongly()).Times(1);
     EXPECT_CALL(view, showAsNotIntegrated(_)).Times(1);
 
     MockGeometryPresenter gPresenter;
-    EXPECT_CALL(gPresenter, getNonIntegratedDimensions()).Times(1).WillOnce(Return(VecIMDDimension_sptr()));
-    
+    EXPECT_CALL(gPresenter, getNonIntegratedDimensions())
+        .Times(1)
+        .WillOnce(Return(VecIMDDimension_sptr()));
+
     DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelStrongly(model);
 
-    TSM_ASSERT_EQUALS("Applied model should be the same as the one provided", model->getDimensionId(), presenter.getModel()->getDimensionId());
+    TSM_ASSERT_EQUALS("Applied model should be the same as the one provided",
+                      model->getDimensionId(),
+                      presenter.getModel()->getDimensionId());
     TS_ASSERT(Mock::VerifyAndClearExpectations(pMockDimension));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&view));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
 
-  void testAcceptModelWeakly()
-  {
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getDimensionId()).Times(2).WillRepeatedly(Return("1"));
+  void testAcceptModelWeakly() {
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getDimensionId())
+        .Times(2)
+        .WillRepeatedly(Return("1"));
     EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(1);
     IMDDimension_sptr model(pMockDimension);
-    
+
     MockDimensionView view;
     EXPECT_CALL(view, configureWeakly()).Times(1);
     EXPECT_CALL(view, showAsNotIntegrated(_)).Times(1);
 
     MockGeometryPresenter gPresenter;
-    EXPECT_CALL(gPresenter, getNonIntegratedDimensions()).Times(1).WillOnce(Return(VecIMDDimension_sptr()));
-    
+    EXPECT_CALL(gPresenter, getNonIntegratedDimensions())
+        .Times(1)
+        .WillOnce(Return(VecIMDDimension_sptr()));
+
     DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelWeakly(model);
 
-    TSM_ASSERT_EQUALS("Applied model should be the same as the one provided", model->getDimensionId(), presenter.getModel()->getDimensionId());
+    TSM_ASSERT_EQUALS("Applied model should be the same as the one provided",
+                      model->getDimensionId(),
+                      presenter.getModel()->getDimensionId());
     TS_ASSERT(Mock::VerifyAndClearExpectations(pMockDimension));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&view));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
 
-  void testDriveViewToBeIntegrated()
-  {
+  void testDriveViewToBeIntegrated() {
     MockDimensionView view;
     EXPECT_CALL(view, configureStrongly()).Times(1);
     EXPECT_CALL(view, showAsIntegrated()).Times(2);
-    EXPECT_CALL(view, showAsNotIntegrated(_)).Times(0); //Explicitly should never use this.
+    EXPECT_CALL(view, showAsNotIntegrated(_))
+        .Times(0); // Explicitly should never use this.
     EXPECT_CALL(view, getIsIntegrated()).WillOnce(Return(true));
     EXPECT_CALL(view, getVisDimensionName()).Times(1);
 
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(1).WillRepeatedly(Return(true)); //Model says it's integrated
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getIsIntegrated())
+        .Times(1)
+        .WillRepeatedly(Return(true)); // Model says it's integrated
     Mantid::Geometry::IMDDimension_sptr model(pMockDimension);
 
     MockGeometryPresenter gPresenter;
     EXPECT_CALL(gPresenter, setModified()).Times(1);
 
-    DimensionPresenter presenter(&view, &gPresenter); 
+    DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelStrongly(model);
-    TSM_ASSERT_THROWS_NOTHING("A model exists on the presenter, updating should it should operate without exception.", presenter.updateModel());
-
+    TSM_ASSERT_THROWS_NOTHING("A model exists on the presenter, updating "
+                              "should it should operate without exception.",
+                              presenter.updateModel());
 
     TS_ASSERT(Mock::VerifyAndClearExpectations(pMockDimension));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&view));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
 
-  void testDriveViewToBeNotIntegrated()
-  {
+  void testDriveViewToBeNotIntegrated() {
     MockDimensionView view;
     EXPECT_CALL(view, configureStrongly()).Times(1);
     EXPECT_CALL(view, showAsNotIntegrated(_)).Times(2);
-    EXPECT_CALL(view, showAsIntegrated()).Times(0); //Explicitly should never use this
-    EXPECT_CALL(view, getIsIntegrated()).Times(AnyNumber()).WillRepeatedly(Return(false));//View is not integrated. 
-    EXPECT_CALL(view, getVisDimensionName()).Times(1); 
+    EXPECT_CALL(view, showAsIntegrated())
+        .Times(0); // Explicitly should never use this
+    EXPECT_CALL(view, getIsIntegrated())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(false)); // View is not integrated.
+    EXPECT_CALL(view, getVisDimensionName()).Times(1);
 
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(AnyNumber()).WillRepeatedly(Return(false));
-    Mantid::Geometry::IMDDimension_sptr model(pMockDimension); 
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getIsIntegrated())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(false));
+    Mantid::Geometry::IMDDimension_sptr model(pMockDimension);
 
     MockGeometryPresenter gPresenter;
-    EXPECT_CALL(gPresenter, getNonIntegratedDimensions()).Times(2).WillRepeatedly(Return(VecIMDDimension_sptr())) ; //Will ask the GeometryPresenter for non-integrated dimensions
+    EXPECT_CALL(gPresenter, getNonIntegratedDimensions())
+        .Times(2)
+        .WillRepeatedly(Return(VecIMDDimension_sptr())); // Will ask the
+                                                         // GeometryPresenter
+                                                         // for non-integrated
+                                                         // dimensions
     EXPECT_CALL(gPresenter, setModified()).Times(1);
     DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelStrongly(model);
-    
-    TSM_ASSERT_THROWS_NOTHING("A model exists on the presenter, updating should it should operate without exception.", presenter.updateModel());
+
+    TSM_ASSERT_THROWS_NOTHING("A model exists on the presenter, updating "
+                              "should it should operate without exception.",
+                              presenter.updateModel());
     TS_ASSERT(Mock::VerifyAndClearExpectations(pMockDimension));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&view));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
 
-  void testGetAppliedModelWhenViewIntegrated()
-  {
+  void testGetAppliedModelWhenViewIntegrated() {
     MockDimensionView view;
     EXPECT_CALL(view, configureStrongly()).Times(1);
     EXPECT_CALL(view, showAsIntegrated()).Times(1);
-    EXPECT_CALL(view, getIsIntegrated()).Times(1).WillRepeatedly(Return(true)); // view says it's integrated
+    EXPECT_CALL(view, getIsIntegrated())
+        .Times(1)
+        .WillRepeatedly(Return(true)); // view says it's integrated
     EXPECT_CALL(view, getMinimum()).Times(1).WillOnce(Return(0.0f));
     EXPECT_CALL(view, getMaximum()).Times(1).WillOnce(Return(2.0f));
-    EXPECT_CALL(view, getNBins()).Times(0); //Should never need number of bins because view says it's integrated.
-
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(1).WillRepeatedly(Return(true)); //Model says it's integrated
-    EXPECT_CALL(*pMockDimension, toXMLString()).WillOnce(Return("<Dimension ID=\"en\"><Name>Energy</Name><UpperBounds>150</UpperBounds><LowerBounds>0</LowerBounds><NumberOfBins>1</NumberOfBins></Dimension>"));
+    EXPECT_CALL(view, getNBins()).Times(0); // Should never need number of bins
+                                            // because view says it's
+                                            // integrated.
+
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getIsIntegrated())
+        .Times(1)
+        .WillRepeatedly(Return(true)); // Model says it's integrated
+    EXPECT_CALL(*pMockDimension, toXMLString())
+        .WillOnce(
+            Return("<Dimension "
+                   "ID=\"en\"><Name>Energy</Name><UpperBounds>150</"
+                   "UpperBounds><LowerBounds>0</LowerBounds><NumberOfBins>1</"
+                   "NumberOfBins></Dimension>"));
     Mantid::Geometry::IMDDimension_sptr model(pMockDimension);
 
     MockGeometryPresenter gPresenter;
 
-    DimensionPresenter presenter(&view, &gPresenter); 
+    DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelStrongly(model);
     Mantid::Geometry::IMDDimension_sptr product = presenter.getAppliedModel();
 
-    TSM_ASSERT_EQUALS("Wrong number of bins for an integrated dimension", 1, product->getNBins());
+    TSM_ASSERT_EQUALS("Wrong number of bins for an integrated dimension", 1,
+                      product->getNBins());
     TSM_ASSERT_EQUALS("Range max not set properly", 2, product->getMaximum());
     TSM_ASSERT_EQUALS("Range min not set properly", 0, product->getMinimum());
 
@@ -229,25 +252,39 @@ public:
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
 
-  void testHandleArgumentErrors()
-  {
+  void testHandleArgumentErrors() {
     MockDimensionView view;
     EXPECT_CALL(view, configureStrongly()).Times(AnyNumber());
     EXPECT_CALL(view, showAsIntegrated()).Times(AnyNumber());
-    EXPECT_CALL(view, getIsIntegrated()).Times(AtLeast(1)).WillRepeatedly(Return(false)); // view says it's integrated
-    EXPECT_CALL(view, getMinimum()).Times(AnyNumber()).WillRepeatedly(Return(10.0f)); //Ooops, min > max, this should be handled! 
-    EXPECT_CALL(view, getMaximum()).Times(AnyNumber()).WillRepeatedly(Return(2.0f));
-    EXPECT_CALL(view, getNBins()).Times(AnyNumber()); 
+    EXPECT_CALL(view, getIsIntegrated())
+        .Times(AtLeast(1))
+        .WillRepeatedly(Return(false)); // view says it's integrated
+    EXPECT_CALL(view, getMinimum())
+        .Times(AnyNumber())
+        .WillRepeatedly(
+            Return(10.0f)); // Ooops, min > max, this should be handled!
+    EXPECT_CALL(view, getMaximum())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(2.0f));
+    EXPECT_CALL(view, getNBins()).Times(AnyNumber());
     EXPECT_CALL(view, displayError(_)).Times(1);
 
-    MockIMDDimension* pMockDimension = new MockIMDDimension();
-    EXPECT_CALL(*pMockDimension, getIsIntegrated()).Times(AnyNumber()).WillRepeatedly(Return(true)); //Model says it's integrated
-    EXPECT_CALL(*pMockDimension, toXMLString()).Times(AnyNumber()).WillRepeatedly(Return("<Dimension ID=\"en\"><Name>Energy</Name><UpperBounds>150</UpperBounds><LowerBounds>0</LowerBounds><NumberOfBins>1</NumberOfBins></Dimension>"));
+    MockIMDDimension *pMockDimension = new MockIMDDimension();
+    EXPECT_CALL(*pMockDimension, getIsIntegrated())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(true)); // Model says it's integrated
+    EXPECT_CALL(*pMockDimension, toXMLString())
+        .Times(AnyNumber())
+        .WillRepeatedly(
+            Return("<Dimension "
+                   "ID=\"en\"><Name>Energy</Name><UpperBounds>150</"
+                   "UpperBounds><LowerBounds>0</LowerBounds><NumberOfBins>1</"
+                   "NumberOfBins></Dimension>"));
     Mantid::Geometry::IMDDimension_sptr model(pMockDimension);
 
     MockGeometryPresenter gPresenter;
 
-    DimensionPresenter presenter(&view, &gPresenter); 
+    DimensionPresenter presenter(&view, &gPresenter);
     presenter.acceptModelStrongly(model);
     presenter.getAppliedModel();
 
@@ -255,7 +292,6 @@ public:
     TS_ASSERT(Mock::VerifyAndClearExpectations(&view));
     TS_ASSERT(Mock::VerifyAndClearExpectations(&gPresenter));
   }
-
 };
 
 #endif
diff --git a/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h b/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
index efab02b5bb7d3f2b1e9e8b15eb76fd4c6ff91db1..83063f3b3a4a2b9d49743ea8e1b165f6f9cd606f 100644
--- a/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
@@ -175,13 +175,13 @@ void testAxisLabels()
   TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
   TSM_ASSERT_EQUALS("X Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForX"),
-                    "[H,0,0] (in 1.992 A^-1)");
+                    "[H,0,0] (in 1.992 $\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Y Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForY"),
-                    "[0,K,0] (in 1.992 A^-1)");
+                    "[0,K,0] (in 1.992 $\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Z Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForZ"),
-                    "[0,0,L] (in 1.087 A^-1)");
+                    "[0,0,L] (in 1.087 $\\AA^{-1}$)");
 
   TS_ASSERT(Mock::VerifyAndClearExpectations(view));
   TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
diff --git a/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h b/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
index 5864dac114190487acefe43b99713ff457ab2afb..682c63ed286759b4453d4fc0469eb04143db2b9d 100644
--- a/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
@@ -231,13 +231,13 @@ void testAxisLabels()
   TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
   TSM_ASSERT_EQUALS("X Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForX"),
-                    "qx (A^-1)");
+                    "qx ($\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Y Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForY"),
-                    "qy (A^-1)");
+                    "qy ($\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Z Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForZ"),
-                    "qz (A^-1)");
+                    "qz ($\\AA^{-1}$)");
 
   TS_ASSERT(Mock::VerifyAndClearExpectations(view));
   TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
diff --git a/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst b/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
index 46a308aed122ea2f3bc5cb3dcb58d7be55a742b6..f03b34bd38e260751af1a9bffc47706ab7904982 100644
--- a/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
@@ -85,11 +85,11 @@ Usage
    # # To generate the pre-calculated features (integration and curves), for a new
    # Vanadium run, and apply the corrections on a workspace:
    #             
-   # data_ws = Load('ENGINX00213855.nxs')
+   # sample_ws = Load('ENGINX00213855.nxs')
    # van_ws = Load('ENGINX00236516.nxs')
-   # EnggVanadiumCorrections(Workspace = data_ws, VanadiumWorkspace = van_ws
-   #                         IntegrationWorkspace = 'integ_ws',
-   #                         CurvesWorkspace = 'curves_ws')
+   # EnggVanadiumCorrections(Workspace = sample_ws, VanadiumWorkspace = van_ws
+   #                         OutIntegrationWorkspace = 'integ_ws',
+   #                         OutCurvesWorkspace = 'curves_ws')
    #
    # # Now you can save the two pre-calculated features / workspaces:
    # SaveNexus(InputWorkspace='integ_ws',
diff --git a/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst b/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
index a9146f232eb1ae29959d9daf7218a37395d379c8..8f7bb7a8828ee13b0ce86e3f2ae6e2eb30cc2415 100644
--- a/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
@@ -20,9 +20,28 @@ Assumptions on data format
 --------------------------
 
 The ``Directory`` property must be given the directory that is produced when you
-extract the ``.tar`` archive from nMMOLDYN without modifications which must only
+extract the ``.tar`` archive from nMOLDYN without modifications which must only
 contain the data files produces from a single export operation from nMOLDYN.
 
+Axis Unit Conversions
+---------------------
+
+When loading certain axis from nMOLDYN 4 the units may be converted to an
+equivalent unit in Mantid. The possible conversions are shown in the table
+below:
+
++-----------+---------+------------------+--------------+
+| nMOLDYN             | Mantid                          |
++-----------+---------+------------------+--------------+
+| name      | unit    | name             | unit         |
++===========+=========+==================+==============+
+| frequency | THz     | Energy           | meV          |
++-----------+---------+------------------+--------------+
+| q         | nm**-1  | MomentumTransfer | Angstrom**-1 |
++-----------+---------+------------------+--------------+
+| Time      | pSecond | TOF              | uSecond      |
++-----------+---------+------------------+--------------+
+
 Usage
 -----
 
diff --git a/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst b/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst
index cef254924362e5a528ff2e584928f9a38f426417..e3ef0a364c7e244c4be1dd06bdf02641dfcabcd4 100644
--- a/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst
@@ -38,7 +38,7 @@ Usage
    wsName = "outputWorkspace"
 
    # "D" is not included in the algorithm params list
-   ProcessIndirectFitParameters(tws, 'A', "B", wsName)
+   ProcessIndirectFitParameters(tws, 'A', "B", OutputWorkspace=wsName)
 
    wsOut = mtd[wsName]
 
diff --git a/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst b/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
index 3fd5521c20df58b5a7fd144e4e1597eb01a25a03..ec913ce7281eea5bf0494b29fe38c99d81375ce1 100644
--- a/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
@@ -13,7 +13,7 @@ Calculates the Q-resolution per pixel according to Mildner and Carpenter equatio
 
 .. math:: (\sigma_Q )^2 = \frac{4\pi^2}{12\lambda^2} [ 3(\frac{R_1}{L_1})^2 + 3(\frac{R_2}{L_3})^2 + (\frac{\Delta R}{L_2})^2 ] + Q^2(\frac{\sigma_{\lambda}}{\lambda})^2
 
-where :math:`L1` and :math:`L2` are the primary and secondary flight-paths respectively and 
+where :math:`L1` and :math:`L2`  are the collimation length and sample-to-detector distance respectively and 
 
 .. math:: \frac{1}{L_3} = \frac{1}{L_1} + \frac{1}{L_2}
 
@@ -25,6 +25,12 @@ where :math:`\sigma_{\lambda}` is the overall wavelength std from TOF binning
 and moderator, :math:`\Delta \lambda` is taken from the binning of the InputWorkspace 
 and the :math:`\sigma_{moderator}` is the wavelenght spread from the moderator.
 
+where :math:`\sigma_{\lambda}` is the effective standard deviation, and :math:`\Delta \lambda`,
+originating from the TOF binning of the InputWorkspace, is the (rectangular)
+width, of the moderator wavelength distribution. :math:`\sigma_{moderator}` is the
+moderator time spread (the variation in time for the moderator to emit neutrons
+of a given wavelength).
+
 :math:`\sigma_Q` is returned as the y-values of the InputWorkspace, and the 
 remaining variables in the main equation above are related to parameters of this
 algorithm as follows:
@@ -35,7 +41,7 @@ algorithm as follows:
 * :math:`\sigma_{moderator}` equals SigmaModerator  
 * :math:`\L_1` equals CollimationLength
 
-:math:`\lambda` in the equation is the midtpoint of wavelength 
+:math:`\lambda` in the equation is the midpoint of wavelength 
 histogram bin values of InputWorkspace.
 
 Collimation length :math:`L_1` in metres in the equation here is the distance between the
@@ -48,6 +54,7 @@ scalar :math:`Q`, and making some small angle approximations. Results on higher
 may not be accurate. For data reduction sliced in different directions on the detector
 (e.g. GISANS) adjust the calling parameters to suit the collimation in that direction.
 
+This version of the algorithm neglects wavelength-dependent detector detection depth effects.
 
 .. categories::
 
diff --git a/Code/Mantid/scripts/Engineering/EnggUtils.py b/Code/Mantid/scripts/Engineering/EnggUtils.py
index 410ea6ed66cf3ddb0fd5231f8be0ce211f4596f3..aaca870ea651dbff4c7d3e9368cbf02da44a4ae3 100644
--- a/Code/Mantid/scripts/Engineering/EnggUtils.py
+++ b/Code/Mantid/scripts/Engineering/EnggUtils.py
@@ -149,10 +149,17 @@ def getDetIDsForBank(bank):
 
     alg = AlgorithmManager.create('LoadDetectorsGroupingFile')
     alg.setProperty('InputFile', groupingFilePath)
-    alg.setProperty('OutputWorkspace', '__EnginXGrouping')
+    grpName = '__EnginXGrouping'
+    alg.setProperty('OutputWorkspace', grpName)
     alg.execute()
 
-    grouping = mtd['__EnginXGrouping']
+    # LoadDetectorsGroupingFile produces a 'Grouping' workspace.
+    # PropertyWithValue<GroupingWorkspace> not working (GitHub issue 13437)
+    # => cannot run as child and get outputworkspace property properly
+    if not AnalysisDataService.doesExist(grpName):
+        raise RuntimeError('LoadDetectorsGroupingFile did not run correctly. Could not '
+                           'find its output workspace: ' + grpName)
+    grouping = mtd[grpName]
 
     detIDs = set()
 
diff --git a/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui b/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
index 1d6c9a96615e1841de2b1937fcd192a6f99a0a6b..9c54a0c41fcf40bad9046df36dad1d195f1a8ffb 100644
--- a/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
+++ b/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>408</width>
-    <height>262</height>
+    <width>400</width>
+    <height>225</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -17,9 +17,22 @@
    </size>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>Error</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="0">
+    <spacer name="verticalSpacer_3">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>17</width>
+       <height>37</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
    <item row="0" column="0">
     <layout class="QVBoxLayout" name="verticalLayout_3">
      <item>
@@ -210,19 +223,6 @@
      </item>
     </layout>
    </item>
-   <item row="1" column="0">
-    <spacer name="verticalSpacer_3">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <resources/>
diff --git a/Code/Mantid/scripts/FilterEvents/MainWindow.ui b/Code/Mantid/scripts/FilterEvents/MainWindow.ui
index 9ca23e97f14df047496de79e7bd5eb06462b8f1e..b1289d6367a9d4201562c0f9ebff02e92de1c229 100644
--- a/Code/Mantid/scripts/FilterEvents/MainWindow.ui
+++ b/Code/Mantid/scripts/FilterEvents/MainWindow.ui
@@ -6,1344 +6,1363 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1332</width>
-    <height>1259</height>
+    <width>729</width>
+    <height>915</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>MainWindow</string>
+   <string>Filter Events Interface</string>
   </property>
   <widget class="QWidget" name="centralwidget">
-   <layout class="QGridLayout" name="gridLayout">
-    <item row="0" column="0">
-     <layout class="QVBoxLayout" name="verticalLayout_5">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label_logname_2">
-          <property name="minimumSize">
-           <size>
-            <width>40</width>
-            <height>0</height>
-           </size>
-          </property>
-          <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="whatsThis">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Label for file name or run number&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="text">
-           <string>File / Run </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_5">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit">
-          <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Run number should be InstrumentName_RunNumber (for example, NOM_11788)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_browse">
-          <property name="text">
-           <string>Browse</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_6">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_load">
-          <property name="text">
-           <string>Load</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Fixed</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>5</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QPushButton" name="pushButton_refreshWS">
-          <property name="maximumSize">
-           <size>
-            <width>200</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Refresh</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_7">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QComboBox" name="comboBox">
-          <property name="minimumSize">
-           <size>
-            <width>80</width>
-            <height>0</height>
-           </size>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_8">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_3">
-          <property name="maximumSize">
-           <size>
-            <width>200</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Use</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer_2">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Preferred</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>40</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="label_logname">
-          <property name="maximumSize">
-           <size>
-            <width>160</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Log Name</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_lognamevalue">
-          <property name="text">
-           <string>?</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_25">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <item>
-         <widget class="MplFigureCanvas" name="graphicsView"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_9">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <layout class="QVBoxLayout" name="verticalLayout">
-          <item>
-           <widget class="QSlider" name="verticalSlider">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="tickPosition">
-             <enum>QSlider::TicksAbove</enum>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QSlider" name="verticalSlider_2">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="tickPosition">
-             <enum>QSlider::TicksBelow</enum>
+   <widget class="QPushButton" name="helpBtn">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>870</y>
+      <width>20</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>?</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="layoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>721</width>
+      <height>861</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="verticalLayout_5">
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="QLabel" name="label_logname_2">
+         <property name="minimumSize">
+          <size>
+           <width>40</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="whatsThis">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Label for file name or run number&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="text">
+          <string>File / Run </string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_5">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Run number should be InstrumentName_RunNumber (for example, NOM_11788)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_browse">
+         <property name="text">
+          <string>Browse</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_6">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_load">
+         <property name="text">
+          <string>Load</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>13</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <item>
+        <widget class="QPushButton" name="pushButton_refreshWS">
+         <property name="maximumSize">
+          <size>
+           <width>200</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Refresh</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_7">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QComboBox" name="comboBox">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>0</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_8">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_3">
+         <property name="maximumSize">
+          <size>
+           <width>200</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Use</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Preferred</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>40</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_3">
+       <item>
+        <widget class="QLabel" name="label_logname">
+         <property name="maximumSize">
+          <size>
+           <width>160</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Log Name</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_lognamevalue">
+         <property name="text">
+          <string>?</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_25">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_4">
+       <item>
+        <widget class="MplFigureCanvas" name="graphicsView"/>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_9">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QSlider" name="verticalSlider">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksAbove</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSlider" name="verticalSlider_2">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksBelow</enum>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_5">
+       <item>
+        <widget class="QSlider" name="horizontalSlider">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="tickPosition">
+          <enum>QSlider::TicksAbove</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_10">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QSlider" name="horizontalSlider_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="tickPosition">
+          <enum>QSlider::TicksAbove</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_11">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Preferred</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>40</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
+       <item>
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>Starting Time</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_3"/>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_setT0">
+         <property name="text">
+          <string>Set</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_12">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_4">
+         <property name="text">
+          <string>Stopping Time</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_4"/>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_setTf">
+         <property name="text">
+          <string>Set</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_7">
+       <item>
+        <widget class="QLabel" name="label_outwsname">
+         <property name="text">
+          <string>Output Name</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_outwsname"/>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_13">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_5">
+         <property name="text">
+          <string>Splitter Title</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_title"/>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <widget class="QTabWidget" name="filterTab">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>100</height>
+        </size>
+       </property>
+       <property name="currentIndex">
+        <number>0</number>
+       </property>
+       <widget class="QWidget" name="tab">
+        <attribute name="title">
+         <string>Filter By Log</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <item row="0" column="0">
+          <widget class="QScrollArea" name="scrollArea">
+           <property name="widgetResizable">
+            <bool>true</bool>
+           </property>
+           <widget class="QWidget" name="scrollAreaWidgetContents">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>693</width>
+              <height>234</height>
+             </rect>
             </property>
+            <layout class="QGridLayout" name="gridLayout_5">
+             <item row="0" column="0">
+              <layout class="QVBoxLayout" name="verticalLayout_2">
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_8">
+                 <item>
+                  <widget class="QLabel" name="label_7">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Sample Log</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_2"/>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_14">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_4">
+                   <property name="text">
+                    <string>Plot</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_24">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_9">
+                 <item>
+                  <widget class="QLabel" name="label_mean">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Mean</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_meanvalue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_avg">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Time Average</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_timeAvgValue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_26">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_10">
+                 <item>
+                  <widget class="QLabel" name="label_freq">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Frequency</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_freqValue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_logsize">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Size</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_logsizevalue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_11">
+                 <item>
+                  <widget class="QLabel" name="label_8">
+                   <property name="text">
+                    <string>Minimum Value</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_5"/>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_15">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_9">
+                   <property name="text">
+                    <string>Maximum Value</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_6"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_12">
+                 <item>
+                  <widget class="QLabel" name="label_10">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Step Size</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_7">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_16">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_11">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Value Change Direction</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_4"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_13">
+                 <item>
+                  <widget class="QLabel" name="label_19">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Value Tolerance</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_8">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_17">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_21">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Boundary</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_5"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_14">
+                 <item>
+                  <widget class="QLabel" name="label_20">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Time Tolerance</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_9">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_18">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_filterLog">
+                   <property name="minimumSize">
+                    <size>
+                     <width>200</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Filter</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_23">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </item>
+            </layout>
            </widget>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_5">
-        <item>
-         <widget class="QSlider" name="horizontalSlider">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="tickPosition">
-           <enum>QSlider::TicksAbove</enum>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_10">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QSlider" name="horizontalSlider_2">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="tickPosition">
-           <enum>QSlider::TicksAbove</enum>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_11">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer_3">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Preferred</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>40</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_6">
-        <item>
-         <widget class="QLabel" name="label_3">
-          <property name="text">
-           <string>Starting Time</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_3"/>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_setT0">
-          <property name="text">
-           <string>Set</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_12">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_4">
-          <property name="text">
-           <string>Stopping Time</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_4"/>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_setTf">
-          <property name="text">
-           <string>Set</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_7">
-        <item>
-         <widget class="QLabel" name="label_outwsname">
-          <property name="text">
-           <string>Output Name</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_outwsname"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_13">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_5">
-          <property name="text">
-           <string>Splitter Title</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_title"/>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <widget class="QTabWidget" name="filterTab">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>100</height>
-         </size>
-        </property>
-        <property name="currentIndex">
-         <number>0</number>
-        </property>
-        <widget class="QWidget" name="tab">
-         <attribute name="title">
-          <string>Filter By Log</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_2">
-          <item row="0" column="0">
-           <widget class="QScrollArea" name="scrollArea">
-            <property name="widgetResizable">
-             <bool>true</bool>
-            </property>
-            <widget class="QWidget" name="scrollAreaWidgetContents">
-             <property name="geometry">
-              <rect>
-               <x>0</x>
-               <y>0</y>
-               <width>1288</width>
-               <height>383</height>
-              </rect>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab_2">
+        <attribute name="title">
+         <string>Filter By Time</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_3">
+         <item row="0" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_15">
+           <item>
+            <widget class="QLabel" name="label_6">
+             <property name="maximumSize">
+              <size>
+               <width>160</width>
+               <height>16777215</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Time Interval</string>
              </property>
-             <layout class="QGridLayout" name="gridLayout_5">
-              <item row="0" column="0">
-               <layout class="QVBoxLayout" name="verticalLayout_2">
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_8">
-                  <item>
-                   <widget class="QLabel" name="label_7">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Sample Log</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_2"/>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_14">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_4">
-                    <property name="text">
-                     <string>Plot</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_24">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_9">
-                  <item>
-                   <widget class="QLabel" name="label_mean">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Mean</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_meanvalue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_avg">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Time Average</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_timeAvgValue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_26">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_10">
-                  <item>
-                   <widget class="QLabel" name="label_freq">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Frequency</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_freqValue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_logsize">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Size</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_logsizevalue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_11">
-                  <item>
-                   <widget class="QLabel" name="label_8">
-                    <property name="text">
-                     <string>Minimum Value</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_5"/>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_15">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_9">
-                    <property name="text">
-                     <string>Maximum Value</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_6"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_12">
-                  <item>
-                   <widget class="QLabel" name="label_10">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Step Size</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_7">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_16">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_11">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Value Change Direction</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_4"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_13">
-                  <item>
-                   <widget class="QLabel" name="label_19">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Value Tolerance</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_8">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_17">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_21">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Boundary</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_5"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_14">
-                  <item>
-                   <widget class="QLabel" name="label_20">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Time Tolerance</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_9">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_18">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_filterLog">
-                    <property name="minimumSize">
-                     <size>
-                      <width>200</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Filter</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_23">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-               </layout>
-              </item>
-             </layout>
             </widget>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="tab_2">
-         <attribute name="title">
-          <string>Filter By Time</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_3">
-          <item row="0" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_15">
-            <item>
-             <widget class="QLabel" name="label_6">
-              <property name="maximumSize">
-               <size>
-                <width>160</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>Time Interval</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_2">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Preferred</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QLineEdit" name="lineEdit_timeInterval">
-              <property name="maximumSize">
-               <size>
-                <width>200</width>
-                <height>16777215</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QPushButton" name="pushButton_filterTime">
-              <property name="minimumSize">
-               <size>
-                <width>200</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>Filter</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_19">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Preferred</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="tab_3">
-         <attribute name="title">
-          <string>Advanced Setup</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_4">
-          <item row="0" column="0">
-           <widget class="QScrollArea" name="scrollArea_2">
-            <property name="widgetResizable">
-             <bool>true</bool>
-            </property>
-            <widget class="QWidget" name="scrollAreaWidgetContents_2">
-             <property name="geometry">
-              <rect>
-               <x>0</x>
-               <y>0</y>
-               <width>1288</width>
-               <height>383</height>
-              </rect>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
              </property>
-             <layout class="QGridLayout" name="gridLayout_6">
-              <item row="0" column="0">
-               <layout class="QVBoxLayout" name="verticalLayout_4">
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_16">
-                  <item>
-                   <widget class="QLabel" name="label_12">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>TOF Correction To Sample</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_tofCorr">
-                    <item>
-                     <property name="text">
-                      <string>None</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Elastic</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Direct</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Indirect</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Customized</string>
-                     </property>
-                    </item>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_20">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_17">
-                  <item>
-                   <widget class="QLabel" name="label_Ei">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Incident Energy</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_Ei">
-                    <property name="maximumSize">
-                     <size>
-                      <width>400</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_21">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_18">
-                  <item>
-                   <widget class="QLabel" name="label_Ei_2">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>TOF Correction Workspace</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_corrWS"/>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_refreshCorrWSList">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Refresh</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_22">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="Line" name="line">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_19">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_fastLog">
-                    <property name="font">
-                     <font>
-                      <weight>75</weight>
-                      <bold>true</bold>
-                      <strikeout>false</strikeout>
-                     </font>
-                    </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Preferred</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="lineEdit_timeInterval">
+             <property name="maximumSize">
+              <size>
+               <width>200</width>
+               <height>16777215</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="pushButton_filterTime">
+             <property name="minimumSize">
+              <size>
+               <width>200</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Filter</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_19">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Preferred</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab_3">
+        <attribute name="title">
+         <string>Advanced Setup</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_4">
+         <item row="0" column="0">
+          <widget class="QScrollArea" name="scrollArea_2">
+           <property name="widgetResizable">
+            <bool>true</bool>
+           </property>
+           <widget class="QWidget" name="scrollAreaWidgetContents_2">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>693</width>
+              <height>234</height>
+             </rect>
+            </property>
+            <layout class="QGridLayout" name="gridLayout_6">
+             <item row="0" column="0">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_16">
+                 <item>
+                  <widget class="QLabel" name="label_12">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>TOF Correction To Sample</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_tofCorr">
+                   <item>
                     <property name="text">
-                     <string>Fast Log</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_doParallel">
-                    <property name="font">
-                     <font>
-                      <weight>75</weight>
-                      <bold>true</bold>
-                     </font>
+                     <string>None</string>
                     </property>
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Generate Filter In Parallel</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="Line" name="line_2">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_20">
-                  <item>
-                   <widget class="QLabel" name="label_13">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
+                     <string>Elastic</string>
                     </property>
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Spectrum without Detector</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_3">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Fixed</enum>
+                     <string>Direct</string>
                     </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_skipSpectrum">
-                    <property name="maximumSize">
-                     <size>
-                      <width>600</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <item>
-                     <property name="text">
-                      <string>Skip</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Skip only if TOF correction</string>
-                     </property>
-                    </item>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_4">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_21">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_filterByPulse">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Filter By Pulse Time</string>
+                     <string>Indirect</string>
                     </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_from1">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Output Workspace Indexed From 1</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_22">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_groupWS">
+                     <string>Customized</string>
+                    </property>
+                   </item>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_20">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_17">
+                 <item>
+                  <widget class="QLabel" name="label_Ei">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Incident Energy</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_Ei">
+                   <property name="maximumSize">
+                    <size>
+                     <width>400</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_21">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_18">
+                 <item>
+                  <widget class="QLabel" name="label_Ei_2">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>TOF Correction Workspace</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_corrWS"/>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_refreshCorrWSList">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Refresh</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_22">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="Line" name="line">
+                 <property name="orientation">
+                  <enum>Qt::Horizontal</enum>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_19">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_fastLog">
+                   <property name="font">
+                    <font>
+                     <weight>75</weight>
+                     <bold>true</bold>
+                     <strikeout>false</strikeout>
+                    </font>
+                   </property>
+                   <property name="text">
+                    <string>Fast Log</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_doParallel">
+                   <property name="font">
+                    <font>
+                     <weight>75</weight>
+                     <bold>true</bold>
+                    </font>
+                   </property>
+                   <property name="text">
+                    <string>Generate Filter In Parallel</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="Line" name="line_2">
+                 <property name="orientation">
+                  <enum>Qt::Horizontal</enum>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_20">
+                 <item>
+                  <widget class="QLabel" name="label_13">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Spectrum without Detector</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_3">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Fixed</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_skipSpectrum">
+                   <property name="maximumSize">
+                    <size>
+                     <width>600</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <item>
                     <property name="text">
-                     <string>Group Output Workspace</string>
+                     <string>Skip</string>
                     </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_splitLog">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Split Sample Logs</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-               </layout>
-              </item>
-             </layout>
-            </widget>
+                     <string>Skip only if TOF correction</string>
+                    </property>
+                   </item>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_4">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_21">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_filterByPulse">
+                   <property name="text">
+                    <string>Filter By Pulse Time</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_from1">
+                   <property name="text">
+                    <string>Output Workspace Indexed From 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_22">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_groupWS">
+                   <property name="text">
+                    <string>Group Output Workspace</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_splitLog">
+                   <property name="text">
+                    <string>Split Sample Logs</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </item>
+            </layout>
            </widget>
-          </item>
-         </layout>
-        </widget>
+          </widget>
+         </item>
+        </layout>
        </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
+      </widget>
+     </item>
+    </layout>
+   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>1332</width>
-     <height>25</height>
+     <width>729</width>
+     <height>21</height>
     </rect>
    </property>
   </widget>
@@ -1356,6 +1375,52 @@
    <header>MplFigureCanvas.h</header>
   </customwidget>
  </customwidgets>
+ <tabstops>
+  <tabstop>helpBtn</tabstop>
+  <tabstop>pushButton_browse</tabstop>
+  <tabstop>pushButton_load</tabstop>
+  <tabstop>pushButton_refreshWS</tabstop>
+  <tabstop>comboBox</tabstop>
+  <tabstop>pushButton_3</tabstop>
+  <tabstop>graphicsView</tabstop>
+  <tabstop>verticalSlider</tabstop>
+  <tabstop>verticalSlider_2</tabstop>
+  <tabstop>horizontalSlider</tabstop>
+  <tabstop>horizontalSlider_2</tabstop>
+  <tabstop>lineEdit_3</tabstop>
+  <tabstop>pushButton_setT0</tabstop>
+  <tabstop>lineEdit_4</tabstop>
+  <tabstop>pushButton_setTf</tabstop>
+  <tabstop>lineEdit_outwsname</tabstop>
+  <tabstop>lineEdit_title</tabstop>
+  <tabstop>filterTab</tabstop>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>comboBox_2</tabstop>
+  <tabstop>pushButton_4</tabstop>
+  <tabstop>lineEdit_5</tabstop>
+  <tabstop>lineEdit_6</tabstop>
+  <tabstop>lineEdit_7</tabstop>
+  <tabstop>comboBox_4</tabstop>
+  <tabstop>lineEdit_8</tabstop>
+  <tabstop>comboBox_5</tabstop>
+  <tabstop>lineEdit_9</tabstop>
+  <tabstop>pushButton_filterLog</tabstop>
+  <tabstop>lineEdit_timeInterval</tabstop>
+  <tabstop>pushButton_filterTime</tabstop>
+  <tabstop>scrollArea_2</tabstop>
+  <tabstop>comboBox_tofCorr</tabstop>
+  <tabstop>lineEdit_Ei</tabstop>
+  <tabstop>comboBox_corrWS</tabstop>
+  <tabstop>pushButton_refreshCorrWSList</tabstop>
+  <tabstop>checkBox_fastLog</tabstop>
+  <tabstop>checkBox_doParallel</tabstop>
+  <tabstop>comboBox_skipSpectrum</tabstop>
+  <tabstop>checkBox_filterByPulse</tabstop>
+  <tabstop>checkBox_from1</tabstop>
+  <tabstop>checkBox_groupWS</tabstop>
+  <tabstop>checkBox_splitLog</tabstop>
+  <tabstop>lineEdit</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py b/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
index 8e3e041c53879c90cd90492303423a067646503a..176ff8f55973b1224f44fb838fc81042dbf9fbc8 100644
--- a/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
+++ b/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
@@ -11,6 +11,7 @@ from matplotlib.pyplot import setp
 import mantid
 import mantid.simpleapi as api
 import mantid.kernel
+from mantid.kernel import Logger
 from mantid.simpleapi import AnalysisDataService
 
 from mantid.kernel import ConfigService
@@ -210,6 +211,9 @@ class MainWindow(QtGui.QMainWindow):
 
         self.connect(self.ui.pushButton_filterLog, SIGNAL('clicked()'), self.filterByLogValue)
 
+        #Set up help button
+        self.connect(self.ui.helpBtn, QtCore.SIGNAL('clicked()'), self.helpClicked)
+
         # Set up vertical slide
         self._upperSlideValue = 99
         self._lowerSlideValue = 0
@@ -226,6 +230,7 @@ class MainWindow(QtGui.QMainWindow):
 
         # Set up for filtering (advanced setup)
         self._tofcorrection = False
+        self.ui.checkBox_fastLog.setChecked(False)
         self.ui.checkBox_filterByPulse.setChecked(False)
         self.ui.checkBox_from1.setChecked(False)
         self.ui.checkBox_groupWS.setChecked(True)
@@ -346,7 +351,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set the starting time and left slide bar
         """
         inps = str(self.ui.lineEdit_3.text())
-        print "Starting time = %s" % (inps)
+        info_msg = "Starting time = %s" % (inps)
+        Logger("Filter_Events").information(info_msg)
 
         xlim = self.ui.mainplot.get_xlim()
         if inps == "":
@@ -357,7 +363,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         ileftvalue = int( (newtime0-xlim[0])/(xlim[1] - xlim[0])*100 )
-        print "iLeftSlide = %d" % (ileftvalue)
+        debug_msg = "iLeftSlide = %s" % str(ileftvalue)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Skip if same as origina
         if ileftvalue == self._leftSlideValue:
@@ -376,7 +383,8 @@ class MainWindow(QtGui.QMainWindow):
 
         if resetT is True:
             newtime0 = xlim[0] + ileftvalue*(xlim[1]-xlim[0])*0.01
-        print "Corrected iLeftSlide = %d (vs. right = %d)" % (ileftvalue, self._rightSlideValue)
+        info_msg = "Corrected iLeftSlide = %s (vs. right = %s)" % (str(ileftvalue), str(self._rightSlideValue))
+        Logger("Filter_Events").information(info_msg)
 
         # Move the slide bar (left)
         self._leftSlideValue = ileftvalue
@@ -427,7 +435,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set the starting time and left slide bar
         """
         inps = str(self.ui.lineEdit_4.text())
-        print "Stopping time = %s" % (inps)
+        info_msg = "Stopping time = %s" % (inps)
+        Logger("Filter_Events").information(info_msg)
 
         xlim = self.ui.mainplot.get_xlim()
         if inps == "":
@@ -439,7 +448,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         irightvalue = int( (newtimef-xlim[0])/(xlim[1] - xlim[0])*100 )
-        print "iRightSlide = %d" % (irightvalue)
+        info_msg = "iRightSlide = %s" % str(irightvalue)
+        Logger("Filter_Events").information(info_msg)
 
         # Return if no change
         if irightvalue == self._rightSlideValue:
@@ -481,7 +491,8 @@ class MainWindow(QtGui.QMainWindow):
         Triggered by a change in Qt Widget.  NO EVENT is required.
         """
         inewy = self.ui.verticalSlider_2.value()
-        print "LowerSlider is set with value %d  vs. class variable %d" % (inewy, self._lowerSlideValue)
+        debug_msg = "LowerSlFider is set with value %s  vs. class variable %s" % (str(inewy), str(self._lowerSlideValue))
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return with no change
         if inewy == self._lowerSlideValue:
@@ -518,7 +529,8 @@ class MainWindow(QtGui.QMainWindow):
     def set_minLogValue(self):
         """ Set the starting time and left slide bar
         """
-        print "Minimum Log Value = %s" %(str(self.ui.lineEdit_5.text()))
+        debug_msg = "Minimum Log Value = %s" %(str(self.ui.lineEdit_5.text()))
+        Logger("Filter_Events").debug(debug_msg)
 
         ylim = self.ui.mainplot.get_ylim()
 
@@ -531,7 +543,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         iminlogval = int( (newminY-ylim[0])/(ylim[1] - ylim[0])*100 )
-        print "ilowerSlide = %d" % (iminlogval)
+        debug_msg = "ilowerSlide = %s" % str(iminlogval)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return if no change
         if iminlogval == self._lowerSlideValue:
@@ -556,7 +569,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Move the slide bar (lower)
         self._lowerSlideValue = iminlogval
-        print "LineEdit5 set slide to %d" % (self._lowerSlideValue)
+        debug_msg = "LineEdit5 set slide to %s" % str(self._lowerSlideValue)
+        Logger("Filter_Events").debug(debug_msg)
         self.ui.verticalSlider_2.setValue(self._lowerSlideValue)
 
         # Reset line Edit if using default
@@ -605,7 +619,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set maximum log value from line-edit
         """
         inps = str(self.ui.lineEdit_6.text())
-        print "Maximum Log Value = %s" %(inps)
+        debug_msg = "Maximum Log Value = %s" %(inps)
+        Logger("Filter_Events").debug(debug_msg)
 
         ylim = self.ui.mainplot.get_ylim()
         if inps == "":
@@ -617,7 +632,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         imaxlogval = int( (newmaxY-ylim[0])/(ylim[1] - ylim[0])*100 )
-        print "iUpperSlide = %d" % (imaxlogval)
+        debug_msg = "iUpperSlide = %s" % str(imaxlogval)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return if no change
         if imaxlogval == self._upperSlideValue:
@@ -661,7 +677,9 @@ class MainWindow(QtGui.QMainWindow):
 
         self.ui.lineEdit.setText(str(filename))
 
-        # print "Selected file: ", filename
+        info_msg = "Selected file: %s." % str(filename)
+        Logger("Filter_Events").information(info_msg)
+
 
         return
 
@@ -679,9 +697,9 @@ class MainWindow(QtGui.QMainWindow):
 
         dataws = self._loadFile(str(filename))
         if dataws is None:
-            errmsg = "Unable to locate run %s in default directory %s." % (filename, self._defaultdir)
-            print errmsg
-            self._setErrorMsg(errmsg)
+            error_msg = "Unable to locate run %s in default directory %s." % (filename, self._defaultdir)
+            Logger("Filter_Events").error(error_msg)
+            self._setErrorMsg(error_msg)
         else:
             self._importDataWorkspace(dataws)
             self._defaultdir = os.path.dirname(str(filename))
@@ -724,9 +742,10 @@ class MainWindow(QtGui.QMainWindow):
 
         # check
         if len(vectimes) == 0:
-            print "Empty log!"
+            error_msg = "Empty log!"
+            Logger("Filter_Events").error(error_msg)
 
-        # Convert absolute time to relative time in seconds
+        #Convert absolute time to relative time in seconds
         t0 = self._dataWS.getRun().getProperty("proton_charge").times[0]
         t0ns = t0.totalNanoseconds()
 
@@ -890,7 +909,8 @@ class MainWindow(QtGui.QMainWindow):
             # Construct a file name from run number
             runnumber = int(filename)
             if runnumber <= 0:
-                print "Run number cannot be less or equal to zero.  User gives %s. " % (filename)
+                error_msg = "Run number cannot be less or equal to zero.  User gives %s. " % (filename)
+                Logger("Filter_Events").error(error_msg)
                 return None
             else:
                 ishort = config.getInstrument(self._instrument).shortName()
@@ -911,19 +931,24 @@ class MainWindow(QtGui.QMainWindow):
                 wsname = "%s_%s_event" % (ishort, str_runnumber)
             else:
                 # Non-supported
-                print "File name / run number in such format %s is not supported. " % (filename)
+                error_msg = "File name / run number in such format %s is not supported. " % (filename)
+                Logger("Filter_Events").error(error_msg)
+
                 return None
 
         else:
             # Unsupported format
-            print "File name / run number in such format %s is not supported. " % (filename)
+            error_msg = "File name / run number in such format %s is not supported. " % (filename)
+            Logger("Filter_Events").error(error_msg)
+
             return None
 
         # Load
         try:
             ws = api.Load(Filename=filename, OutputWorkspace=wsname)
-        except:
+        except RuntimeError as e:
             ws = None
+            return str(e)
 
         return ws
 
@@ -963,7 +988,7 @@ class MainWindow(QtGui.QMainWindow):
                 sumws = api.ConvertToPointData(InputWorkspace=sumws, OutputWorkspace=sumwsname)
             else:
                 sumws = AnalysisDataService.retrieve(sumwsname)
-        except Exception as e:
+        except RuntimeError as e:
             return str(e)
 
         vecx = sumws.readX(0)
@@ -1017,12 +1042,14 @@ class MainWindow(QtGui.QMainWindow):
         splitinfowsname = str(self._dataWS) + "_info"
 
         title = str(self.ui.lineEdit_title.text())
+        fastLog = self.ui.checkBox_fastLog.isChecked()
 
         splitws, infows = api.GenerateEventsFilter(\
                 InputWorkspace      = self._dataWS,\
                 UnitOfTime          = "Seconds",\
                 TitleOfSplitters    = title,\
                 OutputWorkspace     = splitwsname,\
+                FastLog             = fastLog,\
                 InformationWorkspace = splitinfowsname, **kwargs)
 
         self.splitWksp(splitws, infows)
@@ -1036,32 +1063,39 @@ class MainWindow(QtGui.QMainWindow):
         kwargs = {}
         samplelog = str(self.ui.comboBox_2.currentText())
         if len(samplelog) == 0:
-            print "No sample log is selected!"
+            error_msg = "No sample log is selected!"
+            Logger("Filter_Events").error(error_msg)
             return
 
 
         if self.ui.lineEdit_3.text() != "":
             rel_starttime = float(self.ui.lineEdit_3.text())
             kwargs["StartTime"] = str(rel_starttime)
+
         if self.ui.lineEdit_4.text() != "":
             rel_stoptime = float(self.ui.lineEdit_4.text())
             kwargs["StopTime"] = str(rel_stoptime)
+
         if self.ui.lineEdit_5.text() != "":
             minlogvalue = float(self.ui.lineEdit_5.text())
             kwargs["MinimumLogValue"] = minlogvalue
+
         if self.ui.lineEdit_6.text() != "":
             maxlogvalue = float(self.ui.lineEdit_6.text())
             kwargs["MaximumLogValue"] = maxlogvalue
+
         if self.ui.lineEdit_7.text() != "":
             logvalueintv = float(self.ui.lineEdit_7.text())
             kwargs["LogValueInterval"] = logvalueintv
         logvalchangedir = str(self.ui.comboBox_4.currentText())
         kwargs["FilterLogValueByChangingDirection"] = logvalchangedir
+
         if self.ui.lineEdit_9.text() != "":
             logvalueintv = float(self.ui.lineEdit_9.text())
             kwargs["TimeTolerance"] = logvalueintv
         logboundtype = str(self.ui.comboBox_5.currentText())
         kwargs["LogBoundary"] = logboundtype
+
         if self.ui.lineEdit_8.text() != "":
             logvaluetol = float(self.ui.lineEdit_8.text())
             kwargs["LogValueTolerance"] = logvaluetol
@@ -1069,6 +1103,7 @@ class MainWindow(QtGui.QMainWindow):
 
         splitwsname = str(self._dataWS) + "_splitters"
         splitinfowsname = str(self._dataWS) + "_info"
+        fastLog = self.ui.checkBox_fastLog.isChecked()
 
         title = str(self.ui.lineEdit_title.text())
 
@@ -1078,12 +1113,13 @@ class MainWindow(QtGui.QMainWindow):
                 TitleOfSplitters    = title,\
                 OutputWorkspace     = splitwsname,\
                 LogName             = samplelog,\
+                FastLog             = fastLog,\
                 InformationWorkspace = splitinfowsname, **kwargs)
 
         try:
             self.splitWksp(splitws, infows)
-        except Exception as mtderror:
-            self._setErrorMsg("Splitting Failed!\n %s" % (str(mtderror)))
+        except RuntimeError as e:
+            self._setErrorMsg("Splitting Failed!\n %s" % (str(e)))
 
         return
 
@@ -1196,8 +1232,11 @@ class MainWindow(QtGui.QMainWindow):
 
         return
 
+    def helpClicked(self):
+        from pymantidplot.proxies import showCustomInterfaceHelp
+        showCustomInterfaceHelp("FilterEventUI")
 
-    def _resetGUI(self, resetfilerun=False, resetwslist=False):
+    def _resetGUI(self, resetfilerun=False):
         """ Reset GUI including all text edits and etc.
         """
         if resetfilerun is True: