Volume Rendering with Binary mask

Hi , I have rendered a volume using vtkGPUVolumeRaycastMapper, now I need to mask the volume using binary mask
Mapper.SetMaskTypeToBinary()
Mapper.SetMaskInput(maskImageData) , but the mask is not working. Does anyone knows any solution, or is anything to be done in addition.
For preparing the mask I have created a 3D numpy array of type unsigned char(ubyte) , filling inside values with 255 and others with 0. I then converted this numpy array to vtkImageData.
Input volume data is a 3d numpy array of type unsigned 8 bit integer- Converted this to vtkImageData and set it as input to mapper as below:
mapper.SetInput(inputimage).
Volume is rendering, but mask is not working.Does anyone knows any solution, or is anything to be done in addition.