20 this->SetNumberOfRequiredInputs(1);
21 this->SetNumberOfIndexedOutputs(1);
22 this->SetNthOutput(0, output.GetPointer());
37 if (idx + 1 > this->GetNumberOfInputs())
39 this->SetNumberOfRequiredInputs(idx + 1);
41 if (input != static_cast<InputType *>(this->ProcessObject::GetInput(idx)))
43 this->ProcessObject::SetNthInput(idx, const_cast<InputType *>(input));
50 if (this->GetNumberOfInputs() < 1)
57 if (this->GetNumberOfInputs() < 1)
70 auto timestep =
static_cast<int>(input->GetTimeSteps());
72 for (
int currentTimestep = 0; currentTimestep < timestep; currentTimestep++)
74 if (input->GetNumberOfVertices(currentTimestep) >= 4)
78 auto it = contour->IteratorBegin();
79 auto end = contour->IteratorEnd();
81 auto first = contour->IteratorBegin();
82 auto last = contour->IteratorEnd() - 1;
91 tempContour->AddVertex((*it)->Coordinates, (*it)->IsControlPoint, currentTimestep);
102 if (input->IsClosed(currentTimestep))
117 if (input->IsClosed(currentTimestep))
129 else if (it == (last - 1))
131 if (input->IsClosed(currentTimestep))
157 a[0] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[0];
158 a[1] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[1];
159 a[2] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[2];
162 b[0] = (9.0 / 16.0) * (*Ci)->Coordinates[0];
163 b[1] = (9.0 / 16.0) * (*Ci)->Coordinates[1];
164 b[2] = (9.0 / 16.0) * (*Ci)->Coordinates[2];
167 c[0] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[0];
168 c[1] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[1];
169 c[2] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[2];
172 d[0] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[0];
173 d[1] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[1];
174 d[2] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[2];
176 subpoint[0] = a[0] + b[0] + c[0] + d[0];
177 subpoint[1] = a[1] + b[1] + c[1] + d[1];
178 subpoint[2] = a[2] + b[2] + c[2] + d[2];
182 tempContour->AddVertex(subdivisionPoint.
Coordinates, currentTimestep);
188 contour = tempContour;
199 contour->SetClosed(input->IsClosed());
201 this->SetNthOutput(0, contour);
void GenerateData() override
const InputType * GetInput(void)
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
mitk::Point3D Coordinates
Coordinates in 3D space.
mitk::ContourElement::VertexIterator VertexIterator
Constants for most interaction classes, due to the generic StateMachines.
ContourModelSubDivisionFilter()
mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
virtual void SetInput(const InputType *input)
~ContourModelSubDivisionFilter() override
int m_InterpolationIterations
Represents a single vertex of contour.