Compute thickness of branches in a 2D image

Have you tried to use VMTK for this? SlicerVMTK’s centerline extraction module may give you this information directly.

If VMTK does not work on your data then you can do what is described in this post: How to analyze the thickness of the model