From 40d035e7a77d67d7f4c879ea6fd8c0d1878d32d9 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Thu, 15 May 2025 09:33:17 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=90=88=E5=B9=B6=E7=9A=84?=
=?UTF-8?q?=E5=86=B2=E7=AA=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Application/TestService.cs | 56 --------------------------
1 file changed, 56 deletions(-)
diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs
index b6cc69756..a0909f0e2 100644
--- a/IRaCIS.Core.Application/TestService.cs
+++ b/IRaCIS.Core.Application/TestService.cs
@@ -210,62 +210,6 @@ namespace IRaCIS.Core.Application.Service
- ///
- /// 后端处理某个中心缩略图有问题 先下载,生成缩略图上传,然后更新数据库
- ///
- ///
- [AllowAnonymous]
- public async Task BackImageResize(Guid trialSiteId ,Guid subjectId/* , [FromServices] IRepository<>*/)
- {
- ///${params.trialId}/ Image /${params.subjectId}/${params.subjectVisitId}/${ dicomInfo.studyUid}/${ v.seriesUid}.jpg
-
- var dealSeriesList = await _dicomSeriesRepository.Where(t => t.DicomStudy.Subject.TrialSiteId == trialSiteId && t.SubjectId== subjectId).Select(t => new { t.Id, t.SubjectId, t.TrialId, t.SubjectVisitId, t.StudyInstanceUid, t.SeriesInstanceUid, t.ImageResizePath, t.UpdateUserId, FirstInstancePath = t.DicomInstanceList.First().Path }).ToListAsync();
-
- //下载到本地
- string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
- Directory.CreateDirectory(tempFolderPath);
-
- foreach (var dealSeries in dealSeriesList)
- {
- var fileName = Path.GetFileNameWithoutExtension(dealSeries.FirstInstancePath);
-
- var localFilePath = Path.Combine(tempFolderPath, fileName);
-
- await _IOSSService.DownLoadFromOSSAsync(dealSeries.FirstInstancePath, localFilePath);
-
-
- var resizePath = localFilePath + "_New.jpg";
-
- //生成缩略图
-
- // 读取 DICOM 文件
- var dicomImage = new DicomImage(localFilePath);
-
-
- // 渲染 DICOM 图像到 ImageSharp 格式
- using (var image = dicomImage.RenderImage().AsSharpImage())
- {
- // 生成缩略图(调整大小)
- image.Mutate(x => x.Resize(500, 500));
-
- // 保存缩略图为 JPEG
- image.Save(resizePath, new JpegEncoder());
- }
-
- var ossFolder = $"{dealSeries.TrialId}/Image/{dealSeries.SubjectId}/{dealSeries.SubjectVisitId}/{dealSeries.StudyInstanceUid}";
-
- var relativePath = await _IOSSService.UploadToOSSAsync(resizePath, ossFolder, false);
-
- await _dicomSeriesRepository.BatchUpdateNoTrackingAsync(t => t.Id == dealSeries.Id, u => new DicomSeries() { ImageResizePath = relativePath, UpdateUserId = dealSeries.UpdateUserId });
-
- }
-
- return ResponseOutput.Ok();
-
- }
-
-
-
///
/// 后端处理某个中心缩略图有问题 先下载,生成缩略图上传,然后更新数据库
///