+15
-3
@@ -5,6 +5,7 @@ cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
|
||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
|
||||
import { convertBytes } from "@/utils/dicom-character-set";
|
||||
import Vue from 'vue';
|
||||
import { dcmUpload } from "@/utils/dcmUpload/dcmUpload";
|
||||
let dicom = {
|
||||
PatientName: "x00100010", // 患者姓名
|
||||
PatientId: "x00100020", // 患者ID
|
||||
@@ -133,8 +134,20 @@ export const parseDicom = (file, name = false) => {
|
||||
reader.readAsArrayBuffer(file);
|
||||
});
|
||||
};
|
||||
// 影像上传
|
||||
// 影像上传
|
||||
export const dicomToOSS = async (file, path) => {
|
||||
try {
|
||||
let res = await dcmUpload(path, file);
|
||||
if (!res || !res.url) return false;
|
||||
return Vue.prototype.$getObjectName(res.url);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
// 获取缩略图
|
||||
export const getThumbnail = async (file, params, dicomInfo) => {
|
||||
export const getThumbnail = async (file, ossPath, dicomInfo) => {
|
||||
try {
|
||||
if (dicomInfo.modality !== "SR") {
|
||||
let fileId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
|
||||
@@ -144,9 +157,8 @@ export const getThumbnail = async (file, params, dicomInfo) => {
|
||||
dicomInfo.Rows
|
||||
);
|
||||
if (!blob) return "";
|
||||
let thumbnailPath = `/${params.TrialId}/TaskImage/${params.SubjectId}/${params.VisitTaskId}/${dicomInfo.StudyInstanceUid}/${dicomInfo.SeriesInstanceUid}.png`;
|
||||
let OSSclient = Vue.prototype.OSSclient;
|
||||
let seriesRes = await OSSclient.put(thumbnailPath, blob);
|
||||
let seriesRes = await OSSclient.put(ossPath, blob);
|
||||
if (seriesRes && seriesRes.url) {
|
||||
return Vue.prototype.$getObjectName(seriesRes.url);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user