MIP - Max Intensity Projection with Bones

Dear All, I am working on a project on visualizating MIP of carotid-cerebral arteries of two types, namely with bone shown and without. The results are like these.
QQ截图20221216145034
QQ截图20221216145046

Here, I succeeded in vislualization top image ( removing bones by a high intensity threshold and mip )

Class vtkFixedPointVolumeRayCastMapper

code are as the following

volumeMapper = vtk.vtkFixedPointVolumeRayCastMapper()
volumeMapper.SetInputConnection( vtkImage.GetOutputPort())
volumeMapper.SetBlendModeToMaximumIntensity()

But in order to get the second one, I used the same class on image (with bones), and only to get a bright silouette. Then I realized it is the intensity of bones that is shown in this mip image.
Later, I think I could achieve if by generating a No-Bones MIP, and on top of it, laying one slice of bone image (like image blending).
However, after searching quite a while, I could not make it.
Please help me if you know how to finish this blending process in VTK.
Any hint and suggestion is appreciated.
Thanks in Advance!!

Reply to myself,
I found that to get carotid-cerebral mip, it is not possible to get max intensity through whole image.
A thickness needed to choose before conducting mip.

Do you have two different datasets - with and without bones?

I recommend using vtkGPUVolumeRayCastMapper instead of the vtkFixedPointVolumeRayCastMapper. The mapper can also do an average intensity projection which might give you better results in the first case.

Dear Sankhesh,
Thank you for your reply.
I have one dataset (initially with bones)
Unfortunately, I dot not have GPU, I am afraid I cant use vtkGPUVolumeRayCastMapper.
I find that

vtkImageSlabReslice

might be the right function to do this job, and I found one example written in C++. Code will be like

vtkNew reslice;
reslice->SetInputConnection(reader->GetOutputPort());
reslice->SetOutputDimensionality(2);
reslice->SetResliceAxes(resliceAxes);
reslice->SetInterpolationModeToLinear();
reslice->SetSlabThickness(20);
reslice->SetBlendModeToMax();
reslice->Update();

I will try to convert it into python.
Thanks for your suggestion anyway.

Slab rendering can also be done with vtkImageResliceMapper. For an example of how to use, see TestResliceMapperSlab.cxx.

    vtkNew<vtkImageResliceMapper> imageMapper;
    imageMapper->SetInputConnection(reader->GetOutputPort());
    imageMapper->SetSlabTypeToMax();
    imageMapper->SetSlabThickness(20);
    imageMapper->SliceFacesCameraOn();

    vtkNew<vtkImageSlice> image;
    image->SetMapper(imageMapper);
    image->GetProperty()->SetInterpolationTypeToLinear();
    image->GetProperty()->SetColorWindow(2000);
    image->GetProperty()->SetColorLevel(1000);

    renderer->AddViewProp(image);

Dear David,
Thank you so much for your suggestion.
I will give it a try!!