- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在对 dcm4che3 和 dicom 协议(protocol)进行一些研究后改写我原来的帖子。
我正在使用 dcm4che3 工具包构建一个应用程序,它本质上是一个简单的 Image Archive能够按需将研究转发给其他模态。该工具还实现了一个 s-store scu 服务来查询自身以及其他模态。
一个要求是能够从这个本地存档中定期“删除”研究。
我也是 dicom 协议(protocol)和 dcm4che 的新手,所以我试图了解底层 dicomdir(由 dcm4che-tool-dcmqrscp 使用)的逻辑以及用于删除研究的任何可用服务或方法。
所以我的问题如下:
在 dicom 协议(protocol)的上下文中,术语“删除研究”是否有效?
正如我在删除研究(使用该工具)时看到的“dcm4che-tool-dcmdir”,实际发生的是“从现有目录中删除引用由文件指定的 DICOM 文件的记录.. 或目录.. 参数通过设置其 Record In-use Flag = 0 来保存文件”,以便文件保留在文件系统中。
如果我尝试以这种方式删除一项研究(tool-dicomdir 中的 -d 选项),当我使用我的 c-find scu 查询存档时,我可以找到该研究。因此,即使 dicomdir 中的记录被标记为不活动,如果我对存档执行 c-find 查询,我仍然可以获取它。
如果我尝试从文件系统中手动删除学习文件,我猜想 dicomdir 已损坏。
是否有任何其他方法(或协议(protocol)的一部分)以一致的方式从 dicomdir 中删除研究(永久地从 dicomdir 记录,但也从文件系统,如果可能)?
我用来删除研究的代码(使用与 dicomdir 中的 -d 选项类似的方法)是:
public void deleteDicomDir(String studyDir) throws IOException {
DcmDir1 main = new DcmDir1();
long start = System.currentTimeMillis();
LOG.info("$$$ Trying to delete dicomdir: " + studyDir);
main.open(new File("C:\\dicomrouter_dev\\dcmrouter_root\\dicomdir"));
main.removeReferenceTo(new File(studyDir));
main.close();
long end = System.currentTimeMillis();
System.out.println();
System.out.println(MessageFormat.format(
rb.getString("deleted"),
num, main.getFile(), (end - start)));
}
“removeReferenceTo()”方法实际上是在最后调用 DicomDirWritter 方法:
public synchronized boolean deleteRecord(Attributes rec)
throws IOException {
if (rec.getInt(Tag.RecordInUseFlag, 0) == INACTIVE)
return false; // already disabled
for (Attributes lowerRec = readLowerDirectoryRecord(rec);
lowerRec != null;
lowerRec = readNextDirectoryRecord(lowerRec))
deleteRecord(lowerRec);
rec.setInt(Tag.RecordInUseFlag, VR.US, INACTIVE);
markAsDirty(rec);
return true;
}
感谢您的宝贵时间,我期待着任何能说明这一点的信息
实际上,在对 dicom 协议(protocol)以及 dcm4che 工具包进行一些研究之后,我能够通过 3 个步骤删除一项研究并同步我的 DICOMDIR 并删除记录使用中标志 = 0 的研究(或文件):
//delete records referring DICOM files specified by <directory:studyDir> arguments from existing directory file <dicomdir> by setting its Record In-use Flag = 0
public void deleteDicomDir(String studyDir) {
String dicomdir = "C:\\dicomrouter_dev\\dcmrouter_root\\DICOMDIR";
DcmDir1 main = new DcmDir1();
long start = System.currentTimeMillis();
try {
LOG.info("$$$ Trying to delete dicomdir: " + studyDir);
main.open(new File(dicomdir));
int num = 0;
main.removeReferenceTo(new File(studyDir));
main.close();
long end = System.currentTimeMillis();
System.out.println();
System.out.println(MessageFormat.format(
rb.getString("deleted"),
num, main.getFile(), (end - start)));
} catch (IOException ex) {
java.util.logging.Logger.getLogger(DcmDir1.class.getName()).log(Level.SEVERE, null, ex);
} finally {
main.close();
}
}
//purge records without file references from directory file <dicomdir> by setting its Record In-use Flag = 0
public void purgeDicomDir() {
String dicomdir = "C:\\dicomrouter_dev\\dcmrouter_root\\DICOMDIR";
DcmDir1 main = new DcmDir1();
long start = System.currentTimeMillis();
try {
main.open(new File(dicomdir));
int num = main.purge();
main.close();
long end = System.currentTimeMillis();
System.out.println(MessageFormat.format(
rb.getString("purged"),
num, main.getFile(), (end - start)));
} catch (IOException ex) {
java.util.logging.Logger.getLogger(DcmDir1.class.getName()).log(Level.SEVERE, null, ex);
} finally {
main.close();
}
}
//compact existing directory file <dicomdir> by removing records with Record In-use Flag != 0
public void compactDicomDir() {
String fpath = "C:\\dicomrouter_dev\\dcmrouter_root\\DICOMDIR";
File f = new File(fpath);
File bak = new File(fpath + "~");
DcmDir1 main = new DcmDir1();
long start = System.currentTimeMillis();
try {
LOG.info("$$$ Trying to compact dicomdir: " + fpath);
main.compact(f, bak);
long end = System.currentTimeMillis();
System.out.println(MessageFormat.format(
rb.getString("compacted"),
f, bak.length(), f.length(), (end - start)));
} catch (IOException ex) {
java.util.logging.Logger.getLogger(DcmDir1.class.getName()).log(Level.SEVERE, null, ex);
} finally {
main.close();
}
}
然后我也可以安全地从磁盘中删除文件。
最佳答案
我已经在评论(现已删除)中向您解释了这一点。我还向您指出了this讨论同一件事的问题。正如我在评论中所说,这更多的是关于协议(protocol)而不是工具包。
首先,当您说“删除研究”时,我假设您实际上想从硬盘中删除 DICOM 文件及其在其他(DICOMDIR 或数据库等)位置的引用。
在 DICOM 中无法做到这一点。
DICOM 中的 N-DELETE 命令不是为了这个目的。如 this 中所述回答,你可以尝试Imaging Object Change Management IHE 集成配置文件。我从来没有用过那个;很抱歉,我无法对此发表进一步评论。
In the context of dicom protocol is it valid the term: "Delete a study"?
正如我上面所说;没有。
As i can see the "dcm4che-tool-dcmdir" when deleting a study (using the tool), what happens actually is to "delete records referring DICOM files specified by file.. or directory.. arguments from existing directory file by setting its Record In-use Flag = 0" so the files remain on the filesystem.
这看起来很自然。该命令应该只修改 DICOMDIR 以删除文件。它不应从硬盘中删除物理文件。
Even more if i try and delete a study in this way (-d option in tool-dicomdir) when i query the archive with my c-find scu, i can find the study. So even if the record in dicomdir is marked as Inactive if i perform a c-find query to the archive i can still fetch it.
我不知道你的C-FIND-RESPONSE
的来源是什么。如果它是 DICOMDIR 本身,很可能您在前面的步骤中对其所做的修改没有保存。保存修改,这应该可以工作。但请记住,这仍然不会从物理存储中删除文件。您只是删除了它的引用。
我不是您正在使用的工具包的专家。但是,在您的问题中使用以下代码:
main.open(new File("C:\\dicomrouter_dev\\dcmrouter_root\\dicomdir"));
main.removeReferenceTo(new File(studyDir));
//Check if you need to save the changes here before closing
main.close();
您似乎正在打开 DICOMDIR——从中删除目录引用——关闭 DICOMDIR。我不知道 removeReferenceTo
方法的实现;可能是来自 github .如果它也没有保存更改,则您必须明确保存更改。可能你需要使用 DicomOutputStream
类来做。我发现以下示例代码 here :
FileOutputStream fos = new FileOutputStream(fileOutput +".dcm");
BufferedOutputStream bos = new BufferedOutputStream(fos);
DicomOutputStream dos = new DicomOutputStream(bos);
dos.writeDicomFile(dio);
dos.close();
If i try and delete study files manually from the filesystem i guess that the dicomdir becomes corrupted.
是的;那就对了。为避免这种情况,还要相应地修改 DICOMDIR。物理存储和 DICOMDIR 都应处于一致状态。
提案 - 1:
-d
命令)。提案 - 2:
使用 DICOM 命令,实现自定义行为。修改 DICOM 命令的行为(可能是 N-DELETE)以执行其他操作。这只有在您可以访问源代码并愿意更改它时才有可能。我个人不推荐这样做,因为:
关于dicom - Dcm4che 从本地存档 (dicomdir) 中删除研究,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56459112/
我即将在 uni 开始关于 OpenCL 的荣誉项目,以及如何使用它来改进现代游戏开发。我知道现在/很快有几本书关于学习 opencl,但我想知道是否有人知道关于 opencl 的任何好论文。 我一直
在 Web 开发领域,我听过很多博客,人们说用户倾向于忽略(或被激怒)华而不实/不必要的动画内容,对可用性产生不利影响,但是否有任何研究支持那个声明? 最佳答案 我找到了一对似乎符合您正在寻找的路线。
我对网络语音和音频不熟悉。 我一直在谷歌上搜索示例和解决方案来实现 p2p 语音连接(这个想法是音频 session )。 我发现 google talk xmpp 框架可以访问用户和文本聊天等信息。
我打算创建一个优化的数据结构来保存汇编代码。这样我就可以完全负责将在这个结构上工作的优化算法。如果我可以边运行边编译。这将是一种动态执行。这可能吗?有没有人见过这样的事情? 我应该使用结构将结构链接到
低代码开发平台 Mendix 最新发布的一份研究报告表明,疫情在全球范围内的扩散大大加速了对企业低代码的兴趣和使用。该报告基于来自美国、中国、英国、德国、比利时和荷兰的 1209 名 IT 专业人士
最常用的数值类型是int,但是它未必是最佳选择。bigint,smallint,tinyint可以应用在特殊场合。他们的特性如下表所示: Data type
我试图了解在使用 R 包 kernlab 中的命令 ksvm 时 SVM 预测函数是如何工作的。 我尝试使用以下命令查看预测函数: methods(class="ksvm") getAnywhere(
据我了解,XMPP 协议(protocol)基于始终在线的连接,您无法立即指示 XML 消息何时结束。 这意味着您必须在流来时对其进行评估。这也意味着,您可能必须处理异步连接,因为套接字可能会阻塞在
两天后,我发现自己正在考虑通过网站上的 ajax 请求实现流程自动化。我想做的是研究网站上执行的某些操作的一些请求,并用 javascript 复制它。例如,当我在剧院选择一些座位时,我有这个 POS
当我研究我没有编写的复杂 Java 代码时,我会定期在记事本中写下一些我对给定问题感兴趣的资源的调用堆栈。这些资源通常是方法或常量。 这是一个例子: CONSTANT_NAME com.com
我将为 Android 智能手机实现一个蜜 jar 作为我论文的研究。我从来没有使用过android、java和蜜 jar 。这就是我想开始的方式。我想到使用Honeyd的源代码(用C语言编写),Ho
Closed. This question does not meet Stack Overflow guidelines 。它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 Stack Ov
晚上好。 我真的很难理解这个问题,我不确定我是否错过了一些非常愚蠢的东西,但这是我的代码和我的问题。 const question = new Map(); question.set('questio
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我想知道是否有人有任何关于编译/链接优化的好资源(论文/文章/书籍引用)。 我曾在两家以不同方式执行链接操作的公司工作。 第一公司强制代码采用严格的 DAG 结构,向我解释说使用强制树结构,链接时间非
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我有 4 个文件想用 Python/Pandas 读取,这些文件是: https://github.com/kelsey9649/CS8370Group/tree/master/TaFengDataS
我正在尝试查找任何分析 Qt 和 Qt Creator 最新版本的研究/学术/期刊论文/文章。 具体来说,我试图从实时安全关键的角度评估 Qt,所以任何信息都是有帮助的。 附言我尝试了典型的搜索方法:
在 Main Wrapper 中,我有 5 个 Div。第一个 div 包含 4 个 Box(box_1, box_2,box_3,box_4),我的点击事件将在其中发生。 另外4个div在main
所以,我一直在用 Netbeans C++ 调试一个程序,我需要仔细查看 vector 的内容,以帮助我找出哪里出了问题。因此,我进入“变量”选项卡进行挖掘。问题是,Netbeans(或我使用过的任何
我是一名优秀的程序员,十分优秀!