分割标记数据值计算完成后才可保存
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;" <i class="el-icon-warning-outline" style="color:red;margin-right: 5px;"
:title="$t('trials:reading:Segmentations:tip:segmentationIsNotSave')" :title="$t('trials:reading:Segmentations:tip:segmentationIsNotSave')"
v-if="!curSegmentGroup.isSaved"></i> 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") }} {{ $t("trials:reading:Segmentations:button:save") }}
</el-button> </el-button>
</div> </div>
@ -243,7 +244,7 @@
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<div class="saveBtnBox"> <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") }} {{ $t("trials:reading:Segmentations:button:saveAll") }}
</el-button> </el-button>
</div> </div>
@ -367,7 +368,8 @@ export default {
// isDel: false, // isDel: false,
digitPlaces: 2, digitPlaces: 2,
isloaded: false, isloaded: false,
popoverId: null popoverId: null,
saveLoading: false
} }
}, },
mounted() { mounted() {
@ -1249,36 +1251,42 @@ export default {
this.drawing = true this.drawing = true
}, },
async calculateStatistics(indices, segmentationId, mode) { async calculateStatistics(indices, segmentationId, mode) {
if (!segmentation.state.getSegmentation(segmentationId)) return false try {
const stats = await segmentationUtils.getStatistics({ if (!segmentation.state.getSegmentation(segmentationId)) return false
segmentationId, this.saveLoading = true
segmentIndices: indices, const stats = await segmentationUtils.getStatistics({
mode, segmentationId,
}); segmentIndices: indices,
console.log(stats) mode,
if (mode === 'individual') { });
const segmentStats = stats; 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 { this.saveLoading = false
const items = [`Statistics on ${indices.join(', ')}`]; } catch (err) {
const namedStats = stats; console.log(err)
namedStats.count.label = 'Voxels'; this.saveLoading = false
} }
}, },
createSegmentationRepresentation(segmentationId) { createSegmentationRepresentation(segmentationId) {
this.viewprotIds.forEach(id => { this.viewprotIds.forEach(id => {