Blurry contour plot with vtkBandedPolyDataContourFilter

Hello everyone,

I am trying to colour a 2D representation with a contour plot for which I am using vtkBandedPolyDataContourFilter. The available examples show very neat constant colouring within the bands, so I am a little confused by what I am getting here:

As you can see, I extract some bands as I can draw their lines, but the colouring inside the bands looks quite blurred. Here is the responsible section of code:

auto bf = vtkBandedPolyDataContourFilter::New();
		bf->SetInputConnection(visualization);
		bf->SetGenerateContourEdges(true);
		bf->SetScalarModeToValue();
		bf->GenerateValues(scalingData->GetColourResolution(), scalarRange);
		bf->Update();

		vtkNew<vtkLookupTable> lut;
		lut->SetNumberOfTableValues(scalingData->GetColourResolution());
		lut->SetTableRange(scalarRange);
		lut->SetHueRange(.667, 0.0);
		lut->SetAlphaRange(1., 1.);
		lut->IndexedLookupOff();
		lut->Build();

		vtkNew<vtkPolyDataMapper> edgeMapper;
		edgeMapper->SetInputData(bf->GetContourEdgesOutput());
		edgeMapper->SetResolveCoincidentTopologyToPolygonOffset();
		
		vtkNew<vtkActor> edgeActor;
		edgeActor->SetMapper(edgeMapper);
		edgeActor->GetProperty()->SetColor(0, 0, 0);

		vtkNew<vtkPolyDataMapper> testAusgabe;
		testAusgabe->SetInputConnection(bf->GetOutputPort());
		testAusgabe->SetLookupTable(lut);
		testAusgabe->SetScalarRange(scalarRange);
		testAusgabe->SetScalarModeToUsePointData();
		//testAusgabe->SetColorModeToMapScalars();
		
		testAusgabe->Update();

		vtkNew<vtkActor> testAktor;
		testAktor->SetMapper(testAusgabe);

It seems I am stuck here, so I would appreciate any pointers in the right direction.
Kind regards,
Jan

It’s hard to say for sure without seeing the data (i.e., the mesh) but my guess is that during rendering the graphics system interpolation is the culprit. This is further exaggerated by comparison to the band lines which look very regular, and are computed using a different approach than the graphics hardware etc. If it’s possible to increase the resolution of the mesh you might see better results.

It’s quite a bit data thats generated by a different module, so I could just post the content of the data set. Would that help?
I am using a uniform mesh that is stored as vtkRectilinearGrid. The displayed values are the absolute values of the point-vector-values. The mesh is already quite fine, the colour mapping maybe a bit coarse and when I increase it (with the contour lines turned of) it looks indeed quite smooth.

But my understanding is that the vtkBandedPolyDataContourFilter should fill each of the bands with a single colour, right?
At least that seems to be the case when I am looking at these examples:
https://kitware.github.io/vtk-examples/site/Cxx/Visualization/CurvatureBandsWithGlyphs/
https://kitware.github.io/vtk-examples/site/Cxx/Visualization/ElevationBandsWithGlyphs/

You’ll need to color the result of the vtkBandedPolyDataContourFilter using cell data: testAusgabe->SetScalarModeToUseCellData();

(Your current example uses point data: testAusgabe->SetScalarModeToUsePointData(); )