caiyiling 2024-09-04 16:53:03 +08:00
parent ff7305c3a0
commit d25fd68db7
2 changed files with 11 additions and 16 deletions

View File

@ -90,7 +90,7 @@
custom-class="base-dialog-wrapper"
append-to-body
>
<DicomTags :image-data="imageData" @close="dcmTag.visible = false" />
<DicomTags :imageId="stack.imageIds[stack.currentImageIdIndex]" @close="dcmTag.visible = false" />
</el-dialog>
</div>
</template>
@ -176,8 +176,7 @@ export default {
markers: { top: '', right: '', bottom: '', left: '' },
orientationMarkers: [],
originalMarkers: [],
dcmTag: { visible: false, title: 'DICOM Tags' },
imageData: null
dcmTag: { visible: false, title: 'DICOM Tags' }
}
},
@ -761,11 +760,7 @@ export default {
cornerstoneTools.SaveAs(this.canvas, `${uid}.png`)
},
showTags() {
var image = cornerstone.getImage(this.canvas)
// var dataSet = dicomParser.parseDicom(image.data.byteArray)
// console.log('showTags', dataSet)
this.dcmTag.visible = true
this.imageData = image.data
},
fitToWindow() {
if (this.stack.seriesNumber) {

View File

@ -54,15 +54,14 @@
</template>
<script>
import TAG_DICT from './dataDictionary'
import * as cornerstone from 'cornerstone-core'
import dicomParser from 'dicom-parser'
export default {
name: 'DicomTags',
props: {
imageData: {
type: Object,
default() {
return []
}
imageId: {
type: String,
required: true
}
},
data() {
@ -72,8 +71,9 @@ export default {
search: ''
}
},
mounted() {
var dataSet = dicomParser.parseDicom(this.imageData.byteArray)
async mounted() {
let image = await cornerstone.loadAndCacheImage(this.imageId)
var dataSet = dicomParser.parseDicom(image.data.byteArray)
var output = []
this.dumpDataSet(dataSet, output)
this.list = output
@ -95,7 +95,7 @@ export default {
const tag = this.getTag(element.tag)
elementObject.id = `${this.idx++}${new Date().getTime()}`
elementObject.tagCode = element.tag
elementObject.tagName = tag.name
elementObject.tagName = tag ? tag.name : ''
elementObject.tagLength = element.length
elementObject.value = ''
@ -224,7 +224,7 @@ export default {
exception: err,
output: output
}
throw ex
console.log(ex)
}
},
getTag(tag) {