I think you could do that if you have an appropiate antibody to do inmunohistochemistry in the slices of spinal cord for stain the corticospinal axons. Then, you just have to take pictures in an microscope and analyze with a program like ImageJ or Fiji. Briefly, you set a threshold to binarize each image and then measure the percent of the area that is coloured (the axons).
An analysis like that was performed recently in mu-crystallin mice that have complete labeling of the corticospinal tract (figure 6): PMID: 26586827
If your interest is specifically in rats, I'm not sure of a study that compares corticospinal axon numbers at different spinal cord levels but Weidner and colleagues counted BDA labelled corticospinal axons at cervical level C4 in this study (figure 2): PMID: 11248109
Finally if you're looking for a total number at the level of the pyramid (i.e. all corticospinal axons) this study might be helpful: PMID: 20739574
You might want to take a look at the automated image analysis system based on the program "Cell Profiler" that we used to quantify the number of NeuN-poitive neurons in spinal cord slice cultures. It could probably be adapted to counting axons as well.
Schizas N, Perry S, Andersson B, Wählby C, Kullander K, Hailer NP. Differential Neuroprotective Effects of Interleukin-1 Receptor Antagonist on Spinal Cord Neurons after Excitotoxic Injury. Neuroimmunomodulation. 2018 Jan 26. doi: 10.1159/000484607. [Epub ahead of print] PubMed PMID: 29393213.