Add in missing parameter
Add in support for dilating mask and filters.
Remove ancient debugging code.