Theoretically a rotary encoder could be attached to the pinion shaft, but I don't think it would be very accurate, and in addition there is a lot of backlash in the system.
Maybe this would give you some ideas for a linear quill scale.
This is my quill magnetic scale. This is a Renishaw LM10, 1 micron read head.
The machine is a BP clone, but a Tree is not that different.
I built a new quill stop that incorporated the mount for a mag read head.