40 vtkInformationVector **inputVector,
41 vtkInformationVector *outputVector) {
44 auto boundFields = vtkDataSet::GetData(outputVector, 0);
46 auto probability = vtkDataSet::GetData(outputVector, 1);
48 auto mean = vtkDataSet::GetData(outputVector, 2);
51 int const numInputs = inputVector[0]->GetNumberOfInformationObjects();
52 this->
printMsg(std::vector<std::vector<std::string>>{
53 {
"#Inputs", std::to_string(numInputs)}});
56 std::vector<vtkDataSet *> input(numInputs);
57 for(
int i = 0; i < numInputs; i++) {
58 input[i] = vtkDataSet::GetData(inputVector[0], i);
62 boundFields->ShallowCopy(input[0]);
63 probability->ShallowCopy(input[0]);
64 mean->ShallowCopy(input[0]);
70 std::vector<vtkDataArray *> inputScalarField;
72 for(
int i = 0; i < numInputs; i++) {
73 numArrays = input[i]->GetPointData()->GetNumberOfArrays();
74 numFields += numArrays;
75 for(
int iarray = 0; iarray < numArrays; iarray++) {
76 inputScalarField.push_back(input[i]->GetPointData()->GetArray(iarray));
80 this->
printMsg(std::vector<std::vector<std::string>>{
81 {
"#Fields", std::to_string(numFields)}});
83 for(
int i = 0; i < numFields; i++) {
86 if(inputScalarField[i]->GetDataType()
87 != inputScalarField[0]->GetDataType()) {
88 this->
printErr(
"Inputs of different data types.");
91 if(inputScalarField[i]->GetNumberOfTuples()
92 != inputScalarField[0]->GetNumberOfTuples()) {
93 this->
printErr(
"Inputs with different number of points.");
97 if(!inputScalarField[i])
102 inputScalarField[0]->NewInstance()};
104 inputScalarField[0]->NewInstance()};
105 outputLowerBoundScalarField->SetName(
"lowerBoundField");
106 outputUpperBoundScalarField->SetName(
"upperBoundField");
109 std::vector<std::vector<std::string>>{{
"#Bins", std::to_string(
BinCount)}});
111 std::vector<vtkNew<vtkDoubleArray>> probabilityScalarField(
BinCount);
115 probabilityScalarField[b]->SetNumberOfTuples(input[0]->GetNumberOfPoints());
116 probability->GetPointData()->AddArray(probabilityScalarField[b]);
117 probabilityScalarField[b]->FillComponent(0, 0.);
122 vtkNew<vtkDoubleArray> meanField{};
123 meanField->SetNumberOfTuples(input[0]->GetNumberOfPoints());
124 meanField->SetName(
"meanField");
125 meanField->FillComponent(0, 0.0);
127 mean->GetPointData()->AddArray(meanField);
131 outputLowerBoundScalarField->SetNumberOfTuples(
132 input[0]->GetNumberOfPoints());
133 boundFields->GetPointData()->AddArray(outputLowerBoundScalarField);
135 outputLowerBoundScalarField->SetNumberOfTuples(0);
139 outputUpperBoundScalarField->SetNumberOfTuples(
140 input[0]->GetNumberOfPoints());
141 boundFields->GetPointData()->AddArray(outputUpperBoundScalarField);
143 outputUpperBoundScalarField->SetNumberOfTuples(0);
153 for(
int i = 0; i < numFields; i++) {
166 b, ttkUtils::GetPointer<double>(probabilityScalarField[b]));
169 switch(inputScalarField[0]->GetDataType()) {
170 vtkTemplateMacro(this->execute<VTK_TT>());
174 std::stringstream name{};
175 name << std::setprecision(8) << this->
getBinValue(b);
176 probabilityScalarField[b]->SetName(name.str().c_str());