Mercurial > repos > imgteam > 2d_feature_extraction
comparison 2d_feature_extraction.py @ 1:f03b4da203d0 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_feature_extraction/ commit e45ba62aae80d942bbf1cbf572bd9aec64297900
author | imgteam |
---|---|
date | Tue, 09 Jul 2019 08:35:50 -0400 |
parents | 96909b9d1df1 |
children | 6fdb3542a406 |
comparison
equal
deleted
inserted
replaced
0:96909b9d1df1 | 1:f03b4da203d0 |
---|---|
116 if args.solidity or args.all_features: | 116 if args.solidity or args.all_features: |
117 df['solidity'] = df['it'].map(lambda ait: regions[ait].solidity) | 117 df['solidity'] = df['it'].map(lambda ait: regions[ait].solidity) |
118 if args.moments or args.all_features: | 118 if args.moments or args.all_features: |
119 df['moments'] = df['it'].map(lambda ait: regions[ait].moments) | 119 df['moments'] = df['it'].map(lambda ait: regions[ait].moments) |
120 if args.convexity or args.all_features: | 120 if args.convexity or args.all_features: |
121 df['convexity'] = df.area/(df.perimeter*df.perimeter) | 121 perimeter = df['it'].map(lambda ait: regions[ait].perimeter) |
122 area = df['it'].map(lambda ait: regions[ait].area) | |
123 df['convexity'] = area/(perimeter*perimeter) | |
122 | 124 |
123 del df['it'] | 125 del df['it'] |
124 df.to_csv(out_file, sep='\t', line_terminator='\n', index=False) | 126 df.to_csv(out_file, sep='\t', line_terminator='\n', index=False) |