Renamed 'directory' to 'data_dir'.
Added background filtering and subsampling (-s).