Branches on trees introduce defects on sawn timber called knots. By scanning sawlogs using computed tomography, knots can be detected and accounted for so that the sawing process can be optimized with respect to outgoing product value. How the optimization should be done differs depending on available sawing equipment and the production strategy of the sawmill. It is important to investigate interesting production strategies with computer simulations to obtain an approximation of the profitability for a sawmill if investing in a computed tomography scanner. Another important step in the optimization process is to automatically segment knots so that they can be used by a computer when optimizing. This thesis presents an algorithm that automa...