This code is based on code, that adds mask functionality to diffeomorphic demons. This code can be downloaded here: http://hdl.handle.net/10380/3105
 
