Exemplo n.º 1
0
  void FeatureMap::updateRanges()
  {
    this->clearRanges();
    updateRanges_(this->begin(), this->end());

    //enlarge the range by the convex hull points
    for (Size i = 0; i < this->size(); ++i)
    {
      DBoundingBox<2> box = this->operator[](i).getConvexHull().getBoundingBox();
      if (!box.isEmpty())
      {
        //update RT
        if (box.minPosition()[Peak2D::RT] < this->pos_range_.minPosition()[Peak2D::RT])
        {
          this->pos_range_.setMinX(box.minPosition()[Peak2D::RT]);
        }
        if (box.maxPosition()[Peak2D::RT] > this->pos_range_.maxPosition()[Peak2D::RT])
        {
          this->pos_range_.setMaxX(box.maxPosition()[Peak2D::RT]);
        }
        //update m/z
        if (box.minPosition()[Peak2D::MZ] < this->pos_range_.minPosition()[Peak2D::MZ])
        {
          this->pos_range_.setMinY(box.minPosition()[Peak2D::MZ]);
        }
        if (box.maxPosition()[Peak2D::MZ] > this->pos_range_.maxPosition()[Peak2D::MZ])
        {
          this->pos_range_.setMaxY(box.maxPosition()[Peak2D::MZ]);
        }
      }
    }
  }
Exemplo n.º 2
0
  void ConsensusMap::updateRanges()
  {
    clearRanges();
    updateRanges_(begin(), end());

    // enlarge the range by the internal points of each feature
    for (Size i = 0; i < size(); ++i)
    {
      for (ConsensusFeature::HandleSetType::const_iterator it = operator[](i).begin(); it != operator[](i).end(); ++it)
      {
        DoubleReal rt = it->getRT();
        DoubleReal mz = it->getMZ();
        DoubleReal intensity = it->getIntensity();

        // update RT
        if (rt < pos_range_.minPosition()[Peak2D::RT])
        {
          pos_range_.setMinX(rt);
        }
        if (rt > pos_range_.maxPosition()[Peak2D::RT])
        {
          pos_range_.setMaxX(rt);
        }
        // update m/z
        if (mz < pos_range_.minPosition()[Peak2D::MZ])
        {
          pos_range_.setMinY(mz);
        }
        if (mz > pos_range_.maxPosition()[Peak2D::MZ])
        {
          pos_range_.setMaxY(mz);
        }
        // update intensity
        if (intensity <  int_range_.minX())
        {
          int_range_.setMinX(intensity);
        }
        if (intensity > int_range_.maxX())
        {
          int_range_.setMaxX(intensity);
        }
      }
    }
  }
Exemplo n.º 3
0
 void MSSpectrum::updateRanges()
 {
   this->clearRanges();
   updateRanges_(ContainerType::begin(), ContainerType::end());
 }