24 this->SetNumberOfRequiredInputs(1);
25 this->SetNumberOfIndexedOutputs(1);
26 this->SetNthOutput(0, output.GetPointer());
35 this->SetInput(0, input);
41 if (idx + 1 > this->GetNumberOfInputs())
43 this->SetNumberOfRequiredInputs(idx + 1);
45 if (input != static_cast<InputType *>(this->ProcessObject::GetInput(idx)))
47 this->ProcessObject::SetNthInput(idx, const_cast<InputType *>(input));
54 if (this->GetNumberOfInputs() < 1)
61 if (this->GetNumberOfInputs() < 1)
74 int timestep =
static_cast<int>(input->GetTimeSteps());
76 for (
int currentTimestep = 0; currentTimestep < timestep; currentTimestep++)
78 if (input->GetNumberOfVertices(currentTimestep) >= 4)
80 for (
int iterations = 0; iterations < this->m_InterpolationIterations; iterations++)
82 auto it = contour->IteratorBegin();
83 auto end = contour->IteratorEnd();
85 auto first = contour->IteratorBegin();
86 auto last = contour->IteratorEnd() - 1;
95 tempContour->AddVertex((*it)->Coordinates, (*it)->IsControlPoint, currentTimestep);
106 if (input->IsClosed(currentTimestep))
121 if (input->IsClosed(currentTimestep))
133 else if (it == (last - 1))
135 if (input->IsClosed(currentTimestep))
161 a[0] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[0];
162 a[1] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[1];
163 a[2] = (-1.0 / 16.0) * (*CiMinus1)->Coordinates[2];
166 b[0] = (9.0 / 16.0) * (*Ci)->Coordinates[0];
167 b[1] = (9.0 / 16.0) * (*Ci)->Coordinates[1];
168 b[2] = (9.0 / 16.0) * (*Ci)->Coordinates[2];
171 c[0] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[0];
172 c[1] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[1];
173 c[2] = (9.0 / 16.0) * (*CiPlus1)->Coordinates[2];
176 d[0] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[0];
177 d[1] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[1];
178 d[2] = (-1.0 / 16.0) * (*CiPlus2)->Coordinates[2];
180 subpoint[0] = a[0] + b[0] + c[0] + d[0];
181 subpoint[1] = a[1] + b[1] + c[1] + d[1];
182 subpoint[2] = a[2] + b[2] + c[2] + d[2];
186 tempContour->AddVertex(subdivisionPoint.
Coordinates, currentTimestep);
192 contour = tempContour;
203 contour->SetClosed(input->IsClosed());
205 this->SetNthOutput(0, contour);
void GenerateData() override
const InputType * GetInput(void)
virtual ~ContourModelSubDivisionFilter()
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()
virtual mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
virtual void SetInput(const InputType *input)
int m_InterpolationIterations
Represents a single vertex of contour.