A cardiac function management device or other implantable medical device includes a test mode and a diagnostic mode. During a test mode and the device cycles through various electrode configurations for collecting thoracic impedance data. At least one figure of merit is calculated from the impedance data for each such electrode configuration. In one example and only non-arrhythmic beats are used for computing the figure of merit. A particular electrode configuration is automatically selected using the figure of merit. During a diagnostic mode and the device collects impedance data using the selected electrode configuration. In one example and the figure of merit includes a ratio of a cardiac stroke amplitude and a respiration amplitude. Other examples of the figure of merit are also described.