// First, remove all current data sets
ticPlot.removeAllTICDataSets();
// Add the original raw data file
int scanNumbers[] = dataFile.getScanNumbers(1, rtRange);
TICDataSet ticDataset = new TICDataSet(dataFile, scanNumbers, mzRange,
null);
ticPlot.addTICDataset(ticDataset);
try {
// Create a new filtered raw data file
RawDataFileWriter rawDataFileWriter = MZmineCore
.createNewFile(dataFile.getName() + " filtered");
RawDataFile newDataFile = rawDataFilter.filterDatafile(dataFile,
rawDataFileWriter, filterParameters);
// If successful, add the new data file
if (newDataFile != null) {
int newScanNumbers[] = newDataFile.getScanNumbers(1, rtRange);
TICDataSet newDataset = new TICDataSet(newDataFile,
newScanNumbers, mzRange, null);
ticPlot.addTICDataset(newDataset);
}
} catch (IOException e) {