| 767 | } |
| 768 | |
| 769 | void mitk::PointSet::UpdateOutputInformation() |
| 770 | { |
| 771 | if (this->GetSource()) |
| 772 | { |
| 773 | this->GetSource()->UpdateOutputInformation(); |
| 774 | } |
| 775 | |
| 776 | // |
| 777 | // first make sure, that the associated time sliced geometry has |
| 778 | // the same number of geometry 3d's as PointSets are present |
| 779 | // |
| 780 | TimeGeometry *timeGeometry = GetTimeGeometry(); |
| 781 | if (timeGeometry->CountTimeSteps() != m_PointSetSeries.size()) |
| 782 | { |
| 783 | itkExceptionMacro(<< "timeGeometry->CountTimeSteps() != m_PointSetSeries.size() -- use Initialize(timeSteps) with " |
| 784 | "correct number of timeSteps!"); |
| 785 | } |
| 786 | |
| 787 | // This is needed to detect zero objects |
| 788 | mitk::ScalarType nullpoint[] = {0, 0, 0, 0, 0, 0}; |
| 789 | BoundingBox::BoundsArrayType itkBoundsNull(nullpoint); |
| 790 | |
| 791 | // |
| 792 | // Iterate over the PointSets and update the Geometry |
| 793 | // information of each of the items. |
| 794 | // |
| 795 | if (m_CalculateBoundingBox) |
| 796 | { |
| 797 | for (unsigned int i = 0; i < m_PointSetSeries.size(); ++i) |
| 798 | { |
| 799 | const DataType::BoundingBoxType *bb = m_PointSetSeries[i]->GetBoundingBox(); |
| 800 | BoundingBox::BoundsArrayType itkBounds = bb->GetBounds(); |
| 801 | |
| 802 | if (m_PointSetSeries[i].IsNull() || (m_PointSetSeries[i]->GetNumberOfPoints() == 0) || |
| 803 | (itkBounds == itkBoundsNull)) |
| 804 | { |
| 805 | itkBounds = itkBoundsNull; |
| 806 | continue; |
| 807 | } |
| 808 | |
| 809 | // Ensure minimal bounds of 1.0 in each dimension |
| 810 | for (unsigned int j = 0; j < 3; ++j) |
| 811 | { |
| 812 | if (itkBounds[j * 2 + 1] - itkBounds[j * 2] < 1.0) |
| 813 | { |
| 814 | BoundingBox::CoordRepType center = (itkBounds[j * 2] + itkBounds[j * 2 + 1]) / 2.0; |
| 815 | itkBounds[j * 2] = center - 0.5; |
| 816 | itkBounds[j * 2 + 1] = center + 0.5; |
| 817 | } |
| 818 | } |
| 819 | this->GetGeometry(i)->SetBounds(itkBounds); |
| 820 | } |
| 821 | m_CalculateBoundingBox = false; |
| 822 | } |
| 823 | this->GetTimeGeometry()->Update(); |
| 824 | } |
| 825 | |
| 826 | void mitk::PointSet::SetRequestedRegionToLargestPossibleRegion() |
nothing calls this directly
no test coverage detected