分割标记数据值计算完成后才可保存
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2026-03-31 16:30:37 +08:00
parent ff5aea17a5
commit b39ea3a032
1 changed files with 36 additions and 28 deletions

View File

@ -158,7 +158,8 @@
<i class="el-icon-warning-outline" style="color:red;margin-right: 5px;"
:title="$t('trials:reading:Segmentations:tip:segmentationIsNotSave')"
v-if="!curSegmentGroup.isSaved"></i>
<el-button type="success" size="small" @click="saveSegmentGroup([curSegmentGroup])">
<el-button type="success" size="small" :disabled="saveLoading"
@click="saveSegmentGroup([curSegmentGroup])">
{{ $t("trials:reading:Segmentations:button:save") }}
</el-button>
</div>
@ -243,7 +244,7 @@
</el-collapse-item>
</el-collapse>
<div class="saveBtnBox">
<el-button type="success" size="small" @click="saveSegmentGroup()">
<el-button type="success" size="small" :disabled="saveLoading" @click="saveSegmentGroup()">
{{ $t("trials:reading:Segmentations:button:saveAll") }}
</el-button>
</div>
@ -367,7 +368,8 @@ export default {
// isDel: false,
digitPlaces: 2,
isloaded: false,
popoverId: null
popoverId: null,
saveLoading: false
}
},
mounted() {
@ -1249,36 +1251,42 @@ export default {
this.drawing = true
},
async calculateStatistics(indices, segmentationId, mode) {
if (!segmentation.state.getSegmentation(segmentationId)) return false
const stats = await segmentationUtils.getStatistics({
segmentationId,
segmentIndices: indices,
mode,
});
console.log(stats)
if (mode === 'individual') {
const segmentStats = stats;
try {
if (!segmentation.state.getSegmentation(segmentationId)) return false
this.saveLoading = true
const stats = await segmentationUtils.getStatistics({
segmentationId,
segmentIndices: indices,
mode,
});
console.log(stats)
if (mode === 'individual') {
const segmentStats = stats;
for (const segmentIndex of indices) {
if (segmentStats[segmentIndex]) {
const segmentStat = segmentStats[segmentIndex];
// console.log(segmentStat, 'segmentStat')
segmentStat.count.label = 'Voxels';
let segmentGroup = this.segmentList.find(item => item.segmentationId === segmentationId)
if (segmentGroup) {
let segment = segmentGroup.segments.find(item => item.segmentIndex === segmentIndex)
segment.stats = segmentStat;
}
for (const segmentIndex of indices) {
if (segmentStats[segmentIndex]) {
const segmentStat = segmentStats[segmentIndex];
// console.log(segmentStat, 'segmentStat')
segmentStat.count.label = 'Voxels';
let segmentGroup = this.segmentList.find(item => item.segmentationId === segmentationId)
if (segmentGroup) {
let segment = segmentGroup.segments.find(item => item.segmentIndex === segmentIndex)
segment.stats = segmentStat;
}
}
} else {
const items = [`Statistics on ${indices.join(', ')}`];
const namedStats = stats;
namedStats.count.label = 'Voxels';
}
} else {
const items = [`Statistics on ${indices.join(', ')}`];
const namedStats = stats;
namedStats.count.label = 'Voxels';
this.saveLoading = false
} catch (err) {
console.log(err)
this.saveLoading = false
}
},
createSegmentationRepresentation(segmentationId) {
this.viewprotIds.forEach(id => {