A better question is what gives the best results (mainly for the public at large) as an overall system policy. I guess brain tumors are rare enough that you can probably err on the side of mercy supposing you don't believe the subject is likely to reoffend. But you don't want to make so many loopholes that the deterrent effect of punishment is compromised. And of course you don't want to let people go who are likely to harm innocent members of the public, regardless of whether they are responsible for that condition. These are all empirical questions though. Its incredibly hard to even establish a deterrent effect of punishment, much less measure it to the fine degree required to set detailed policy.
Peter Watts discusses this a little sort of as an aside during Blindsight, I believe.