For example, use --haralick switch to compute Haralick features\n""")
sys.exit(1)
features = []
colnames = []
first = True
for fname in args.fnames:
cur = []
im = read_bw(fname, args)
if args.haralick:
har = mh.features.haralick(im, return_mean_ptp=True)
cur.append(har)
if first:
colnames.extend(mh.features.texture.haralick_labels[:-1])
colnames.extend(["ptp:{}".format(ell) for ell in mh.features.texture.haralick_labels[:-1]])
features.append(np.concatenate(cur))
first = False
features = np.array(features)
try:
After Change
for cname in colnames:
args.output.write("\t")
args.output.write(cname)
args.output.write("\n")
first = False
for fs in cur:
args.output.write(fname)
for f in fs: