I am working on transport of small particles through a tube and my whole analysis procedure is written in MatLab except for one little step: Somewhere in the middle I have to straighten the slightly wiggly tubes. Currently, in order to do this, I export my video from Matlab, open it in ImageJ, and manually select the tube by drawing a polyline along it. I then use a plugin which performs a spline fit to the poly line and then straightens the tube along the line. An example can be found here: "http://fiji.sc/Straighten..." . Now, I would love to be able to do this in MatLab and I know how to make and use a polyline selection but how could I do the actual straightening? Any help is greatly appreciated.