from enum import EnumMeta
from numpy import NaN
import pandas as pd
import json
import re
src=pd.read_csv("李巍.csv",encoding="gb18030")
series_id=src['序列号'].values.tolist()
imagecnt=src['影像结果'].values.tolist()
src_density_type=src['肺结节类型'].values.tolist()
focus=[]
tools=[]
diy=[]
filetype=[]
cnt=[]
for i,txt in enumerate(imagecnt):
    focus.append("ANNO3")
    tools.append("CUBOID")
    diy.append("")
    filetype.append("")
    text=json.loads(txt)
    tmp="{\"lesionId\":0,\"position\":"+str(text['position'])+"}"
    cnt.append(tmp)
    
output=pd.DataFrame({"序列号":series_id,"病灶":focus,"影像工具":tools,"影像结果":cnt,"自定义内容":diy,"文件类型":filetype,"肺结节类型":src_density_type})
output.to_csv("李巍_output.csv",index=False,encoding="utf_8_sig")
    
