Commit 3f0d2286 authored by Sujin Philip's avatar Sujin Philip

Update VTK-m

Also update the VTK-m based filters to work properly with the changes
parent 01e6dc56
......@@ -60,44 +60,50 @@ int vtkmAverageToCells::RequestData(vtkInformation* vtkNotUsed(request),
// grab the input array to process to determine the field we want to average
int association = this->GetInputArrayAssociation(0, inputVector);
if (association != vtkDataObject::FIELD_ASSOCIATION_POINTS)
auto fieldArray = this->GetInputArrayToProcess(0, inputVector);
if (association != vtkDataObject::FIELD_ASSOCIATION_POINTS ||
fieldArray == nullptr ||
fieldArray->GetName() == nullptr || fieldArray->GetName()[0] == '\0')
{
vtkErrorMacro(<< "Must be asked to average a cell based field.");
return 1;
}
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input);
// convert the array over to vtkm
vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector);
vtkm::cont::Field field = tovtkm::Convert(inputArray, association);
const bool dataSetValid =
in.GetNumberOfCoordinateSystems() > 0 && in.GetNumberOfCellSets() > 0;
const bool fieldValid =
(field.GetAssociation() == vtkm::cont::Field::ASSOC_POINTS) &&
(field.GetName() != std::string());
if (!(dataSetValid && fieldValid))
{
vtkErrorMacro(<< "Unable convert dataset over to VTK-m for input.");
vtkErrorMacro(<< "Invalid field: Requires a point field with a valid name.");
return 0;
}
vtkmInputFilterPolicy policy;
vtkm::filter::CellAverage filter;
filter.SetOutputFieldName(field.GetName()); // should we expose this control?
vtkm::filter::Result result = filter.Execute(in, field, policy);
const char* fieldName = fieldArray->GetName();
if (result.IsFieldValid())
try
{
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input);
auto field = tovtkm::Convert(fieldArray, association);
in.AddField(field);
vtkmInputFilterPolicy policy;
vtkm::filter::CellAverage filter;
filter.SetActiveField(fieldName, vtkm::cont::Field::ASSOC_POINTS);
filter.SetOutputFieldName(fieldName); // should we expose this control?
auto result = filter.Execute(in, policy);
// convert back the dataset to VTK, and add the field as a cell field
vtkDataArray* resultingArray = fromvtkm::Convert(result.GetField());
vtkDataArray* resultingArray =
fromvtkm::Convert(result.GetCellField(fieldName));
if (resultingArray == nullptr)
{
vtkErrorMacro(<< "Unable to convert result array from VTK-m to VTK");
return 0;
}
output->GetCellData()->AddArray(resultingArray);
resultingArray->FastDelete();
return 1;
}
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
return 0;
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -61,44 +61,50 @@ int vtkmAverageToPoints::RequestData(vtkInformation *vtkNotUsed(request),
//grab the input array to process to determine the field we want to average
int association = this->GetInputArrayAssociation(0, inputVector);
if(association != vtkDataObject::FIELD_ASSOCIATION_CELLS)
{
vtkErrorMacro( << "Must be asked to average a cell based field.");
return 1;
}
//convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input);
//convert the array over to vtkm
vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector);
vtkm::cont::Field field = tovtkm::Convert( inputArray, association );
const bool dataSetValid =
in.GetNumberOfCoordinateSystems() >0 && in.GetNumberOfCellSets() > 0;
const bool fieldValid =
(field.GetAssociation() == vtkm::cont::Field::ASSOC_CELL_SET) &&
(field.GetName() != std::string());
if(! (dataSetValid && fieldValid) )
{
vtkErrorMacro( << "Unable convert dataset over to VTK-m for input.");
auto fieldArray = this->GetInputArrayToProcess(0, inputVector);
if (association != vtkDataObject::FIELD_ASSOCIATION_CELLS ||
fieldArray == nullptr ||
fieldArray->GetName() == nullptr || fieldArray->GetName()[0] == '\0')
{
vtkErrorMacro(<< "Invalid field: Requires a cell field with a valid name.");
return 0;
}
}
const char* fieldName = fieldArray->GetName();
vtkmInputFilterPolicy policy;
vtkm::filter::PointAverage filter;
filter.SetOutputFieldName(field.GetName()); //should we expose this control?
vtkm::filter::Result result = filter.Execute( in, field, policy );
try
{
//convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input);
auto field = tovtkm::Convert(fieldArray, association);
in.AddField(field);
if(result.IsFieldValid())
vtkmInputFilterPolicy policy;
vtkm::filter::PointAverage filter;
filter.SetActiveField(fieldName, vtkm::cont::Field::ASSOC_CELL_SET);
filter.SetOutputFieldName(fieldName); //should we expose this control?
auto result = filter.Execute(in, policy);
// convert back the dataset to VTK, and add the field as a point field
vtkDataArray* resultingArray =
fromvtkm::Convert(result.GetPointField(fieldName));
if (resultingArray == nullptr)
{
//convert back the dataset to VTK, and add the field as a point field
vtkDataArray* resultingArray = fromvtkm::Convert(result.GetField());
vtkErrorMacro(<< "Unable to convert result array from VTK-m to VTK");
return 0;
}
output->GetPointData()->AddArray(resultingArray);
resultingArray->FastDelete();
return 1;
}
}
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
return 0;
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -76,53 +76,38 @@ int vtkmCleanGrid::RequestData(vtkInformation* vtkNotUsed(request),
vtkUnstructuredGrid* output =
vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input,
tovtkm::FieldsFlag::PointsAndCells);
if (in.GetNumberOfCoordinateSystems() <= 0 || in.GetNumberOfCellSets() <= 0)
try
{
vtkErrorMacro(<< "Could not convert vtk dataset to vtkm dataset");
return 0;
}
// apply the filter
vtkmInputFilterPolicy policy;
vtkm::filter::CleanGrid filter;
filter.SetCompactPointFields(this->CompactPoints);
vtkm::filter::Result result = filter.Execute(in, policy);
if (!result.IsDataSetValid())
{
vtkErrorMacro(<< "VTKm CleanGrid algorithm failed to run");
return 0;
}
// map fields
vtkm::Id numFields = static_cast<vtkm::Id>(in.GetNumberOfFields());
for (vtkm::Id fieldIdx = 0; fieldIdx < numFields; ++fieldIdx)
{
const vtkm::cont::Field &field = in.GetField(fieldIdx);
try
{
filter.MapFieldOntoOutput(result, field, policy);
}
catch (vtkm::cont::Error &e)
// convert the input dataset to a vtkm::cont::DataSet
auto fieldsFlag = this->CompactPoints ?
tovtkm::FieldsFlag::Points :
tovtkm::FieldsFlag::None;
vtkm::cont::DataSet in = tovtkm::Convert(input, fieldsFlag);
// apply the filter
vtkmInputFilterPolicy policy;
vtkm::filter::CleanGrid filter;
filter.SetCompactPointFields(this->CompactPoints);
auto result = filter.Execute(in, policy);
// convert back to vtkDataSet (vtkUnstructuredGrid)
if (!fromvtkm::Convert(result, output, input))
{
vtkWarningMacro(<< "Unable to use VTKm to convert field( "
<< field.GetName() << " ) to the CleanGrid"
<< " output: " << e.what());
vtkErrorMacro(<< "Unable to convert VTKm DataSet back to VTK");
return 0;
}
}
// convert back to vtkDataSet (vtkUnstructuredGrid)
if (!fromvtkm::Convert(result.GetDataSet(), output, input))
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "Unable to convert VTKm DataSet back to VTK");
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
// pass cell data
if (!this->CompactPoints)
{
output->GetPointData()->PassData(input->GetPointData());
}
output->GetCellData()->PassData(input->GetCellData());
return 1;
......
......@@ -114,61 +114,76 @@ int vtkmClip::RequestData(vtkInformation *,
// Find the scalar array:
int assoc = this->GetInputArrayAssociation(0, inInfoVec);
vtkDataArray *scalars = this->GetInputArrayToProcess(0, inInfoVec);
// Validate input objects:
if (!scalars)
if (assoc != vtkDataObject::FIELD_ASSOCIATION_POINTS ||
scalars == nullptr || scalars->GetName() == nullptr ||
scalars->GetName()[0] == '\0')
{
vtkErrorMacro("Specified scalar array not found.");
return 1;
}
if (input->GetNumberOfPoints() == 0)
{
vtkErrorMacro("No points in input dataset!");
return 1;
vtkErrorMacro("Invalid scalar array; array missing or not a point array.");
return 0;
}
if (input->GetNumberOfCells() == 0)
// Validate input objects:
if (input->GetNumberOfPoints() == 0 || input->GetNumberOfCells() == 0)
{
vtkErrorMacro("No cells in input dataset!");
return 1;
return 1; // nothing to do
}
// Convert inputs to vtkm objects:
vtkm::cont::DataSet in = tovtkm::Convert(input,
tovtkm::FieldsFlag::PointsAndCells);
vtkm::cont::Field inField = tovtkm::Convert(scalars, assoc);
if (inField.GetAssociation() != vtkm::cont::Field::ASSOC_POINTS ||
inField.GetName() == std::string())
try
{
vtkErrorMacro("Invalid scalar array; array missing or not a point array.");
return 1;
}
// Convert inputs to vtkm objects:
auto fieldsFlag = this->ComputeScalars ?
tovtkm::FieldsFlag::PointsAndCells :
tovtkm::FieldsFlag::None;
auto in = tovtkm::Convert(input, fieldsFlag);
// Run filter:
vtkm::cont::DataSet result;
vtkmInputFilterPolicy policy;
if (this->ClipFunction)
{
vtkm::filter::ClipWithImplicitFunction functionFilter;
auto function = this->ClipFunctionConverter->Get();
if (function.GetValid())
{
functionFilter.SetImplicitFunction(function);
result = functionFilter.Execute(in, policy);
}
}
else
{
vtkm::filter::ClipWithField fieldFilter;
if (!this->ComputeScalars)
{
// explicitly convert just the field we need
auto inField = tovtkm::Convert(scalars, assoc);
in.AddField(inField);
// don't pass this field
fieldFilter.SetFieldsToPass(
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_NONE));
}
// Configure vtkm filter:
vtkm::filter::ClipWithField fieldFilter;
vtkm::filter::ClipWithImplicitFunction functionFilter;
fieldFilter.SetActiveField(scalars->GetName(), vtkm::cont::Field::ASSOC_POINTS);
fieldFilter.SetClipValue(this->ClipValue);
result = fieldFilter.Execute(in, policy);
}
// Run filter:
vtkm::filter::Result result;
vtkmInputFilterPolicy policy;
if (this->ClipFunction)
{
auto function = this->ClipFunctionConverter->Get();
if (function.GetValid())
// Convert result to output:
if (!fromvtkm::Convert(result, output, input))
{
functionFilter.SetImplicitFunction(function);
result = functionFilter.Execute(in, policy);
vtkErrorMacro("Error generating vtkUnstructuredGrid from vtkm's result.");
return 0;
}
if (this->ComputeScalars)
{
output->GetPointData()->SetActiveScalars(scalars->GetName());
}
}
else
{
fieldFilter.SetClipValue(this->ClipValue);
result = fieldFilter.Execute(in, inField, policy);
}
if (!result.IsDataSetValid())
return 1;
}
catch (const vtkm::cont::Error& e)
{
vtkWarningMacro(<< "vtkm Clip filter failed to run.\n"
vtkWarningMacro(<< "VTK-m error: " << e.GetMessage()
<< "Falling back to serial implementation.");
vtkNew<vtkTableBasedClipDataSet> filter;
......@@ -177,47 +192,8 @@ int vtkmClip::RequestData(vtkInformation *,
filter->SetInputData(input);
filter->Update();
output->ShallowCopy(filter->GetOutput());
return 1;
}
vtkm::Id numFields = static_cast<vtkm::Id>(in.GetNumberOfFields());
for (vtkm::Id fieldIdx = 0; fieldIdx < numFields; ++fieldIdx)
{
const vtkm::cont::Field &field = in.GetField(fieldIdx);
try
{
bool success = this->ClipFunction ?
functionFilter.MapFieldOntoOutput(result, field, policy) :
fieldFilter.MapFieldOntoOutput(result, field, policy);
if (!success)
{
throw vtkm::cont::ErrorBadValue("MapFieldOntoOutput returned false.");
}
}
catch (vtkm::cont::Error &e)
{
vtkWarningMacro(<< "Unable to use VTKm to convert field( "
<< field.GetName() << " ) to the Clip"
<< " output: " << e.what());
}
}
// Convert result to output:
bool outputValid = fromvtkm::Convert(result.GetDataSet(), output, input);
if (!outputValid)
{
vtkErrorMacro("Error generating vtkUnstructuredGrid from vtkm's result.");
output->Initialize();
return 1;
}
if (this->ComputeScalars)
{
output->GetPointData()->SetActiveScalars(scalars->GetName());
}
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -67,106 +67,77 @@ int vtkmContour::RequestData(vtkInformation* request,
vtkPolyData* output =
vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
const int numContours = this->GetNumberOfContours();
if(numContours == 0)
{
return 1;
}
vtkm::filter::MarchingCubes filter;
// set local variables
filter.SetGenerateNormals(this->GetComputeNormals() != 0);
filter.SetNumberOfIsoValues(numContours);
for(int i = 0; i < numContours; ++i)
{
filter.SetIsoValue(i, this->GetValue(i));
}
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in;
if (this->ComputeScalars)
{
in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
}
else
{
in = tovtkm::Convert(input, tovtkm::FieldsFlag::None);
}
// we need to map the given property to the data set
// Find the scalar array:
int association = this->GetInputArrayAssociation(0, inputVector);
vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector);
vtkm::cont::Field inField = tovtkm::Convert(inputArray, association);
const bool dataSetValid =
in.GetNumberOfCoordinateSystems() > 0 && in.GetNumberOfCellSets() > 0;
const bool fieldValid =
(inField.GetAssociation() != vtkm::cont::Field::ASSOC_ANY) &&
(inField.GetName() != std::string());
if (!dataSetValid)
vtkDataArray *inputArray = this->GetInputArrayToProcess(0, inputVector);
if (association != vtkDataObject::FIELD_ASSOCIATION_POINTS ||
inputArray == nullptr || inputArray->GetName() == nullptr ||
inputArray->GetName()[0] == '\0')
{
vtkWarningMacro(<< "Will not be able to use VTKm dataset type is unknown");
vtkErrorMacro("Invalid scalar array; array missing or not a point array.");
return 0;
}
if (!fieldValid)
const int numContours = this->GetNumberOfContours();
if(numContours == 0)
{
vtkWarningMacro(<< "Will not be able to use VTKm field type is unknown");
return 1;
}
vtkm::filter::Result result;
bool convertedDataSet = false;
if (dataSetValid && fieldValid)
try
{
vtkmInputFilterPolicy policy;
result = filter.Execute(in, inField, policy);
if (!result.IsDataSetValid())
vtkm::filter::MarchingCubes filter;
filter.SetActiveField(inputArray->GetName(), vtkm::cont::Field::ASSOC_POINTS);
filter.SetGenerateNormals(this->GetComputeNormals() != 0);
filter.SetNumberOfIsoValues(numContours);
for(int i = 0; i < numContours; ++i)
{
vtkWarningMacro(<< "VTKm contour algorithm was failed to run. \n"
<< "Falling back to serial implementation.");
return this->Superclass::RequestData(request, inputVector, outputVector);
filter.SetIsoValue(i, this->GetValue(i));
}
vtkm::Id numFields = static_cast<vtkm::Id>(in.GetNumberOfFields());
for (vtkm::Id fieldIdx = 0; fieldIdx < numFields; ++fieldIdx)
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in;
if (this->ComputeScalars)
{
const vtkm::cont::Field &field = in.GetField(fieldIdx);
try
{
filter.MapFieldOntoOutput(result, field, policy);
}
catch (vtkm::cont::Error &e)
{
vtkWarningMacro(<< "Unable to use VTKm to convert field( "
<< field.GetName() << " ) to the MarchingCubes"
<< " output: " << e.what());
}
in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
}
else
{
in = tovtkm::Convert(input, tovtkm::FieldsFlag::None);
// explicitly convert just the field we need
auto inField = tovtkm::Convert(inputArray, association);
in.AddField(inField);
// don't pass this field
filter.SetFieldsToPass(
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_NONE));
}
// convert back the dataset to VTK
convertedDataSet = fromvtkm::Convert(result.GetDataSet(), output, input);
vtkm::cont::DataSet result;
vtkmInputFilterPolicy policy;
result = filter.Execute(in, policy);
if (!convertedDataSet)
// convert back the dataset to VTK
if (!fromvtkm::Convert(result, output, input))
{
vtkWarningMacro(<< "Unable to convert VTKm DataSet back to VTK.\n"
<< "Falling back to serial implementation.");
return this->Superclass::RequestData(request, inputVector, outputVector);
}
if (this->ComputeScalars)
{
output->GetPointData()->SetActiveScalars(inputArray->GetName());
}
if (this->ComputeNormals)
{
output->GetPointData()->SetActiveAttribute(
filter.GetNormalArrayName().c_str(), vtkDataSetAttributes::NORMALS);
}
}
if (this->ComputeScalars)
{
output->GetPointData()->SetActiveScalars(inputArray->GetName());
}
if (this->ComputeNormals)
catch (const vtkm::cont::Error& e)
{
output->GetPointData()->SetActiveAttribute(
filter.GetNormalArrayName().c_str(), vtkDataSetAttributes::NORMALS);
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
// we got this far, everything is good
......
......@@ -115,49 +115,28 @@ int vtkmExternalFaces::RequestData(vtkInformation* vtkNotUsed(request),
vtkUnstructuredGrid* output =
vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input,
tovtkm::FieldsFlag::PointsAndCells);
if (in.GetNumberOfCoordinateSystems() <= 0 || in.GetNumberOfCellSets() <= 0)
try
{
vtkErrorMacro(<< "Could not convert vtk dataset to vtkm dataset");
return 0;
}
vtkmInputFilterPolicy policy;
// apply the filter
vtkm::filter::ExternalFaces filter;
filter.SetCompactPoints(this->CompactPoints);
filter.SetPassPolyData(true);
vtkm::filter::Result result = filter.Execute(in, policy);
if (!result.IsDataSetValid())
{
vtkErrorMacro(<< "VTKm ExternalFaces algorithm failed to run");
return 0;
}
// map fields
vtkm::Id numFields = static_cast<vtkm::Id>(in.GetNumberOfFields());
for (vtkm::Id fieldIdx = 0; fieldIdx < numFields; ++fieldIdx)
{
const vtkm::cont::Field& field = in.GetField(fieldIdx);
try
// convert the input dataset to a vtkm::cont::DataSet
auto in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
// apply the filter
vtkmInputFilterPolicy policy;
vtkm::filter::ExternalFaces filter;
filter.SetCompactPoints(this->CompactPoints);
filter.SetPassPolyData(true);
auto result = filter.Execute(in, policy);
// convert back to vtkDataSet (vtkUnstructuredGrid)
if (!fromvtkm::Convert(result, output, input))
{
filter.MapFieldOntoOutput(result, field, policy);
}
catch (vtkm::cont::Error& e)
{
vtkWarningMacro(<< "Unable to use VTKm to convert field( "
<< field.GetName() << " ) to the ExternalFaces"
<< " output: " << e.what());
vtkErrorMacro(<< "Unable to convert VTKm DataSet back to VTK");
return 0;
}
}
// convert back to vtkDataSet (vtkUnstructuredGrid)
if (!fromvtkm::Convert(result.GetDataSet(), output, input))
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "Unable to convert VTKm DataSet back to VTK");
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
......
......@@ -70,64 +70,42 @@ int vtkmExtractVOI::RequestData(
vtkImageData* output =
vtkImageData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
// convert the input dataset to a vtkm::cont::DataSet
vtkm::cont::DataSet in = tovtkm::Convert(input,
tovtkm::FieldsFlag::PointsAndCells);
if (in.GetNumberOfCoordinateSystems() <= 0 || in.GetNumberOfCellSets() <= 0)
try
{
vtkErrorMacro(<< "Could not convert vtk dataset to vtkm dataset");
return 0;
}
// transform VOI
int inExtents[6], voi[6];
input->GetExtent(inExtents);
for (int i = 0; i < 6; i += 2)
{
voi[i] = this->VOI[i] - inExtents[i];
voi[i + 1] = this->VOI[i + 1] - inExtents[i] + 1;
}
vtkm::filter::PolicyBase<InputFilterPolicy> policy;
// apply the filter
vtkm::filter::ExtractStructured filter;
filter.SetVOI(voi[0], voi[1], voi[2], voi[3], voi[4], voi[5]);
filter.SetSampleRate(this->SampleRate[0], this->SampleRate[1], this->SampleRate[2]);
filter.SetIncludeBoundary( (this->IncludeBoundary != 0 ) );
vtkm::filter::Result result = filter.Execute(in, policy);
if (!result.IsDataSetValid())
{
vtkWarningMacro(<< "VTKm ExtractStructured algorithm failed to run."
<< "Falling back to vtkExtractVOI.");
return this->Superclass::RequestData(request, inputVector, outputVector);
}
// convert the input dataset to a vtkm::cont::DataSet
auto in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
// Map fields:
vtkm::Id numFields = static_cast<vtkm::Id>(in.GetNumberOfFields());
for (vtkm::Id fieldIdx = 0; fieldIdx < numFields; ++fieldIdx)
{
const vtkm::cont::Field &field = in.GetField(fieldIdx);
try
// transform VOI
int inExtents[6], voi[6];
input->GetExtent(inExtents);
for (int i = 0; i < 6; i += 2)
{
filter.MapFieldOntoOutput(result, field, policy);
voi[i] = this->VOI[i] - inExtents[i];
voi[i + 1] = this->VOI[i + 1] - inExtents[i] + 1;
}
catch (vtkm::cont::Error &e)
// apply the filter
vtkm::filter::PolicyBase<InputFilterPolicy> policy;
vtkm::filter::ExtractStructured filter;
filter.SetVOI(voi[0], voi[1], voi[2], voi[3], voi[4], voi[5]);
filter.SetSampleRate(this->SampleRate[0], this->SampleRate[1], this->SampleRate[2]);
filter.SetIncludeBoundary( (this->IncludeBoundary != 0 ) );
auto result = filter.Execute(in, policy);