【问题标题】:Showing multiple images using a single cornerstone object使用单个基石对象显示多个图像
【发布时间】:2019-03-11 15:16:23
【问题描述】:

我正在尝试使用cornerstonejs/工具实现一个加载了多个图像的视图(假设一个元素中包含 4*4 个图像)。我不需要为所有这些图像保存状态,除了第一个。对于这个图像,我已经有了一个状态管理器和一个基石元素。

据我所知,基石工具中没有任何工具可以在同一画布中显示多个图像。实现这一点的正确方法是什么? 我的想法是为单独的图像加载单独的基石对象,从而为每个图像使用不同的画布,如 here 的示例所示。

<script>
    // image enable the elements
    const mr1 = document.getElementById('mr1');
    cornerstone.enable(mr1);
    const mr2 = document.getElementById('mr2');
    cornerstone.enable(mr2);
    const ct1 = document.getElementById('ct1');
    cornerstone.enable(ct1);
    // load and display the images
    cornerstone.loadAndCacheImage('example://1').then(function(image) {
        cornerstone.displayImage(mr1, image);
    });
    cornerstone.loadAndCacheImage('example://2').then(function(image) {
        cornerstone.displayImage(mr2, image);
    });
    cornerstone.loadAndCacheImage('ctexample://1').then(function(image) {
        cornerstone.displayImage(ct1, image);
    });
</script>

有没有更好的方法来实现这一点,我不必为每个图像创建基石对象,但具有独立的图像基本功能(缩放、平移等不需要保存)。

【问题讨论】:

    标签: javascript canvas cornerstonejs


    【解决方案1】:

    按照您的建议,最好的方法是为每个视口/图像/图像堆栈创建一个单独的基石启用元素。 Cornerstone 在内部使用启用的元素来跟踪各种事物,例如事件、图像缩放/窗口/级别,以及基于画布元素调整图像大小,因此试图强制多个图像显示在同一个元素中会非常麻烦。

    【讨论】:

      猜你喜欢
      • 2014-12-26
      • 2020-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-22
      • 1970-01-01
      相关资源
      最近更新 更多