1. Device for segmenting an image of a subject, comprising: a data interface for receiving an image of said subject and at least one contour or at least one part of a contour, said contour indicating a structure within said image; a selection unit for selecting a region in said image divided into a first and a second disjoint part by said contour or said part of said contour, said selected region comprising a region drawn by a user and/or a region generated by a computer; a classifier for classifying said selected region into a first image class and a second image class based on at least one parameter for image segmentation; an analysis unit for defining an objective function based on at least one of said first is a class and said second image class; an optimizer for optimizing said at least one parameter by varying an output of said objective function; and an image segmentation unit for segmenting said image using said optimized at least one parameter; wherein said selection unit is configured to select said region to divide said contour into a first contour part within said region and a second contour part outside said region, and wherein the image segmentation unit is configured to transfer said at least one parameter optimized for said region to at least one part selected in said second contour part.