  Using a representative sample of 911 central galaxies (CENs) from the SDSS
DR4 group catalogue, we study how the structure of the most massive members in
groups and clusters depend on (1) galaxy stellar mass (Mstar), (2) dark matter
halo mass of the host group (Mhalo), and (3) their halo-centric position. We
establish and thoroughly test a GALFIT-based pipeline to fit 2D Sersic models
to SDSS data. We find that the fitting results are most sensitive to the
background sky level determination and strongly recommend using the SDSS global
value. We find that uncertainties in the background translate into a strong
covariance between the total magnitude, half-light size (r50), and Sersic index
(n), especially for bright/massive galaxies. We find that n depends strongly on
Mstar for CENs, but only weakly or not at all on Mhalo. Less (more) massive
CENs tend to be disk (spheroid)-like over the full Mhalo range. Likewise, there
is a clear r50-Mstar relation for CENs, with separate slopes for disks and
spheroids. When comparing CENs with satellite galaxies (SATs), we find that low
mass (<10e10.75 Msun/h^2) SATs have larger median n than CENs of similar Mstar.
Low mass, late-type SATs have moderately smaller r50 than late-type CENs of the
same Mstar. However, we find no size differences between spheroid-like CENs and
SATs, and no structural differences between CENs and SATs matched in both mass
and colour. The similarity of massive SATs and CENs shows that this distinction
has no significant impact on the structure of spheroids. We conclude that Mstar
is the most fundamental property determining the basic structure of a galaxy.
The lack of a clear n-Mhalo relation rules out a distinct group mass for
producing spheroids, and the responsible morphological transformation processes
must occur at the centres of groups spanning a wide range of masses. (abridged)
