ImsInformed.Workflows.CrossSectionExtraction.CrossSectionWorkfow.FindPeaksBasedOnXIC C# (CSharp) Method

FindPeaksBasedOnXIC() private method

The find peaks based on xic.
///
private FindPeaksBasedOnXIC ( VoltageGroup voltageGroup, ExtractedIonChromatogram chromatogram, IImsTarget target ) : List
voltageGroup VoltageGroup
chromatogram ImsInformed.Domain.DirectInjection.ExtractedIonChromatogram /// The chromatogram. ///
target IImsTarget /// The target. ///
return List
        private List<StandardImsPeak> FindPeaksBasedOnXIC(VoltageGroup voltageGroup, ExtractedIonChromatogram chromatogram, IImsTarget target)
        {
            if (this.Parameters.PeakDetectorSelection == PeakDetectorEnum.WaterShed)
            {
                // Find peaks using multidimensional peak finder.
                List<IntensityPoint> intensityPoints = chromatogram.IntensityPoints;
                List<FeatureBlob> featureBlobs = PeakFinding.FindPeakUsingWatershed(intensityPoints, this.smoother, this.Parameters.FeatureFilterLevel);

                // Recapture the 2D peak using the 1D feature blob from multidimensional peak finder.
                return featureBlobs.Select(featureBlob => new StandardImsPeak(featureBlob, this.uimfReader, voltageGroup, target.MassWithAdduct, this.Parameters.MzWindowHalfWidthInPpm)).ToList();
            }
            else if (this.Parameters.PeakDetectorSelection == PeakDetectorEnum.MASICPeakFinder)
            {
                // Find peaks using MASIC peak finder
                List<IntensityPoint> intensityPoints = chromatogram.IntensityPoints;
                IList<clsPeak> masicPeaks = PeakFinding.FindPeakUsingMasic(intensityPoints, this.NumberOfScans);

                // Recapture the 2D peak using the 1D feature blob from multidimensional peak finder.
                return masicPeaks.Select(peak => new StandardImsPeak(peak)).ToList();
            }
            else
            {
                throw new NotImplementedException(string.Format("{0} not supported", this.Parameters.PeakDetectorSelection));
            }
        }