From 3200c71996ccf95d28f2d1cd895792a2a8433ef1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 May 2026 17:04:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E5=92=8C=E4=BC=98=E5=85=88=E7=BA=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/OSSService.cs | 2 +- .../Helper/OtherTool/DicomSortHelper.cs | 41 +++++++-- .../IRaCIS.Core.Application.xml | 89 ++++++++++++++++++- .../Service/Common/FileUploadRecordService.cs | 4 +- .../Service/Management/UserService.cs | 2 + 5 files changed, 123 insertions(+), 15 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index aa63d57e4..2d029ff22 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -1057,7 +1057,7 @@ public class OSSService(IOptionsMonitor options, uploadInfo.FileSize = fileSize; uploadInfo.Path = returnPath; uploadInfo.FileName = Path.GetFileName(localFilePath); - uploadInfo.FileType = Path.GetExtension(returnPath); + uploadInfo.FileType = Path.GetExtension(returnPath).TrimStart("."); await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo); diff --git a/IRaCIS.Core.Application/Helper/OtherTool/DicomSortHelper.cs b/IRaCIS.Core.Application/Helper/OtherTool/DicomSortHelper.cs index 065fc779e..7ae24842d 100644 --- a/IRaCIS.Core.Application/Helper/OtherTool/DicomSortHelper.cs +++ b/IRaCIS.Core.Application/Helper/OtherTool/DicomSortHelper.cs @@ -237,6 +237,20 @@ public static class DicomPixelMasker { workingDataset.AddOrUpdate(DicomTag.BurnedInAnnotation, "NO"); } + + //// 转 JPEG Baseline(最稳定) + //var transcoder = new DicomTranscoder( + // DicomTransferSyntax.ExplicitVRLittleEndian, + // DicomTransferSyntax.JPEGProcess1); + + //var finalFile = await Task.Run( + // () => transcoder.Transcode(workingFile), + // cancellationToken).ConfigureAwait(false); + + //if (output.CanSeek) + // output.SetLength(0); + //await finalFile.SaveAsync(output).ConfigureAwait(false); + // 不要把 original photometric 强行写回 var finalFile = await ReEncodeToOriginalTransferSyntaxAsync( workingFile, @@ -422,17 +436,26 @@ public static class DicomPixelMasker DicomPixelData sourcePixelData, IReadOnlyList frames) { + //dataset.Remove(DicomTag.PixelData); + //var newPixelData = DicomPixelData.Create(dataset, true); + ////newPixelData.BitsAllocated = sourcePixelData.BitsAllocated; + //newPixelData.BitsStored = sourcePixelData.BitsStored; + //newPixelData.HighBit = sourcePixelData.HighBit; + //newPixelData.SamplesPerPixel = sourcePixelData.SamplesPerPixel; + //newPixelData.PixelRepresentation = sourcePixelData.PixelRepresentation; + //newPixelData.PlanarConfiguration = sourcePixelData.PlanarConfiguration; + //newPixelData.Height = sourcePixelData.Height; + //newPixelData.Width = sourcePixelData.Width; + //newPixelData.PhotometricInterpretation = sourcePixelData.PhotometricInterpretation; + //foreach (var frame in frames) + //{ + // newPixelData.AddFrame(frame); + //} + dataset.Remove(DicomTag.PixelData); + var newPixelData = DicomPixelData.Create(dataset, true); - //newPixelData.BitsAllocated = sourcePixelData.BitsAllocated; - newPixelData.BitsStored = sourcePixelData.BitsStored; - newPixelData.HighBit = sourcePixelData.HighBit; - newPixelData.SamplesPerPixel = sourcePixelData.SamplesPerPixel; - newPixelData.PixelRepresentation = sourcePixelData.PixelRepresentation; - newPixelData.PlanarConfiguration = sourcePixelData.PlanarConfiguration; - newPixelData.Height = sourcePixelData.Height; - newPixelData.Width = sourcePixelData.Width; - newPixelData.PhotometricInterpretation = sourcePixelData.PhotometricInterpretation; + foreach (var frame in frames) { newPixelData.AddFrame(frame); diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index fb3f4d549..5d2743ea9 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2911,6 +2911,13 @@ + + + 获取未阅片完成的访视,方便前端调用下载 + + + + 批量勾选访视 进行下载 @@ -5932,6 +5939,82 @@ + + + 阅片导入 + + + + + + 获取阅片的计算数据 + + + + + + + 删除病灶获取起始病灶序号 + + + + + + 获取阅片报告 + + + + + + + 将上一次的访视病灶添加到这一次 + + + + + + + 测试计算 + + + + + + + + 计算任务 + + + + + + + 自动计算 + + + + + + + + 获取脂肪分数平均值 + + + + + + + 获取脂肪肝分级 + + + + + + + 计算平均值 + + + 阅片导入 @@ -17316,17 +17399,17 @@ - ���� + 质疑 - һ���Ժ˲� + 一致性核查 - ���� + 复制 diff --git a/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs b/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs index 3c367627c..78e02246c 100644 --- a/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs +++ b/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs @@ -222,7 +222,7 @@ public class FileUploadRecordService(IRepository _fileUploadRe { addOrEditFileUploadRecord.IsNeedSync = true; - addOrEditFileUploadRecord.Priority = 0; + addOrEditFileUploadRecord.Priority = addOrEditFileUploadRecord.Priority?? 0; addOrEditFileUploadRecord.IsSync = false; } @@ -242,7 +242,7 @@ public class FileUploadRecordService(IRepository _fileUploadRe addOrEditFileUploadRecord.IsSync = false; - addOrEditFileUploadRecord.Priority = 0; + addOrEditFileUploadRecord.Priority = addOrEditFileUploadRecord.Priority ?? 0; } var entity = await _fileUploadRecordRepository.InsertOrUpdateAsync(addOrEditFileUploadRecord, true); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index fa46dfa78..666251aac 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -359,6 +359,8 @@ namespace IRaCIS.Core.Application.Service await _mailVerificationService.AnolymousSendEmailForResetAccount(email, verificationCode); + await _fusionCache.RemoveAsync(CacheKeys.UserLoginError(existUser.UserName)); + await _fusionCache.RemoveByTagAsync(CacheKeys.UserMFATag(existUser.Id)); return ResponseOutput.Ok(); From 9bd090da66a722567c95fd190823da26a5f4e59d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 May 2026 17:31:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=81=8F=E7=A7=BB=E8=A1=A8bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 12 ++-- .../Service/ImageAndDoc/StudyService.cs | 59 ++++++++++++++----- 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 224d2ca24..9c1fecab5 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -540,12 +540,12 @@ namespace IRaCIS.Core.SCP.Service //保留原始偏移表 - if (originOffsetTable.Count == pixelData.NumberOfFrames) - { - newFragments.OffsetTable.AddRange(originOffsetTable.ToArray()); + //if (originOffsetTable.Count == pixelData.NumberOfFrames) + //{ + // newFragments.OffsetTable.AddRange(originOffsetTable.ToArray()); - } - else + //} + //else { newFragments.OffsetTable.AddRange(bot.ToArray()); @@ -674,7 +674,7 @@ namespace IRaCIS.Core.SCP.Service // 上传缩略图到 OSS - var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, $"{seriesId.ToString()}_{instanceId.ToString()}.preview.jpg", false,uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = _trialId, BatchDataType = BatchDataType.PACSReceive }); + var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, $"{seriesId.ToString()}_{instanceId.ToString()}.preview.jpg", false, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = _trialId, BatchDataType = BatchDataType.PACSReceive }); series.ImageResizePath = seriesPath; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 10c7fc48e..8808c0fe2 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -166,43 +166,72 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc var newFragments = new DicomOtherByteFragment(DicomTag.PixelData); - #region 最终使用 - for (int n = 0; n < pixelData.NumberOfFrames; n++) { - var frameData = pixelData.GetFrame(n); // 获取完整一帧 + var frameData = pixelData.GetFrame(n); var data = frameData.Data; - int offset = 0; + // 当前 frame 起始 offset bot.Add(botOffset); - botOffset += (uint)data.Length; - + int offset = 0; while (offset < data.Length) { - botOffset += 8; - - int size = Math.Min(fragmentSize, data.Length - offset); + var buffer = new byte[size]; Buffer.BlockCopy(data, offset, buffer, 0, size); newFragments.Fragments.Add(new MemoryByteBuffer(buffer)); - offset += size; + // 一个 fragment: + // 8-byte item header + // + fragment payload + botOffset += (uint)(8 + size); + offset += size; } } + + #region 最终使用 + + //for (int n = 0; n < pixelData.NumberOfFrames; n++) + //{ + // var frameData = pixelData.GetFrame(n); // 获取完整一帧 + // var data = frameData.Data; + // int offset = 0; + + // bot.Add(botOffset); + + // botOffset += (uint)data.Length; + + + // while (offset < data.Length) + // { + // botOffset += 8; + + + // int size = Math.Min(fragmentSize, data.Length - offset); + // var buffer = new byte[size]; + // Buffer.BlockCopy(data, offset, buffer, 0, size); + + // newFragments.Fragments.Add(new MemoryByteBuffer(buffer)); + + // offset += size; + + // } + //} + //保留原始偏移表 - if (originOffsetTable.Count == pixelData.NumberOfFrames) - { - newFragments.OffsetTable.AddRange(originOffsetTable.ToArray()); + //if (originOffsetTable.Count == pixelData.NumberOfFrames) + //{ + // newFragments.OffsetTable.AddRange(originOffsetTable.ToArray()); - } - else + //} + //else { newFragments.OffsetTable.AddRange(bot.ToArray()); From 1fa81d1e4f665d7780fbc71f77454f86de5f52f1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Sat, 9 May 2026 09:16:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=81=8F=E7=A7=BB?= =?UTF-8?q?=E8=A1=A8=E6=96=B9=E4=BE=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 8808c0fe2..c38ebff88 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -235,6 +235,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { newFragments.OffsetTable.AddRange(bot.ToArray()); + Log.Logger.Warning(bot.ToArray().ToJsonStr()); } #endregion From 13f983bc2117ec9e6ad38d744647079845312318 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Sat, 9 May 2026 09:38:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/OSSService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index 2d029ff22..ec04c3f08 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -918,7 +918,7 @@ public class OSSService(IOptionsMonitor options, uploadInfo.FileSize = fileStream.CanSeek ? fileStream.Length : 0; uploadInfo.Path = returnPath; uploadInfo.FileName = fileRealName; - uploadInfo.FileType = Path.GetExtension(returnPath); + uploadInfo.FileType = Path.GetExtension(returnPath).TrimStart('.'); await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo);