Segmentation of 3D microscopy data with an energy based interaction model