【dicom分割】直方图x轴坐标应该是从小到大,现在坐标数显示异常
parent
4a8b1da094
commit
128cdc0f75
|
|
@ -221,6 +221,7 @@ export default {
|
||||||
Object.keys(this.seriesData).forEach(key => {
|
Object.keys(this.seriesData).forEach(key => {
|
||||||
if (key !== 'default' || this.isNeedDefault) seriesData.push(this.seriesData[key])
|
if (key !== 'default' || this.isNeedDefault) seriesData.push(this.seriesData[key])
|
||||||
})
|
})
|
||||||
|
seriesData = this.formatSeriesData(seriesData)
|
||||||
this.chart.clear();
|
this.chart.clear();
|
||||||
const option = {
|
const option = {
|
||||||
useUTC: true,
|
useUTC: true,
|
||||||
|
|
@ -287,6 +288,27 @@ export default {
|
||||||
};
|
};
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
},
|
},
|
||||||
|
formatSeriesData(seriesData) {
|
||||||
|
let arr = []
|
||||||
|
seriesData.forEach(serie => {
|
||||||
|
serie.data.forEach(item => {
|
||||||
|
if (!arr.includes(item[0])) arr.push(item[0])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
arr = arr.sort((a, b) => a - b)
|
||||||
|
seriesData.forEach(serie => {
|
||||||
|
let data = []
|
||||||
|
arr.forEach(item => {
|
||||||
|
if (serie.objKey[item]) {
|
||||||
|
data.push([item, serie.objKey[item]])
|
||||||
|
} else {
|
||||||
|
data.push([item, 0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
serie.data = data
|
||||||
|
})
|
||||||
|
return seriesData
|
||||||
|
},
|
||||||
async generateData(annotation) {
|
async generateData(annotation) {
|
||||||
var seriesData = [];
|
var seriesData = [];
|
||||||
var min = null;
|
var min = null;
|
||||||
|
|
@ -297,10 +319,8 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
res = await this.getCurrentSliceValuesFromVoxelManager(this.renderingEngineId, `${this.viewportKey}-${this.activeViewportIndex}`)
|
res = await this.getCurrentSliceValuesFromVoxelManager(this.renderingEngineId, `${this.viewportKey}-${this.activeViewportIndex}`)
|
||||||
}
|
}
|
||||||
|
let obj = {}
|
||||||
if (res) {
|
if (res) {
|
||||||
let obj = {
|
|
||||||
|
|
||||||
}
|
|
||||||
res.values.forEach(item => {
|
res.values.forEach(item => {
|
||||||
if (obj[item]) {
|
if (obj[item]) {
|
||||||
obj[item]++
|
obj[item]++
|
||||||
|
|
@ -327,7 +347,8 @@ export default {
|
||||||
seriesData: {
|
seriesData: {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
symbolSize: 0,
|
symbolSize: 0,
|
||||||
data: seriesData
|
data: seriesData,
|
||||||
|
objKey: obj
|
||||||
},
|
},
|
||||||
min: min,
|
min: min,
|
||||||
max: max
|
max: max
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue