Comparing with the original centerlines, there’s hardly any change in their trajectories. Even when I tried a significantly larger number for the smoothing factor, there was no variation, and the individual coordinates remained unchanged as well. Do you have any suggestions for improvement?
Everything seems to work very well. Since the centerline is already very much smoothed and the curve points are very close to each other, you wont see much if you just use 100 iterations and not too strong smoothing factor.
You can copy-paste this code snippet into 3D Slicer’s Python console to see the effect of smoothing:
I didn’t have a good understanding of this smoothing. Looking at your display, it seems to be smoothed properly, but when I write a script with the same in Python, it’s clearly not working well. I wonder what the cause might be?
Compared to the original centerlines, all of them are smoothed, but all smoothed centerlines seem to be the same even if the parameters are adjusted…
Incidentally, smoothing once does not change the smoothing situation even if the parameters are adjusted, but further smoothing of centerlines that have been smoothed (smoothing 2 times) seems to result in the intended smoothed centerlines.
I would recommend to start in the Slicer Python console and confirm that everything works well. You can then change things step by step and see what change breaks it.
It worked perfectly with the method you described. I have since realized the mistake in my script. When using the VMTK’s vmtkCenterlineSmoothing class in Python, the ‘Set’ prefix is not required, and direct assignment to properties is necessary.