Enhancing Orbital Walls With Unsharp Mask Filtering

Hello all,

I was looking into ways to make segmenting eye orbits a bit easier (for bio models in the public hospital)

I found this handy list of hints segmentation of thin surfaces

I have also read through the masters thesis which was also linked in this post: Masters Thesis

First I cropped the volume around the orbit and made it have isotropic voxels, I also halved the size of the voxels so the volume is higher resolution (all with crop volume module).

The thesis mentioned Richardson Lucy Deconvolution and Unsharp Mask filtering. I managed to find both of these in the simple filters module but I must admit I have no idea how to use them. The thesis mentioned Richardson Lucy Deconvolution with 80 iterations works well so I tried that with 80 iterations and all other settings default and my computer usually crashes horrendously.

With Unsharp mask filtering I cannot get it to run and always get this error:

Is there anyone who knows how to use these filters? We make a lot of bio models in the public hospital to assist with surgery and any way to save time on segmenting orbits would be very helpful.

Thanks very much.

1 Like

Hi, i executed Richardson Lucy Deconvolution filter without any problems, did you try with less iterations?

as for Unsharp Mask image filter, try running this script on the python interactor to fix the volume before running the filter: first rename your volume to Master then run this script:

import SimpleITK as sitk
import sitkUtils
input_vol = getNode(“Master”)
output_vol = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLScalarVolumeNode’, “Fixed Master”)
inputImage = sitkUtils.PullVolumeFromSlicer(input_vol)
caster = sitk.CastImageFilter()
pixelID = sitk.sitkFloat32
caster.SetOutputPixelType(pixelID)
inputImage = caster.Execute(inputImage)
sitkUtils.PushVolumeToSlicer(inputImage, output_vol)

Hi Amine,

Thank you very much for your help. The code worked great. I had to change all the " symbols and the ’ symbols for it to work as they seemed to have changed format in the copy and pasting process somewhere.

I guess this code does the same thing as changing the volume type to ‘float’ in the ‘cast scalar volume’ module?

The Unsharp mask filtering gave excellent results. The following is an image of a segmented orbit with no filters applied. The volume has just been cropped and converted to isotropic voxels and b spline interpolation using the ‘crop volume’ module.

The following is the segmented orbit with some filtering done on the volume:

This is a really big improvement and saves between half an hour to an hour of manual painting slice by slice.

Here is what I did:

  1. Import the DICOM images, make an ROI around the orbit of interest. Then crop the volume with isotropic voxels selected and b spline interpolation.

  2. Once the volume is cropped I go to the ‘Cast Scalar Volume’ module and convert the volume to ‘float’.

  3. Then go to the Simple filters module and select Unsharp Mask Image Filter. Choose the cropped volume as an input and create a new output volume. The settings which worked the best for me were sigmas = 1x1x1, Amount = 2 and Threshold = 40.

Increasing the sigmas seemed to fatten up the walls but result in more noisyness. Increasing the amount seems to increase the definition of the orbital walls but the noise seems to increase with it. The threshold of 40 seemed to be optimal for reducing the noise in the soft tissue without creating many holes in the orbital walls (for this particular scan at least). I imagine for CBCT scans then these settings would not apply.

Another option I found was to leave the threshold at 0 (which creates higher noise in the soft tissue) and then use the ‘Gradient Anisotropic Diffusion’ filter to reduce the soft tissue noise without affecting the enhanced orbital walls. This actually produced a slightly better result but of course means another step in the process.

Also as a weird side effect the edge between the skin of the face and the air seemed to be significantly enhanced so it showed up in the segmentation. I subsequently deleted the skin with the islands effect in segment editor but this could be a good way of segmenting the bone and the skin easily without including any of the soft tissue in between.

1 Like

This looks awesome and it will get even better!

Using the new “Wrap Solidify” effect (provided by SurfaceWrapSolidify extension) by Sebastien Andress you can ensure that discontinuous contours/missing pieces are connected to form a nice solid object.

Example on a very low quality image:

Input (obtained with simple thresholding, without any resampling, filtering, etc):

Result of “Wrap Solidify” using “Deep Hull”: the orbital wall is a nice continuous surface

I would expect that running solidification on the filtered image would provide very good quality segmentation.

1 Like

Thanks! That looks really interesting. I will look into that.

This looks like a nice application for the filter.
I’d suggest trying the following settings:

  • Offset First Shrinkwrap: 5mm -> It approaches to the outside of the segmentation
  • Spacing First Remesh: 5mm^3 -> since it approaches, the resolution doesn’t need to be that high
  • Spacing Second Shrinkwrap (actually should be Remesh, changes in next release): 1mm^3 or lower, this will be the output resolution
  • Iterations first shrinkwrap: 2
  • Iterations Second Shrinkwrap: 3-8 -> depending on the result, if some flat holes are not covered, try enlarging this number
  • raycast search: 10mm -> probably especially the orbita will be covered, which is a large hole.
  • raycast result: about 2mm -> if you try to raycast into small holes, this number should be small, if not, it should be bigger.

Sorry about this weird naming of the parameters, we are still thinking about a better naming to make this filter more understandable. For more details please see the github page.

3 Likes

I finally got around to trying out the Wrap Solidify effect.

I have not had much luck with orbits. I cannot get the effect to stop filling in the orbit. I have played with a lot of the settings including Carve out Cavities and Number of iterations but it does not seem to change the effect. Also the settings seem to be pretty different to what is shown above, I guess mine is a later release?

I was also playing with this effect for segmenting a pelvis and some femurs. These segments typically end up with lots of surface holes which is painful to fill in. The wrap surface effect did an excellent job of making a lovely smooth segment which closely matched the shape of the bone. Thanks very much for putting in the time to make this extension it saves A LOT of time with superior results!

1 Like

The effect should work well for orbit segmentation, but you need to pay attention to a few things:

  1. Make sure the orbital socket is only open from anterior direction. You can draw a few walls using Scissors effect to close down openings.

image

  1. Make sure “Carve out cavities” is enabled. If the orbit is filled up then decrease “Minimal cavities diameter” (around 15-25mm should work). If the orbital wall is fractured, incomplete then increase “Minimal cavities diameter” (and/or lower the intensity threshold value that extracted the bones from the image - that makes the bone surface more continuous and less and smaller holes to fill).
2 Likes

We have greatly improved the Wrap Solidify effect. Filling of the orbit can now be prevented very easily.

Great, thanks for the update on this. I will give it a try some time.