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.

I have met the same problem. Have you solved it?

yes . I solved it. My problem was that I was using 2 render windows - one pop up window - vtkRenderWindowInteractor and other wxVTKRenderWindowInteractor. If we are using 2 renderes, then masking is not working( don’t know the reason though ).
If your input data and mask is of same shape, then it should work.

I will check my code following your suggestion.Thank you.