I’m currently working on my bachelor thesis. My task is to classify acetabular fractures (pelvis) with machine learning. The data is noisy because the CT scans were collected over many decades and in different clinics in Germany. I created a pipeline with a 3D slicer python script to segment bones. It has the following steps:
Normalization
Thresholding
Delete small islands
Smoothing
The results so far look great but I am sure the segmentations can be improved. My idea is to use filters to reduce noise in the initial step but I don’t know which filter is suitable for this task. Second of all, I want to ask if there are other steps to improve the segmentation. It’s really important that tiny fractures are separated to classify the fractures later.
Thank you so far for all the help provided in the forum and the published example scripts. My results had some major improvements which wouldn’t have been possible without it.
If you haven’t already you should look through this book and then also look at the ITK web site for any updates of any topics. Pretty much all of the features described are available in Slicer one way or other (e.g. through SimpleFilters).
Thank you Steve. That book seems to be exactly what I need. Unfortunately I can’t get it from the university library because it is lent out. When it is available again, I will take a look at it.
Thanks a lot Andras. I already saw that program and tested it out. The results are impressive on manual segmentations of the pelvis. The problem is that my script and the bone segmentation has to be automatic. Femur and pelvis are close together and I can’t keep the segments separated without editing it manually. With the femur, I get this segmentation as output:
All the scans vary in intensity, contrast and resolution. My attempt now is to combine an edge detection filter (for example canny detector) with my automatic segmentation. I am running out of ideas but I guess that’s part of the process.
Unless the image is extremely low noise and high resolution you cannot expect to segment structures using basic global methods, such as thresholding and smoothing.
“Grow from seeds” or “Watershed” effects may be able to separate femur and pelvis fully automatically (from seed points approximately placed by some automatic strategy). You can also utilize the special (almost perfectly spherical) shape of the femur head in some way. However, nowadays most people would create a few hundred segmentations using semi-automatic segmentation tools and then train a deep learning network, which could perform the segmentation fully automatically.
We may be able to give more specific advice if you write more details about your needs and constraints. What is the goal of the segmentation? Visualization, 3D printing, quantitative analysis (shape, volume distance measurements, …)? What kind of results are acceptable? Why the method has to be fully automatic? Are there experts available for at least 1-2 minutes to specify some manual inputs and review/approve results? What are your time constraints? Do you acquire images intraoperatively and need to provide results within minutes? Or you have tens of minutes or several hours?
My task is to create a convolutional neural network that detects acetabular fractures. Additionally, I have to train another neural network that classifies the type of fracture according to the Letournel classification.
The CT scans are cut in half and mirrored to increase the sample size and to collect scans without fractures. The results were not great on the raw pictures, so I decided to do preprocessing and segment the bones. The segmentations can be used to pretrain the network (transfer learning approach) or to feed them directly into the CNN.
I was told that my pipeline has to be automatic so that the results and the segmentations are reproducible. Otherwise my segmentations could be manipulated until the fracture detection works.
I created the script with your provided code and trained the network only on the segmentations. I had an accuracy of 91% which was a 5% improvement. The script works fine in most cases but has troubles with the variety of contrast and intensity. Therefore I am sure there is room for improvement.
My idea is to enhance the script as best as possible before I show the resulting segmentations to the trauma surgeons that help me with the project.
My deadline is the end of January but the complete program should be finished until the end of the year. In the following weeks, I will get a lot more CT scans but first they have to be labeled and classified by the trauma surgeons.
In a nutshell, the segmentations are not the primary goal and will be used as aggressive preprocessing or pre-training which yielded an improvement so far. I plan to implement everything in a simple gui where the segmentation could be useful for visualization.
If the goal is not segmentation then probably it is OK to not do any sophisticated manual pre-processing. It is hard to tell what preprocessing helps and what hinders the CNN, as it depends on many factors that probably nobody really knows. You just need to try many things and see what works.