Mercurial > repos > imgteam > imagecoordinates_flipaxis
comparison imagecoordinates_flipaxis.py @ 2:fb68afb14731 draft default tip
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/imagecoordinates_flipaxis/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
| author | imgteam |
|---|---|
| date | Wed, 18 Dec 2019 09:58:11 +0000 |
| parents | fb6b557a2937 |
| children |
comparison
equal
deleted
inserted
replaced
| 1:fb6b557a2937 | 2:fb68afb14731 |
|---|---|
| 1 import argparse | 1 import argparse |
| 2 import pandas as pd | 2 import pandas as pd |
| 3 | 3 |
| 4 | 4 |
| 5 def imagecoordinates_flipyaxis(input_file, output_file, image_height, offset=[0,0]): | 5 def imagecoordinates_flipyaxis(input_file, output_file, image_height, offset=[0,0]): |
| 6 df = pd.read_csv(input_file, sep='\t') | 6 df = pd.read_csv(input_file, sep='\t') |
| 7 | 7 |
| 8 x = df.copy().y # create copy instead of view | 8 x = df.copy().y # create copy instead of view |
| 9 df.y = image_height-(df.x + 1) + offset[1] # since maximal y index = height-1 | 9 df.y = image_height-(df.x + 1) + offset[1] # since maximal y index = height-1 |
| 10 df.x = x + offset[0] | 10 df.x = x + offset[0] |
| 11 df.to_csv(output_file, sep="\t", index=False) | 11 df.to_csv(output_file, sep="\t", index=False) |
