import os
from collections import defaultdict, OrderedDict
import json
import numpy as np
import cv2
import glob
class NpEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
return obj.tolist()
else:
return super(NpEncoder, self).default(obj)
results = defaultdict(list)
mask = defaultdict(list)
volume= defaultdict(list)
stress= defaultdict(list)
parm= defaultdict(list)
line=defaultdict(list)
param=defaultdict(list)
results["mask"] =[]
results["volume"] =volume
results["stress"] =stress
results["parm"] =param
# mask["series_number"]=1
# mask["slice_index"]=1
# mask["rois"]=rois
# rois["RV"]= contours1
# rois["LV-Inner"]=con
从mask读取轮廓点坐标到json文件
最新推荐文章于 2023-09-15 15:39:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)