comparison imagecoordinates_flipaxis.py @ 2:f8f1100d0701 draft

"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/imagecoordinates_flipaxis/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
author imgteam
date Wed, 18 Dec 2019 05:02:25 -0500
parents d0960e1b25a8
children 984b342d03a6
comparison
equal deleted inserted replaced
1:d0960e1b25a8 2:f8f1100d0701
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)