Efficient extraction of semantic information from medical images in large datasets using random forests