What is the function to extract colormap from volume data?

Hello. I have two questions.

language : python

  1. Does SetExtractionModeToLargestRegion () not apply to imagedata? only polydata?
  2. What is the function to extract colormap from volume data?

Thank you

Which filter are you using?

Colormap is not “volume data” and not stored in “volume data”. Color map is stored in a vtkScalarsToColors-derived class.

1 Like

Thank you for answer.

I converted png to vti (vtkimagedata).

And I want to share png’s colormap with vti (vtkimagedata). This is because I want to see the color of png in vti. Is there a simple example for this? Or is there a conceptual way?

Please understand my lack of English.


Just letting the mapper know to don’t interpret the values as scalars. That way the raw value will be used as is without applying a LookupTable to convert a number into a color since you already have the color encoded.

1 Like

Is there a way for vtkVolumeMapper not to interpret values ​​as scalars?
There seems to be no ColorMode.

Thank you for always.

This may help: https://vtk.org/doc/nightly/html/classvtkVolumeProperty.html#a2534a6dc500be42c9a842d405c4ee0bb

1 Like

Use vtkImageConnectivityFilter or vtkImageThresholdConnectivity.

1 Like