0

目前,当我从这个 dicom 文件中获取像素数据时,它似乎与提供的图像分辨率不匹配。

例如,图像的宽度和高度可能是:W: 600, H:430 这会让我认为预期的总大小是 258,000 个元素,但是当我得到像素数据时它只有 50104 个元素。

令我困惑的是,数组中的元素比文件分辨率少。我期待如果存在不匹配,这可能是因为所有帧都被分组到同一个缓冲区中,我可能需要按帧数细分像素数据,但没有足够的元素来覆盖图像解析度?我有点不知所措。

此类提供的 dicom 文件像素数据:

https://fo-dicom.github.io/html/cfa9fe02-c413-ea1f-52df-dd1a6f5b71cf.htm

其中每个像素都是一个字节,用于查找颜色查找表的索引。

代码示例

protected override byte[] GetPixelDataInternal(GrayscalePixelDataU8 pixelData, DicomDataset dicomDataset)
{
    long totalDimensions = pixelData.Width * pixelData.Height;
    DicomPixelData header = DicomPixelData.Create(dicomDataset);

    // These uncompressed framesize matches total dimensions
    Debug.Log($"Uncompressed Frame Size: {header.UncompressedFrameSize}");
    Debug.Log($"GetPixelDataInternal: {pixelData.Width} x {pixelData.Height} Total: {totalDimensions}");

    // pixelData.Data.Length does not match total length
    Debug.Log($"PixelDataLength: {pixelData.Data.Length} ");

    // It says it is not lossy.
    Debug.Log($"IsLossy: {header.IsLossy}");

    // ...
}

期望的行为
使用 fo-dicom 库打开和渲染具有光度解释 PaletteColor 的多帧 dicom 图像。

4

1 回答 1

1

结果确实是因为传输语法是RLELossless,并且需要解码数据。

DicomTranscoderfo-dicom:
https ://fo-dicom.github.io/html/f94d5b29-c69f-c0c7-6443-1b001cfc91ec.htm

于 2020-12-10T19:01:44.427 回答