43 vtkInformationVector **inputVector,
44 vtkInformationVector *outputVector) {
46 const auto input = vtkDataSet::GetData(inputVector[0]);
47 auto outputSkeletonNodes = vtkUnstructuredGrid::GetData(outputVector, 0);
48 auto outputSkeletonArcs = vtkUnstructuredGrid::GetData(outputVector, 1);
49 auto outputSegmentation = vtkDataSet::GetData(outputVector, 2);
51#ifndef TTK_ENABLE_KAMIKAZE
53 this->
printErr(
"Error: input pointer is NULL.");
57 if(!input->GetNumberOfPoints()) {
58 this->
printErr(
"Error: input has no point.");
62 if(!outputSkeletonNodes || !outputSkeletonArcs || !outputSegmentation) {
63 this->
printErr(
"Error: output pointer is NULL.");
70 vtkDataArray *inputArray = this->GetInputArrayToProcess(0, inputVector);
75 if(input->IsA(
"vtkUnstructuredGrid")) {
80 inputWithId->ShallowCopy(input);
83 vtkNew<vtkConnectivityFilter> connectivity{};
84 connectivity->SetInputData(inputWithId);
85 connectivity->SetExtractionModeToAllRegions();
86 connectivity->ColorRegionsOn();
87 connectivity->Update();
89 nbCC_ = connectivity->GetOutput()
91 ->GetArray(
"RegionId")
100 for(
int cc = 0; cc <
nbCC_; cc++) {
101 vtkNew<vtkThreshold> threshold{};
102 threshold->SetInputConnection(connectivity->GetOutputPort());
103 threshold->SetInputArrayToProcess(
104 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS,
"RegionId");
105#if VTK_VERSION_NUMBER < VTK_VERSION_CHECK(9, 2, 0)
106 threshold->ThresholdBetween(cc, cc);
108 threshold->SetThresholdFunction(vtkThreshold::THRESHOLD_BETWEEN);
109 threshold->SetLowerThreshold(cc);
110 threshold->SetUpperThreshold(cc);
119 }
else if(input->IsA(
"vtkPolyData")) {
137 this->
printErr(
"Error : wrong triangulation.");
143#ifndef TTK_ENABLE_KAMIKAZE
144 this->
printErr(
"Error : wrong input scalars.");
150 this->
printMsg(
"Launching on field "
156 for(
int cc = 0; cc <
nbCC_; cc++) {
166 (
ftmTree_[cc].tree.build<VTK_TT, TTK_TT>(
172 ->getNumberOfNodes();
175 UpdateProgress(0.50);
179#ifndef TTK_ENABLE_KAMIKAZE
180 this->
printErr(
"Error : wrong properties on skeleton nodes.");
186#ifndef TTK_ENABLE_KAMIKAZE
187 this->
printErr(
"Error : wrong properties on skeleton arcs.");
193 outputSegmentation->ShallowCopy(input);
195#ifndef TTK_ENABLE_KAMIKAZE
196 this->
printErr(
"Error : wrong properties on segmentation.");
204#ifdef TTK_ENABLE_FTM_TREE_STATS_TIME
vtkDataArray * GetOrderArray(vtkDataSet *const inputData, const int scalarArrayIdx, ttk::Triangulation *triangulation, const bool getGlobalOrder=false, const int orderArrayIdx=0, const bool enforceOrderArrayIdx=false)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)