Maximum Intensity Projection

I am working on a project to detect cerebral aneurysm using UNET CNN. I am using MRA images in this project. I would need to convert the 3D images into 2D images before feeding it into the neural network or get MIP for the images. How can I use VTK for this

To generate MIP images, you have two options:

  • volume rendering (vtkGPUVolumeRayCastMapper): disable shading, choose MIP blend mode, you can generate hundreds of MIPs per second on a modern GPU
  • thick slab reslicing (vtkImageSlabReslice): it may is slow (may take several seconds to render a single image), but it does not require GPU, runs on any volume size that fits into your RAM, and can accumulate data at higher bit depth than just 8 bits per pixel.

@lassoan

I want to load a CT, reproject it with MIP and load it into slicer scene. Here is my code.

reader = vtk.vtkDataReader()
reader.SetFileName(‘…’)
reader.Update()

volumeMapper = vtk.vtkGPUVolumeRayCastMapper()
volumeMapper.SetInputConnection(reader.GetOutputPort())
volumeMapper.SetSampleDistance(0.01)
volumeMapper.SetBlendModeToMaximumIntensity()

volume = vtk.vtkVolume()
volume.SetMapper(volumeMapper)

reprojection = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLVolumeNode”, “reprojection”)

My question is how do I load volume into reprojection?

You can get rendering result into a vtkImageData using vtkWindowToImageFilter.

thanks a lot @lassoan

Another question.
I need the MIP in the coronal plane of a CT. I know I could use the Volume Rendering Module and take the screenshot of the 3D view. But is there an option to set that orientation directly at vtkGPUVolumeRayCastMapper?

thanks

The vtkGPUVolumeRayCastMapper is only responsible for computing pixel values, so you cannot set anything related to orientation there. The orientation the volume shows up in the renderd image is determined by the volume actor and the camera.