Skip to content

Commit

Permalink
Merge ab9f0b9 into 0538b34
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaillet committed Mar 25, 2022
2 parents 0538b34 + ab9f0b9 commit d71898a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/export_dico.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
"""
Script d'export d'une table de correspondance entre les entiers 32bits du graphe de mosaiquage et les noms d'OPI
"""
import os
import argparse
import json


def read_args():
"""Gestion des arguments"""
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", required=True, help="input overview")
parser.add_argument(
"-o", "--output", required=True, help="output CSV file"
)
return parser.parse_args()

args = read_args()

fileOverviews = open(args.input)
overviews = json.load(fileOverviews)
fileOverviews.close()

with open(args.output, 'w') as out:
for opi in overviews['list_OPI']:
colors = overviews['list_OPI'][opi]
out.write(opi + ';' + str(colors[0] + 256 * (colors[1] + 256 * colors[2])) + '\n')

0 comments on commit d71898a

Please sign in to comment.