cornerstone系列 - 加載多幀dicom(multi-frame)

cornerstoneWADOImageLoader是支持multi-frame的,官方有提供example:
https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/examples/wadourimultiframe/index.html

用法寫的很明白,主要是通過在wado url后加上frame參數(shù)來切分,實際用的時候有問題想補充一下。

下面官方例子中的代碼中要注意unload這個一定要加,要釋放cache,不然loadAndCacheImage的時候就會報"frame exceeds size of pixelData"錯誤。除了unload,如果你的業(yè)務(wù)場景不方便用這個方法來指定清楚這個url對應(yīng)的cache的話,也可以使用 cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.purge()

我用下來多幀圖像的首次加載是需要一張一張加載的,每加載一張清一次cache,才不會報錯(不知道是不是有cachesize之類,或者是我用法不對,有知道的小伙伴麻煩評論告訴我,感謝)。所以比如scroll的場景,和預(yù)加載的場景,都需要注意單張加載且及時清理。

 cornerstone.loadAndCacheImage(imageIds[0]).then(function(image) {
                // now that we have an image frame in the cornerstone cache, we can decrement
                // the reference count added by load() above when we loaded the metadata.  This way
                // cornerstone will free all memory once all imageId's are removed from the cache
                cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.unload(url);
                    
                cornerstone.displayImage(element, image);
              .....
            }, function(err) {
                alert(err);
            });
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容