Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.Designer.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.Designer.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.Designer.cs	(revision 10809)
@@ -54,4 +54,5 @@
       this.mostCommonToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
       this.interpolationToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
+      this.smoothingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.replaceValueOverSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.averageToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
@@ -59,6 +60,4 @@
       this.randomToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
       this.mostCommonToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
-      this.interpolationToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
-      this.smoothingToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
       this.btnSearch = new System.Windows.Forms.Button();
       this.btnReplace = new System.Windows.Forms.Button();
@@ -114,5 +113,6 @@
             this.randomToolStripMenuItem_Column,
             this.mostCommonToolStripMenuItem_Column,
-            this.interpolationToolStripMenuItem_Column});
+            this.interpolationToolStripMenuItem_Column,
+            this.smoothingToolStripMenuItem});
       this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem";
       this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
@@ -154,4 +154,11 @@
       this.interpolationToolStripMenuItem_Column.Click += new System.EventHandler(this.ReplaceWithInterpolation_Column_Click);
       // 
+      // smoothingToolStripMenuItem
+      // 
+      this.smoothingToolStripMenuItem.Name = "smoothingToolStripMenuItem";
+      this.smoothingToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
+      this.smoothingToolStripMenuItem.Text = "Smoothing";
+      this.smoothingToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithSmoothing_Selection_Click);
+      // 
       // replaceValueOverSelectionToolStripMenuItem
       // 
@@ -160,7 +167,5 @@
             this.medianToolStripMenuItem_Selection,
             this.randomToolStripMenuItem_Selection,
-            this.mostCommonToolStripMenuItem_Selection,
-            this.interpolationToolStripMenuItem_Selection,
-            this.smoothingToolStripMenuItem_Selection});
+            this.mostCommonToolStripMenuItem_Selection});
       this.replaceValueOverSelectionToolStripMenuItem.Name = "replaceValueOverSelectionToolStripMenuItem";
       this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
@@ -194,18 +199,4 @@
       this.mostCommonToolStripMenuItem_Selection.Text = "Most Common";
       this.mostCommonToolStripMenuItem_Selection.Click += new System.EventHandler(this.ReplaceWithMostCommon_Selection_Click);
-      // 
-      // interpolationToolStripMenuItem_Selection
-      // 
-      this.interpolationToolStripMenuItem_Selection.Name = "interpolationToolStripMenuItem_Selection";
-      this.interpolationToolStripMenuItem_Selection.Size = new System.Drawing.Size(155, 22);
-      this.interpolationToolStripMenuItem_Selection.Text = "Interpolation";
-      this.interpolationToolStripMenuItem_Selection.Click += new System.EventHandler(this.ReplaceWithInterpolation_Selection_Click);
-      // 
-      // smoothingToolStripMenuItem_Selection
-      // 
-      this.smoothingToolStripMenuItem_Selection.Name = "smoothingToolStripMenuItem_Selection";
-      this.smoothingToolStripMenuItem_Selection.Size = new System.Drawing.Size(155, 22);
-      this.smoothingToolStripMenuItem_Selection.Text = "Smoothing";
-      this.smoothingToolStripMenuItem_Selection.Click += new System.EventHandler(this.ReplaceWithSmoothing_Selection_Click);
       // 
       // btnSearch
@@ -270,9 +261,8 @@
     private System.Windows.Forms.ToolStripMenuItem randomToolStripMenuItem_Selection;
     private System.Windows.Forms.ToolStripMenuItem mostCommonToolStripMenuItem_Selection;
-    private System.Windows.Forms.ToolStripMenuItem interpolationToolStripMenuItem_Selection;
-    private System.Windows.Forms.ToolStripMenuItem smoothingToolStripMenuItem_Selection;
     private System.Windows.Forms.Button btnSearch;
     private System.Windows.Forms.Button btnReplace;
     private System.Windows.Forms.ToolTip toolTip;
+    private System.Windows.Forms.ToolStripMenuItem smoothingToolStripMenuItem;
   }
 }
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs	(revision 10809)
@@ -86,5 +86,7 @@
 
     void DataGridView_SelectionChanged(object sender, EventArgs e) {
-      Content.DataGridLogic.SetSelection(GetSelectedCells());
+      if (Content != null) {
+        Content.DataGridLogic.SetSelection(GetSelectedCells());
+      }
     }
 
@@ -150,5 +152,5 @@
     private void btnApplySort_Click(object sender, System.EventArgs e) {
       triggersOwnEvent(() => {
-        Content.PreprocessingDataManipulation.ReOrderToIndices(virtualRowIndices);
+        Content.ManipulationLogic.ReOrderToIndices(virtualRowIndices);
         OnContentChanged();
       });
@@ -244,20 +246,20 @@
         switch (findAndReplaceDialog.GetReplaceAction()) {
           case ReplaceAction.Value:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
+            Content.ManipulationLogic.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
             break;
           case ReplaceAction.Average:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByAverageValue(cells);
+            Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
             break;
           case ReplaceAction.Median:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByMedianValue(cells);
+            Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
             break;
           case ReplaceAction.Random:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByRandomValue(cells);
+            Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
             break;
           case ReplaceAction.MostCommon:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByMostCommonValue(cells);
+            Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
             break;
           case ReplaceAction.Interpolation:
-            Content.PreprocessingDataManipulation.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
+            Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
             break;
         }
@@ -386,36 +388,36 @@
 
     private void ReplaceWithAverage_Column_Click(object sender, EventArgs e) {
-      Content.PreprocessingDataManipulation.ReplaceIndicesByAverageValue(GetSelectedCells());
+      Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(),false);
+    }
+    private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
+      Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), true);
     }
 
     private void ReplaceWithMedian_Column_Click(object sender, EventArgs e) {
-      Content.PreprocessingDataManipulation.ReplaceIndicesByMedianValue(GetSelectedCells());
+      Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
+    }
+    private void ReplaceWithMedian_Selection_Click(object sender, EventArgs e) {
+      Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
     }
 
     private void ReplaceWithRandom_Column_Click(object sender, EventArgs e) {
-      Content.PreprocessingDataManipulation.ReplaceIndicesByRandomValue(GetSelectedCells());
+      Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
+    }
+    private void ReplaceWithRandom_Selection_Click(object sender, EventArgs e) {
+      Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
     }
 
     private void ReplaceWithMostCommon_Column_Click(object sender, EventArgs e) {
-      Content.PreprocessingDataManipulation.ReplaceIndicesByMostCommonValue(GetSelectedCells());
+      Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), false);
+    }
+    private void ReplaceWithMostCommon_Selection_Click(object sender, EventArgs e) {
+      Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), true);
     }
 
     private void ReplaceWithInterpolation_Column_Click(object sender, EventArgs e) {
-      Content.PreprocessingDataManipulation.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
-    }
-
-    private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
-    }
-
-    private void ReplaceWithMedian_Selection_Click(object sender, EventArgs e) {
-    }
-
-    private void ReplaceWithRandom_Selection_Click(object sender, EventArgs e) {
-    }
-
-    private void ReplaceWithMostCommon_Selection_Click(object sender, EventArgs e) {
-    }
-
+      Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
+    }
     private void ReplaceWithInterpolation_Selection_Click(object sender, EventArgs e) {
+      Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
     }
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/ManipulationView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/ManipulationView.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/ManipulationView.cs	(revision 10809)
@@ -91,14 +91,14 @@
           break;
         case 1: //Average
-          Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells);
+          Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
           break;
         case 2: //Median
-          Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells);
+          Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
           break;
         case 3: //Most Common
-          Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells);
+          Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
           break;
         case 4: //Random
-          Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells);
+          Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
           break;
       }
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/StatisticsView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/StatisticsView.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/StatisticsView.cs	(revision 10809)
@@ -141,11 +141,11 @@
         logic.GetColumnTypeAsString(columnIndex),
         logic.GetMissingValueCount(columnIndex).ToString(),
-        logic.GetMin<double>(columnIndex).ToString(),
-        logic.GetMax<double>(columnIndex).ToString(),
-        logic.GetMedian(columnIndex).ToString(),
-        logic.GetAverage(columnIndex).ToString(),
+        logic.GetMin<double>(columnIndex, false).ToString(),
+        logic.GetMax<double>(columnIndex, false).ToString(),
+        logic.GetMedian(columnIndex, false).ToString(),
+        logic.GetAverage(columnIndex, false).ToString(),
         logic.GetStandardDeviation(columnIndex).ToString(),
         logic.GetVariance(columnIndex).ToString(),
-        logic.GetMostCommonValue<double>(columnIndex).ToString(),
+        logic.GetMostCommonValue<double>(columnIndex, false).ToString(),
         logic.GetDifferentValuesCount<double>(columnIndex).ToString()
       };
@@ -163,5 +163,5 @@
         "", //standard deviation
         "", //variance
-        logic.GetMostCommonValue<string>(columnIndex).ToString(),
+        logic.GetMostCommonValue<string>(columnIndex, false).ToString(),
         logic.GetDifferentValuesCount<string>(columnIndex).ToString()
       };
@@ -173,11 +173,11 @@
         logic.GetColumnTypeAsString(columnIndex),
         logic.GetMissingValueCount(columnIndex).ToString(),
-        logic.GetMin<DateTime>(columnIndex).ToString(),
-        logic.GetMax<DateTime>(columnIndex).ToString(),
-        logic.GetMedianDateTime(columnIndex).ToString(), 
-        logic.GetAverageDateTime(columnIndex).ToString(),
+        logic.GetMin<DateTime>(columnIndex, false).ToString(),
+        logic.GetMax<DateTime>(columnIndex, false).ToString(),
+        logic.GetMedianDateTime(columnIndex, false).ToString(), 
+        logic.GetAverageDateTime(columnIndex, false).ToString(),
         logic.GetStandardDeviation(columnIndex).ToString(),
         logic.GetVariance(columnIndex).ToString(), //variance
-        logic.GetMostCommonValue<DateTime>(columnIndex).ToString(),
+        logic.GetMostCommonValue<DateTime>(columnIndex, false).ToString(),
         logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
       };
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs	(revision 10809)
@@ -37,5 +37,5 @@
 
     public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
-      IList<double> values = preprocessingData.GetValues<double>(variableName);
+      IList<double> values = preprocessingData.GetValues<double>(variableName, false);
       DataRow row = new DataRow(variableName, "", values);
       row.VisualProperties.ChartType = chartType;
@@ -44,5 +44,5 @@
 
     public DataRow CreateDataRowRange(string variableName,int start, int end, DataRowVisualProperties.DataRowChartType chartType) {
-      IList<double> values = preprocessingData.GetValues<double>(variableName);
+      IList<double> values = preprocessingData.GetValues<double>(variableName, false);
       IList<double> valuesRange = new List<double>();
       for (int i = 0; i < values.Count; i++) {
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs	(revision 10809)
@@ -45,5 +45,5 @@
     }
 
-    public IManipulationLogic PreprocessingDataManipulation {
+    public IManipulationLogic ManipulationLogic {
       get { return manipulationLogic; }
     }
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilteredPreprocessingData.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilteredPreprocessingData.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilteredPreprocessingData.cs	(revision 10809)
@@ -41,10 +41,10 @@
     }
 
-    public IList<T> GetValues<T>(string variableName) {
-      return ActiveData.GetValues<T>(variableName);
+    public IList<T> GetValues<T>(string variableName, bool considerSelection) {
+      return ActiveData.GetValues<T>(variableName, considerSelection);
     }
 
-    public IList<T> GetValues<T>(int columnIndex) {
-      return ActiveData.GetValues<T>(columnIndex);
+    public IList<T> GetValues<T>(int columnIndex, bool considerSelection) {
+      return ActiveData.GetValues<T>(columnIndex, considerSelection);
     }
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs	(revision 10809)
@@ -45,12 +45,12 @@
     }
 
-    public void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells) {
-      preprocessingData.InTransaction(() => {
-        foreach (var column in cells) {
-          if (preprocessingData.IsType<double>(column.Key)) {
-            double average = statisticsLogic.GetAverage(column.Key);
+    public void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells, bool considerSelection) {
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          if (preprocessingData.IsType<double>(column.Key)) {
+            double average = statisticsLogic.GetAverage(column.Key, considerSelection);
             ReplaceIndicesByValue<double>(column.Key, column.Value, average);
           } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-            DateTime average = statisticsLogic.GetAverageDateTime(column.Key);
+            DateTime average = statisticsLogic.GetAverageDateTime(column.Key, considerSelection);
             ReplaceIndicesByValue<DateTime>(column.Key, column.Value, average);
           }
@@ -59,12 +59,12 @@
     }
 
-    public void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells) {
-      preprocessingData.InTransaction(() => {
-        foreach (var column in cells) {
-          if (preprocessingData.IsType<double>(column.Key)) {
-            double median = statisticsLogic.GetMedian(column.Key);
+    public void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells, bool considerSelection) {
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          if (preprocessingData.IsType<double>(column.Key)) {
+            double median = statisticsLogic.GetMedian(column.Key, considerSelection);
             ReplaceIndicesByValue<double>(column.Key, column.Value, median);
           } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-            DateTime median = statisticsLogic.GetMedianDateTime(column.Key);
+            DateTime median = statisticsLogic.GetMedianDateTime(column.Key, considerSelection);
             ReplaceIndicesByValue<DateTime>(column.Key, column.Value, median);
           }
@@ -73,5 +73,5 @@
     }
 
-    public void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells) {
+    public void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells, bool considerSelection) {
       preprocessingData.InTransaction(() => {
         Random r = new Random();
@@ -79,6 +79,6 @@
         foreach (var column in cells) {
           if (preprocessingData.IsType<double>(column.Key)) {
-            double max = statisticsLogic.GetMax<double>(column.Key);
-            double min = statisticsLogic.GetMin<double>(column.Key);
+            double max = statisticsLogic.GetMax<double>(column.Key, considerSelection);
+            double min = statisticsLogic.GetMin<double>(column.Key, considerSelection);
             double randMultiplier = (max - min);
             foreach (int index in column.Value) {
@@ -87,6 +87,6 @@
             }
           } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-            DateTime min = statisticsLogic.GetMin<DateTime>(column.Key);
-            DateTime max = statisticsLogic.GetMax<DateTime>(column.Key);
+            DateTime min = statisticsLogic.GetMin<DateTime>(column.Key, considerSelection);
+            DateTime max = statisticsLogic.GetMax<DateTime>(column.Key, considerSelection);
             double randMultiplier = (max - min).TotalSeconds;
             foreach (int index in column.Value) {
@@ -104,7 +104,7 @@
           int countValues = 0;
           if (preprocessingData.IsType<double>(column.Key)) {
-            countValues = preprocessingData.GetValues<double>(column.Key).Count();
-          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-            countValues = preprocessingData.GetValues<DateTime>(column.Key).Count();
+            countValues = preprocessingData.GetValues<double>(column.Key, false).Count();
+          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
+            countValues = preprocessingData.GetValues<DateTime>(column.Key, false).Count();
           }
 
@@ -165,13 +165,13 @@
     }
 
-    public void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells) {
-      preprocessingData.InTransaction(() => {
-        foreach (var column in cells) {
-          if (preprocessingData.IsType<double>(column.Key)) {
-            ReplaceIndicesByValue<double>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<double>(column.Key));
+    public void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells, bool considerSelection) {
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          if (preprocessingData.IsType<double>(column.Key)) {
+            ReplaceIndicesByValue<double>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<double>(column.Key, considerSelection));
           } else if (preprocessingData.IsType<string>(column.Key)) {
-            ReplaceIndicesByValue<string>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<string>(column.Key));
-          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-            ReplaceIndicesByValue<DateTime>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<DateTime>(column.Key));
+            ReplaceIndicesByValue<string>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<string>(column.Key, considerSelection));
+          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
+            ReplaceIndicesByValue<DateTime>(column.Key, column.Value, statisticsLogic.GetMostCommonValue<DateTime>(column.Key, considerSelection));
           } else {
             throw new ArgumentException("column with index: " + column.Key + " contains a non supported type.");
@@ -256,5 +256,5 @@
     private void reOrderToIndices<T>(int columnIndex, IList<Tuple<int, int>> indices) {
 
-      List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex));
+      List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex, false));
 
       // process all columns equally
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs	(revision 10809)
@@ -122,10 +122,18 @@
 
     [Obsolete("use the index based variant, is faster")]
-    public IList<T> GetValues<T>(string variableName) {
-      return GetValues<T>(GetColumnIndex(variableName));
-    }
-
-    public IList<T> GetValues<T>(int columnIndex) {
-      return (IList<T>)variableValues[columnIndex];
+    public IList<T> GetValues<T>(string variableName, bool considerSelection) {
+      return GetValues<T>(GetColumnIndex(variableName), considerSelection);
+    }
+
+    public IList<T> GetValues<T>(int columnIndex, bool considerSelection) {
+      if (considerSelection) {
+        var list = new List<T>();
+        foreach (var rowIdx in currentSelection[columnIndex]) {
+          list.Add((T)variableValues[columnIndex][rowIdx]);
+        }
+        return list;
+      } else {
+        return (IList<T>)variableValues[columnIndex];
+      }
     }
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/SearchLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/SearchLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/SearchLogic.cs	(revision 10809)
@@ -30,5 +30,5 @@
 
     private Dictionary<int, IList<int>> MissingValueIndicies { get; set; }
-    private Dictionary<int, IEnumerable> ValuesWithoutNaN { get; set; }
+    private Dictionary<int, IList> ValuesWithoutNaN { get; set; }
 
     public SearchLogic(ITransactionalPreprocessingData thePreprocessingData) {
@@ -36,5 +36,5 @@
 
       MissingValueIndicies = new Dictionary<int, IList<int>>();
-      ValuesWithoutNaN = new Dictionary<int, IEnumerable>();
+      ValuesWithoutNaN = new Dictionary<int, IList>();
 
       preprocessingData.Changed += preprocessingData_Changed;
@@ -58,5 +58,5 @@
         case DataPreprocessingChangedEventType.Transformation:
           MissingValueIndicies = new Dictionary<int, IList<int>>();
-          ValuesWithoutNaN = new Dictionary<int, IEnumerable>();
+          ValuesWithoutNaN = new Dictionary<int, IList>();
           break;
       } 
@@ -110,22 +110,30 @@
     }
 
-    public IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex)
+    public IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection)
     {
-      if (!ValuesWithoutNaN.ContainsKey(columnIndex))
-      {
+      if (considerSelection) {     
+        var selectedRows =  preprocessingData.GetSelection()[columnIndex];
+        
         List<T> values = new List<T>();
-
-        for (int row = 0; row < preprocessingData.Rows; ++row)
-        {
-          if (!IsMissingValue(columnIndex, row))
-          {
-            values.Add(preprocessingData.GetCell<T>(columnIndex, row));
+        foreach (var rowIdx in selectedRows) {
+          if (!IsMissingValue(columnIndex, rowIdx)) {
+            values.Add(preprocessingData.GetCell<T>(columnIndex, rowIdx));
           }
         }
+        return values;
+      } else {
+        if (!ValuesWithoutNaN.ContainsKey(columnIndex)) {
+          List<T> values = new List<T>();
 
-        ValuesWithoutNaN[columnIndex] = values;
+          for (int row = 0; row < preprocessingData.Rows; ++row) {
+            if (!IsMissingValue(columnIndex, row)) {
+              values.Add(preprocessingData.GetCell<T>(columnIndex, row));
+            }
+          }
+
+          ValuesWithoutNaN[columnIndex] = values;
+        }
+        return (IEnumerable<T>)ValuesWithoutNaN[columnIndex];
       }
-
-      return (IEnumerable<T>)ValuesWithoutNaN[columnIndex];
     }
   }
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs	(revision 10809)
@@ -73,50 +73,50 @@
     }
 
-    public T GetMin<T>(int columnIndex) where T : IComparable<T> {
-      return preprocessingData.GetValues<T>(columnIndex).Min();
+    public T GetMin<T>(int columnIndex, bool considerSelection) where T : IComparable<T> {
+      return preprocessingData.GetValues<T>(columnIndex, considerSelection).Min();
     }
 
-    public T GetMax<T>(int columnIndex) where T : IComparable<T> {
-      return preprocessingData.GetValues<T>(columnIndex).Max();
+    public T GetMax<T>(int columnIndex, bool considerSelection) where T : IComparable<T> {
+      return preprocessingData.GetValues<T>(columnIndex, considerSelection).Max();
     }
 
-    public double GetMedian(int columnIndex) {
+    public double GetMedian(int columnIndex, bool considerSelection) {
       double median = double.NaN;
       if (preprocessingData.IsType<double>(columnIndex)) {
-        median = GetValuesWithoutNaN<double>(columnIndex).Median();
+        median = GetValuesWithoutNaN<double>(columnIndex, considerSelection).Median();
       }
       return median;
     }
 
-    public double GetAverage(int columnIndex) {
+    public double GetAverage(int columnIndex, bool considerSelection) {
       double avg = double.NaN;
       if (preprocessingData.IsType<double>(columnIndex)) {
-        avg = GetValuesWithoutNaN<double>(columnIndex).Average();
+        avg = GetValuesWithoutNaN<double>(columnIndex, considerSelection).Average();
       }
       return avg;
     }
 
-    public DateTime GetMedianDateTime(int columnIndex) {
+    public DateTime GetMedianDateTime(int columnIndex, bool considerSelection) {
       DateTime median = new DateTime();
       if (preprocessingData.IsType<DateTime>(columnIndex)) {
-        median = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Median());
+        median = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex, considerSelection).Median());
       }
       return median;
     }
 
-    public DateTime GetAverageDateTime(int columnIndex) {
+    public DateTime GetAverageDateTime(int columnIndex, bool considerSelection) {
       DateTime avg = new DateTime();
       if (preprocessingData.IsType<DateTime>(columnIndex)) {
-        avg = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Average());
+        avg = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex, considerSelection).Average());
       }
       return avg;
     }
 
-    public T GetMostCommonValue<T>(int columnIndex) {
-      var t = preprocessingData.GetValues<T>(columnIndex);
+    public T GetMostCommonValue<T>(int columnIndex, bool considerSelection) {
+      var t = preprocessingData.GetValues<T>(columnIndex, considerSelection);
       var t2 = t.GroupBy(x => x);
       var t3 = t2.Select(g => g.Key);
 
-      return preprocessingData.GetValues<T>(columnIndex)
+      return preprocessingData.GetValues<T>(columnIndex, considerSelection)
                               .GroupBy(x => x)
                               .OrderByDescending(g => g.Count())
@@ -129,7 +129,7 @@
       double stdDev = double.NaN;
       if (preprocessingData.IsType<double>(columnIndex)) {
-        stdDev = GetValuesWithoutNaN<double>(columnIndex).StandardDeviation();
+        stdDev = GetValuesWithoutNaN<double>(columnIndex, false).StandardDeviation();
       } else if (preprocessingData.IsType<DateTime>(columnIndex)) {
-        stdDev = GetDateTimeAsSeconds(columnIndex).StandardDeviation();
+        stdDev = GetDateTimeAsSeconds(columnIndex, false).StandardDeviation();
       }
       return stdDev;
@@ -139,7 +139,7 @@
       double variance = double.NaN;
       if (preprocessingData.IsType<double>(columnIndex)) {
-        variance = preprocessingData.GetValues<double>(columnIndex).Variance();
+        variance = preprocessingData.GetValues<double>(columnIndex, false).Variance();
       } else if (preprocessingData.IsType<DateTime>(columnIndex)) {
-        variance = GetDateTimeAsSeconds(columnIndex).Variance();
+        variance = GetDateTimeAsSeconds(columnIndex, false).Variance();
       }
       return variance;
@@ -147,5 +147,5 @@
 
     public int GetDifferentValuesCount<T>(int columnIndex) {
-      return preprocessingData.GetValues<T>(columnIndex).GroupBy(x => x).Count();
+      return preprocessingData.GetValues<T>(columnIndex, false).GroupBy(x => x).Count();
     }
 
@@ -179,10 +179,10 @@
     }
 
-    private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex) {
-      return GetValuesWithoutNaN<DateTime>(columnIndex).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
+    private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex, bool considerSelection) {
+      return GetValuesWithoutNaN<DateTime>(columnIndex, considerSelection).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
     }
 
-    private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex) {
-      return searchLogic.GetValuesWithoutNaN<T>(columnIndex);
+    private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection) {
+      return searchLogic.GetValuesWithoutNaN<T>(columnIndex, considerSelection);
     }
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs	(revision 10809)
@@ -25,5 +25,5 @@
   public interface IDataGridContent : IStringConvertibleMatrix {
     IDataGridLogic DataGridLogic { get; }
-    IManipulationLogic PreprocessingDataManipulation { get; }
+    IManipulationLogic ManipulationLogic { get; }
     IFilterLogic FilterLogic { get; }
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs	(revision 10809)
@@ -28,9 +28,9 @@
     void ReOrderToIndices(IList<Tuple<int, int>> indices);
     void ShuffleToIndices(IList<System.Tuple<int, int>> indices);
-    void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells);
+    void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells, bool considerSelection);
     void ReplaceIndicesByLinearInterpolationOfNeighbours(IDictionary<int, IList<int>> cells);
-    void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells);
-    void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells);
-    void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells);
+    void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells, bool considerSelection);
+    void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells, bool considerSelection);
+    void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells, bool considerSelection);
     void ReplaceIndicesByValue(IDictionary<int, IList<int>> cells, string value);
     void ReplaceIndicesByValue<T>(int columnIndex, IEnumerable<int> rowIndices, T value);
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs	(revision 10809)
@@ -37,6 +37,6 @@
 
     [Obsolete("use the index based variant, is faster")]
-    IList<T> GetValues<T>(string variableName);
-    IList<T> GetValues<T>(int columnIndex);
+    IList<T> GetValues<T>(string variableName, bool considerSelection);
+    IList<T> GetValues<T>(int columnIndex, bool considerSelection);
 
     void SetValues<T>(int columnIndex, IList<T> values);
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ISearchLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ISearchLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ISearchLogic.cs	(revision 10809)
@@ -39,5 +39,5 @@
     bool IsMissingValue(int columnIndex, int rowIndex);
 
-    IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex);
+    IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection);
   }
 }
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs	(revision 10809)
@@ -33,15 +33,15 @@
     int GetRowMissingValueCount(int rowIndex);
 
-    T GetMin<T>(int columnIndex) where T : IComparable<T>;
-    T GetMax<T>(int columnIndex) where T : IComparable<T>;
+    T GetMin<T>(int columnIndex, bool considerSelection) where T : IComparable<T>;
+    T GetMax<T>(int columnIndex, bool considerSelection) where T : IComparable<T>;
 
-    double GetMedian(int columnIndex);
-    double GetAverage(int columnIndex);
-    DateTime GetMedianDateTime(int columnIndex);
-    DateTime GetAverageDateTime(int columnIndex);
+    double GetMedian(int columnIndex, bool considerSelection);
+    double GetAverage(int columnIndex, bool considerSelection);
+    DateTime GetMedianDateTime(int columnIndex, bool considerSelection);
+    DateTime GetAverageDateTime(int columnIndex, bool considerSelection);
 
     double GetStandardDeviation(int columnIndex);
     double GetVariance(int columnIndex);
-    T GetMostCommonValue<T>(int columnIndex);
+    T GetMostCommonValue<T>(int columnIndex, bool considerSelection);
     int GetDifferentValuesCount<T>(int columnIndex);
 
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingTransformator.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingTransformator.cs	(revision 10808)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingTransformator.cs	(revision 10809)
@@ -54,5 +54,5 @@
         int colIndex = preprocessingData.GetColumnIndex(transformation.Column);
 
-        var originalData = preprocessingData.GetValues<double>(colIndex);
+        var originalData = preprocessingData.GetValues<double>(colIndex, false);
         var transformedData = ApplyDoubleTransformation(transformation, originalData, out success);
         if (!success) return;
