DICOM影像上传过程中,对于匿名字段,只有文件存在时才需要匿名,如果文件本身不存在需要匿名DICOM元素,则不需要做匿名字段
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
4f7a308cf1
commit
3d096f397f
|
@ -15,6 +15,7 @@ export const anonymization = function (file, config) {
|
||||||
let dataset = dcmjs.data.DicomMessage.readFile(buffer)
|
let dataset = dcmjs.data.DicomMessage.readFile(buffer)
|
||||||
for (var i = 0; i < AnonymizeFixedList.length; i++) {
|
for (var i = 0; i < AnonymizeFixedList.length; i++) {
|
||||||
let AnonymizeFixed = AnonymizeFixedList[i]
|
let AnonymizeFixed = AnonymizeFixedList[i]
|
||||||
|
if (!dataset.dict.hasOwnProperty(`${AnonymizeFixed.Group + AnonymizeFixed.Element}`)) continue
|
||||||
if (dataset.dict[AnonymizeFixed.Group + AnonymizeFixed.Element]) {
|
if (dataset.dict[AnonymizeFixed.Group + AnonymizeFixed.Element]) {
|
||||||
dataset.dict[AnonymizeFixed.Group + AnonymizeFixed.Element].Value[0] = AnonymizeFixed.ReplaceValue
|
dataset.dict[AnonymizeFixed.Group + AnonymizeFixed.Element].Value[0] = AnonymizeFixed.ReplaceValue
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,6 +29,7 @@ export const anonymization = function (file, config) {
|
||||||
}
|
}
|
||||||
for (var i = 0; i < AnonymizeNotFixedList.length; i++) {
|
for (var i = 0; i < AnonymizeNotFixedList.length; i++) {
|
||||||
let AnonymizeNotFixed = AnonymizeNotFixedList[i]
|
let AnonymizeNotFixed = AnonymizeNotFixedList[i]
|
||||||
|
// if (!dataset.dict.hasOwnProperty(`${AnonymizeNotFixed.Group + AnonymizeNotFixed.Element}`)) continue
|
||||||
if (AnonymizeNotFixed.Group + AnonymizeNotFixed.Element === '00100020') {
|
if (AnonymizeNotFixed.Group + AnonymizeNotFixed.Element === '00100020') {
|
||||||
console.log(`${DicomStoreInfo.TrialCode}_${DicomStoreInfo.SubjectCode}`)
|
console.log(`${DicomStoreInfo.TrialCode}_${DicomStoreInfo.SubjectCode}`)
|
||||||
if (dataset.dict[AnonymizeNotFixed.Group + AnonymizeNotFixed.Element]) {
|
if (dataset.dict[AnonymizeNotFixed.Group + AnonymizeNotFixed.Element]) {
|
||||||
|
@ -53,9 +55,9 @@ export const anonymization = function (file, config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(dataset)
|
|
||||||
try {
|
try {
|
||||||
let newDicomFile = dataset.write()
|
let newDicomFile = dataset.write({ fragmentMultiframe: false }) // fragmentMultiframe 原始数据是否进行分割
|
||||||
const bufferArray = new Uint8Array(newDicomFile)
|
const bufferArray = new Uint8Array(newDicomFile)
|
||||||
const blob = new Blob([bufferArray], { type: 'application/octet-stream' })
|
const blob = new Blob([bufferArray], { type: 'application/octet-stream' })
|
||||||
resolve({ blob, pixelDataElement })
|
resolve({ blob, pixelDataElement })
|
||||||
|
|
Loading…
Reference in New Issue