1. A method of segmenting a selected region from a multi-dimensional dataset, via a computing device, wherein an adaptive mesh comprising a plurality of mesh primitives is to be adapted to the selected region, the method comprising the steps of: sampling data from the multi-dimensional dataset; estimating a probability, via the computing device, that a mesh primitive of the plurality of mesh primitives belongs to a class of a plurality of classes by using the sampled data from the multi-dimensional dataset by means of an estimator, wherein the probability is a function of a frequency of occurrence of the mesh primitive within a training set; and applying an energy function corresponding to the class of the plurality of classes, via the computing device, to adapt the mesh primitive of the plurality of mesh primitives to the selected region.