A system includes an indifferent electrode, electricalswitching circuitry, and a processor. The indifferentelectrode, which is configured for placement on a body ofa patient, includes multiple electrically-conducting sub-electrodesthat are electrically-insulated from oneanother. The electrical switching circuitry is configuredto receive a control signal that specifies a selectedsubset of the sub-electrodes, and in response toelectrically connect the selected subset, so as to closean electrical circuit passing through the body of thepatient. The processor is configured to determine arequired surface area of the indifferent electrode, selectthe subset of the sub-electrodes that together have therequired surface area, and instruct the electricalswitching circuitry to electrically connect the selectedsubset of the sub-electrodes.