rjsgml5698
(Rjsgml5698)
September 9, 2019, 2:02am
1
Hello. I have two questions.
language : python
Does SetExtractionModeToLargestRegion () not apply to imagedata? only polydata?
What is the function to extract colormap from volume data?
Thank you
lassoan
(Andras Lasso)
September 9, 2019, 3:05am
2
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
rjsgml5698
(Rjsgml5698)
September 9, 2019, 4:36am
4
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.
Thanks.
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.
/**
* default (ColorModeToDefault), unsigned char scalars are treated
* as colors, and NOT mapped through the lookup table, while
* everything else is. ColorModeToDirectScalar extends
* ColorModeToDefault such that all integer types are treated as
* colors with values in the range 0-255 and floating types are
* treated as colors with values in the range 0.0-1.0. Setting
* ColorModeToMapScalars means that all scalar data will be mapped
* through the lookup table. (Note that for multi-component
* scalars, the particular component to use for mapping can be
* specified using the SelectColorArray() method.)
*/
vtkSetMacro(ColorMode, int);
vtkGetMacro(ColorMode, int);
void SetColorModeToDefault()
{ this->SetColorMode(VTK_COLOR_MODE_DEFAULT); }
void SetColorModeToMapScalars()
{ this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS); }
void SetColorModeToDirectScalars()
{ this->SetColorMode(VTK_COLOR_MODE_DIRECT_SCALARS); }
//@}
1 Like
rjsgml5698
(Rjsgml5698)
September 10, 2019, 5:32am
6
Sebastien_Jourdain:
vtkMapper.h
Is there a way for vtkVolumeMapper not to interpret values as scalars?
There seems to be no ColorMode.
Thank you for always.
cory.quammen
(Cory Quammen (Kitware))
September 10, 2019, 2:29pm
7
1 Like
dgobbi
(David Gobbi)
September 10, 2019, 10:30pm
8
rjsgml5698:
oes SetExtractionModeToLargestRegion () not apply to imagedata? only polydata?
Use vtkImageConnectivityFilter or vtkImageThresholdConnectivity .
1 Like