Sort of ;-).
The imageJ software is very versatile, especially if you program using the plugin language (Java) rather than the macro language (dumbed down Java). You can pretty much create whatever you want with the imageJ software.
The problem, however, is that you will need to be a good programmer to get good results and will also have to identify the key components of your own ability to visualize the spines in order to give extremely explicit instructions to the computer in the form of a computer program.
You might want to check the plugin section of the imageJ website to see if there are some plugins that have already been made to accomplish your goal. Actually, here are the ones that I find that deal with neurons:
http://www.longair.net/edinburgh/imagej/http://www.imagescience.org/meijering/software/neuronj/http://www.personal.soton.ac.uk/dales/morpho/http://www-biology.ucsd.edu/labs/ghosh/software/Good luck in choosing your tool!