Volume Rendering - Using different scalars for opacity and color transfer function
I have a three dimensional volume (vtkImageData) which is rendered using ray casting (vtkFixedPointVolumeRayCastMapper). I attached an opacity (vtkPiecewiseFunction) and colour transfer function (vtkColorTransferFunction) to it using vtkVolumeProperty.
The volume consists of two scalar attributes. I want to map the first scalar attribute of a voxel to opacity and the second attribute of the same voxel to the colour. I'm stuck on figuring out how to do that! At the moment, I create two vtkVolume for rendering each scalar attribute itself. However, the result is not satisfying.
Here is a minimal code example in python to describe the problem:
# At this point I want to use the scalars which stem from the magnitude field of the vector field
colorTF = vtkColorTransferFunction()
colorTF.AddRGBPoint(self.minimum, 0, 1, 0)
colorTF.AddRGBPoint(self.maximum, 1, 0, 0)