Using a statistically representative sample of 911 central galaxies ( CENs ) from the SDSS DR4 Group Catalogue , we study how the structure ( shape and size ) of the first rank ( by stellar mass ) group and cluster members depends on ( 1 ) galaxy stellar mass ( { M _ { star } } ) , ( 2 ) the global environment defined by the dark matter halo mass ( { M _ { halo } } ) of the host group , and ( 3 ) the local environment defined by their special halo-centric position . We establish a GALFIT-based pipeline for 2D Sérsic fitting of SDSS data to measure the Sérsic index , n , and half-light radius , r _ { 50 } , from r -band galaxy images . Through tests with simulated and real image data , we demonstrate that our pipeline can recover galaxy properties without significant bias . We also find that uncertainties in the background sky level translate into a strong covariance between the total magnitude , the half-light radius , and the Sérsic index , especially for bright/massive galaxies . We apply our pipeline to the CEN sample and find that the Sérsic index n of CENs depends strongly on { M _ { star } } , but only weakly or not at all on { M _ { halo } } . The n - { M _ { star } } relation holds for CENs over the full range of halo masses that we consider . Less massive CENs tend to be disk-like and high-mass systems are typically spheroids , with a considerable scatter in n at all galaxy masses . Similarly , CEN sizes depend on galaxy stellar mass and luminosity , with early and late-type galaxies exhibiting different slopes for the size-luminosity ( r _ { 50 } - L ) and the size-stellar mass ( r _ { 50 } - { M _ { star } } ) scaling relations . Moreover , to test the impact of local environment on CENs , we compare the structure of CENs with that of comparable satellite galaxies ( SAT ) . We find that low mass ( < 10 ^ { 10.75 } { h ^ { -2 } M _ { \odot } } ) SATs have somewhat larger median Sérsic indices compared with CENs of a similar stellar mass . Also , low mass , late-type SATs are moderately smaller in size than late-type CENs of the same stellar mass . However , we find no size differences between early-type CENs and SATs and no structural differences between CENs and SATs when they are matched in both optical colour and stellar mass . The similarity in the structure of massive SATs and CENs demonstrates that this distinction has no significant impact on the structure of spheroids . We conclude that { M _ { star } } is the most fundamental property determining the basic structural shape and size of a galaxy . In contrast , the lack of a significant n - { M _ { halo } } relation rules out a clear distinct group mass for producing spheroids , and the morphological transformation processes that produce spheroids must occur at the centres of groups spanning a wide range of masses .