Esempio n. 1
0
void mitk::SlicedData::SetOrigin(const mitk::Point3D& origin)
{
  TimeGeometry* timeGeometry = GetTimeGeometry();

  assert(timeGeometry!=NULL);

  mitk::SlicedGeometry3D* slicedGeometry;

  unsigned int steps = timeGeometry->CountTimeSteps();

  for(unsigned int timestep = 0; timestep < steps; ++timestep)
  {
    slicedGeometry = GetSlicedGeometry(timestep);
    if(slicedGeometry != NULL)
    {
      slicedGeometry->SetOrigin(origin);
      if(slicedGeometry->GetEvenlySpaced())
      {
        mitk::PlaneGeometry* geometry2D = slicedGeometry->GetPlaneGeometry(0);
        geometry2D->SetOrigin(origin);
        slicedGeometry->InitializeEvenlySpaced(geometry2D, slicedGeometry->GetSlices());
      }
    }
    //ProportionalTimeGeometry* timeGeometry = dynamic_cast<ProportionalTimeGeometry *>(GetTimeGeometry());
    //if(timeGeometry != NULL)
    //{
    //  timeGeometry->Initialize(slicedGeometry, steps);
    //  break;
    //}
  }
}
Esempio n. 2
0
void mitk::Surface::CalculateBoundingBox()
{
  TimeGeometry *timeGeometry = this->GetTimeGeometry();

  if (timeGeometry->CountTimeSteps() != m_PolyDatas.size())
    mitkThrow() << "Number of geometry time steps is inconsistent with number of poly data pointers.";

  for (unsigned int i = 0; i < m_PolyDatas.size(); ++i)
  {
    vtkPolyData *polyData = m_PolyDatas[i].GetPointer();
    double bounds[6] = {0};

    if (polyData != nullptr && polyData->GetNumberOfPoints() > 0)
    {
      //      polyData->Update(); //VTK6_TODO vtk pipeline
      polyData->ComputeBounds();
      polyData->GetBounds(bounds);
    }

    BaseGeometry::Pointer geometry = timeGeometry->GetGeometryForTimeStep(i);

    if (geometry.IsNull())
      mitkThrow() << "Time-sliced geometry is invalid (equals nullptr).";

    geometry->SetFloatBounds(bounds);
  }

  timeGeometry->Update();
  m_CalculateBoundingBox = false;
}
Esempio n. 3
0
void mitk::UnstructuredGrid::CalculateBoundingBox()
{
  //
  // first make sure, that the associated time sliced geometry has
  // the same number of geometry 3d's as vtkUnstructuredGrids are present
  //
  TimeGeometry* timeGeometry = GetTimeGeometry();
  if ( timeGeometry->CountTimeSteps() != m_GridSeries.size() )
  {
    itkExceptionMacro(<<"timeGeometry->CountTimeSteps() != m_GridSeries.size() -- use Initialize(timeSteps) with correct number of timeSteps!");
  }
Esempio n. 4
0
void mitk::PointSet::UpdateOutputInformation()
{
    if ( this->GetSource( ) )
    {
        this->GetSource( )->UpdateOutputInformation( );
    }

    //
    // first make sure, that the associated time sliced geometry has
    // the same number of geometry 3d's as PointSets are present
    //
    TimeGeometry* timeGeometry = GetTimeGeometry();
    if ( timeGeometry->CountTimeSteps() != m_PointSetSeries.size() )
    {
        itkExceptionMacro(<<"timeGeometry->CountTimeSteps() != m_PointSetSeries.size() -- use Initialize(timeSteps) with correct number of timeSteps!");
    }
Esempio n. 5
0
void mitk::SlicedData::SetSpacing(mitk::Vector3D aSpacing)
{
  TimeGeometry *timeGeometry = GetTimeGeometry();

  assert(timeGeometry != nullptr);

  unsigned int steps = timeGeometry->CountTimeSteps();

  for (unsigned int timestep = 0; timestep < steps; ++timestep)
  {
    mitk::SlicedGeometry3D *slicedGeometry = GetSlicedGeometry(timestep);
    if (slicedGeometry != nullptr)
    {
      slicedGeometry->SetSpacing(aSpacing);
    }
  }
  timeGeometry->Update();
}