Switching to show different dataarrays (edited)

As the past few questions show, I am still really new to this and would appreciate any help available. My question is can you color a vti file using cell data? if so, is there a way to tell the volumeMapper or Volume actor to choose which type of data it should use? I know you are able to do that with vtp files, I just curious if you can do the same here.

Yeah you should be able to color using cell data. Check out the code for setColorBy(array, location, componentIndex) here: https://github.com/Kitware/vtk-js/blob/master/Sources/Proxy/Core/AbstractRepresentationProxy/index.js#L123 for a sort of overview of how this is done. (Note that arrayLocation = "cellData" in your case.)

All you should really need to do is to set your lookup table on the mapper, and then adjust your lookup table’s data range to be the range of your cell data array.

The example is for the regular mapper, is it the same way for volumeMapper?

Hm, I don’t think you can color by cell data with the VolumeMapper (unless @Sebastien_Jourdain knows how). I would instead recommend moving your data as another component of the point data scalars, and use multi-component rendering as seen here: https://kitware.github.io/vtk-js/examples/TestVolumeTypes.html. I think that should work for you.

Oh, I did not know that you can’t color via cell color. I will look into multi-component rendering.