作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 DICOM 格式的 pdf 文件发送到 PACS,并将其附加到单独节点中已有的研究(作为不同的系列)。我得到的异常如下:
org.dcm4che.net.DcmServiceException: SOP Instance UID in Dataset [2.25.227860789054905865463149387539476701251] differs from Affected SOP Instance UID[1.3.12.2.1107.5.2.30.26419.20
15022512062559209947045]
at org.dcm4chex.archive.dcm.storescp.StoreScp.checkSOPInstanceUID(StoreScp.java:1334)
在我发送的 dizomized pdf 中,我使用以下代码重新填充了研究所需的所有标签:
public void repopulateAnonData(String strDcmFilePath, DicomSeriesMeta dcmMeta) throws IOException {
log.info("repopulating anonymized data for file: " + strDcmFilePath);
CheckIfIsDicom dcmCheck = new CheckIfIsDicom();
Path dcmFilePath = Paths.get(strDcmFilePath);
DicomObject dcmObj6;
DicomInputStream din6 = null;
din6 = new DicomInputStream(dcmFilePath.toFile());
dcmObj6 = din6.readDicomObject();
try {
log.info("Repopulating AccessionNumber: " + dcmMeta.getAccessionNumber());
dcmObj6.putString(Tag.AccessionNumber, VR.SH ,dcmMeta.getAccessionNumber());
log.info("Repopulating InstitutionAddress: " + dcmMeta.getInstitutionAddress());
dcmObj6.putString(Tag.InstitutionAddress, VR.ST ,dcmMeta.getInstitutionAddress());
log.info("Repopulating InstitutionName: " + dcmMeta.getInstitutionName());
dcmObj6.putString(Tag.InstitutionName, VR.LO ,dcmMeta.getInstitutionName());
log.info("Repopulating IssuerOfPatientID: " + dcmMeta.getIssuerOfPatientID());
dcmObj6.putString(Tag.IssuerOfPatientID, VR.LO ,dcmMeta.getIssuerOfPatientID());
log.info("Repopulating MediaStorageSOPInstanceUID: " + dcmMeta.getMediaStorageSOPInstanceUID());
dcmObj6.putString(Tag.MediaStorageSOPInstanceUID, VR.UI ,dcmMeta.getMediaStorageSOPInstanceUID());
log.info("Repopulating OperatorsName: " + dcmMeta.getOperatorsName());
dcmObj6.putString(Tag.OperatorsName, VR.PN ,dcmMeta.getOperatorsName());
log.info("Repopulating OtherPatientIDs: " + dcmMeta.getOtherPatientIDs());
dcmObj6.putString(Tag.OtherPatientIDs, VR.LO ,dcmMeta.getOtherPatientIDs());
log.info("Repopulating PatientAge: " + dcmMeta.getPatientAge());
dcmObj6.putString(Tag.PatientAge, VR.AS ,dcmMeta.getPatientAge());
log.info("Repopulating PatientBirthDate: " + dcmMeta.getPatientBirthDate());
dcmObj6.putString(Tag.PatientBirthDate, VR.DA ,dcmMeta.getPatientBirthDate());
log.info("Repopulating PatientID: " + dcmMeta.getPatientID());
dcmObj6.putString(Tag.PatientID, VR.LO ,dcmMeta.getPatientID());
log.info("Repopulating PatientName: " + dcmMeta.getPatientName());
dcmObj6.putString(Tag.PatientName, VR.PN ,dcmMeta.getPatientName());
log.info("Repopulating PatientSex: " + dcmMeta.getPatientSex());
dcmObj6.putString(Tag.PatientSex, VR.CS ,dcmMeta.getPatientSex());
log.info("Repopulating PhysiciansOfRecord: " + dcmMeta.getPhysiciansOfRecord());
dcmObj6.putString(Tag.PhysiciansOfRecord,VR.PN ,dcmMeta.getPhysiciansOfRecord());
log.info("Repopulating ReferringPhysicianName: " + dcmMeta.getReferringPhysicianName());
dcmObj6.putString(Tag.ReferringPhysicianName, VR.PN ,dcmMeta.getReferringPhysicianName());
log.info("Repopulating RequestingPhysician: " + dcmMeta.getRequestingPhysician());
dcmObj6.putString(Tag.RequestingPhysician, VR.PN ,dcmMeta.getRequestingPhysician());
//log.info("Repopulating SOPInstanceUID: " + dcmMeta.getsOPInstanceUID());
//dcmObj6.putString(Tag.SOPInstanceUID, VR.UI ,dcmMeta.getsOPInstanceUID());
log.info("Repopulating StudyDate: " + dcmMeta.getStudyDate());
dcmObj6.putString(Tag.StudyDate, VR.DA ,dcmMeta.getStudyDate());
log.info("Repopulating StudyID: " + dcmMeta.getStudyID());
dcmObj6.putString(Tag.StudyID, VR.SH ,dcmMeta.getStudyID());
log.info("Repopulating StudyInstanceUID: " + dcmMeta.getStudyInstanceUID());
dcmObj6.putString(Tag.StudyInstanceUID, VR.UI,dcmMeta.getStudyInstanceUID());
log.info("Repopulating SeriesDescription: " + "REPORT");
dcmObj6.putString(Tag.SeriesDescription, VR.LO,"REPORT");
FileOutputStream fos = new FileOutputStream( new File(dcmFilePath.toString()), false);
BufferedOutputStream bos = new BufferedOutputStream(fos);
DicomOutputStream dos = new DicomOutputStream(bos);
dos.writeDicomFile(dcmObj6);
dos.close();
bos.close();
fos.close();
} catch (Exception ex) {
log.log(Level.ERROR, null, ex);;
} finally {
din6.close();
if (!dcmCheck.checkIfDicomObjectFileB(dcmFilePath.toFile())) {
log.info("Fetched file is not a DICOM.");
}
}
CheckIfIsDicom checker = new CheckIfIsDicom();
try {
if(checker.checkIfDicomObjectFileB(dcmFilePath.toFile())) {
log.info("Dicomization SUCCESS!");
ParseDicomHeader parseHeader = new ParseDicomHeader();
parseHeader.parseDicomHeaderFile(dcmFilePath.toFile());
} else {
log.info("Dicomization NOT SUCCESS!");
}
} catch (IOException ex) {
log.log(Level.ERROR, null, ex);
}
}
但是,我没有重新填充SeriesInstanceUID和SOPInstanceUID,因为我希望将dicom文件存储在不同系列节点中的特定研究下,但studyID与我试图存储的现有研究(在pacs中)相同这个迪康。
但是 pacs 服务器似乎不接受具有不同 SOPInstanceUID 的 dicom ...
我想念什么有什么想法吗?
最佳答案
问题在于您存储的实例的实例 UID 已存在于存档中。存档拒绝它,因为存储会与该实例的现有系列实例 UID 冲突。
如果您希望将此新对象存储在不同的研究中,那么您需要不同的实例、系列和研究UID。如果您希望它位于同一研究但不同的系列中,那么您需要不同的实例和系列 UID,但需要相同的研究 UID。
关于java - 无法将 dicom 文件发送到 dcm4che PACS - 存储需要禁止强制 (0020,000E) 系列实例 UID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28700552/
我是一名优秀的程序员,十分优秀!