Can I use investment losses to offset taxes on an IRA withdrawal?

To encourage investment, the tax code provides an incentive to soften the blow of a loss