MCPcopy Create free account
hub / github.com/MITK/MITK / UpdateOutputInformation

Method UpdateOutputInformation

Modules/Core/src/DataManagement/mitkPointSet.cpp:769–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769void 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
826void mitk::PointSet::SetRequestedRegionToLargestPossibleRegion()

Callers

nothing calls this directly

Calls 11

GetNumberOfPointsMethod · 0.80
GetGeometryMethod · 0.80
GetTimeGeometryFunction · 0.50
GetSourceMethod · 0.45
CountTimeStepsMethod · 0.45
sizeMethod · 0.45
GetBoundingBoxMethod · 0.45
GetBoundsMethod · 0.45
IsNullMethod · 0.45
SetBoundsMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected