Hello,
I have a vtk data file, with several number of cellIDs (in this case 18 different IDs) is there any way to automatically do a discrete color scheme (that has no transition between different values of IDs, such as blot for example) but that it adapts to the number of IDs? as:
a. I dont know how many I will have for a specific file
b. there can be more IDs than KAAMS scheme (which it looks like to be the one with more colors)
here is a simple example of a vtk file to treat: vtkForPropagationGroups.vtk (18.1 KB)
Hello mathieu,
I just went a different way that will be more usefull in the end (not exactly what I was asking on my original post for sure, but maybe functional for someone that finds this post).
def createDisplayOfPropagationGroups(vtkReaderFilter=[]):
if vtkReaderFilter==[]:
vtkReaderFilter= GetActiveSource()
renderView = GetActiveView()
data=dsa.WrapDataObject(servermanager.Fetch(vtkReaderFilter))
N=len(set(data.CellData['CellEntityIds']))
thresholds=[]
threshold1Displays=[]
for i in range(N):
thresholds.append(Threshold(registrationName='Propagation group '+str(i), Input=vtkReaderFilter, Scalars = ['CELLS', 'CellEntityIds'],LowerThreshold = i-0.01, UpperThreshold=i+0.01))
threshold1Displays.append(Show(thresholds[-1], renderView, 'UnstructuredGridRepresentation'))
threshold1Displays[-1].LineWidth = 3.0
threshold1Displays[-1].Representation = 'Surface'
threshold1Displays[-1].SetScalarBarVisibility(renderView, True)
thresholds[-1].UpdatePipeline()
Hide(vtkReaderFilter, renderView)
renderView.Update()
return
the only issue I am having right now is that eventhought I am creating the displays objects (with the Show() function) the object are created and everything but they are not shown in the layout view.