How to use the dicom-parser.readEncapsulatedPixelDataFromFragments function in dicom-parser

To help you get started, we’ve selected a few dicom-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FNNDSC / ami / src / parsers / parsers.dicom.js View on Github external
this._dataSet.elements.x7fe00010,
        frameIndex
      );
    }

    if (this.framesAreFragmented()) {
      // Basic Offset Table is empty
      return DicomParser.readEncapsulatedImageFrame(
        this._dataSet,
        this._dataSet.elements.x7fe00010,
        frameIndex,
        DicomParser.createJPEGBasicOffsetTable(this._dataSet, this._dataSet.elements.x7fe00010)
      );
    }

    return DicomParser.readEncapsulatedPixelDataFromFragments(
      this._dataSet,
      this._dataSet.elements.x7fe00010,
      frameIndex
    );
  }
github FNNDSC / ami / src / parsers / parsers.dicom.js View on Github external
const columns = this.columns();
    const rows = this.rows();
    const samplesPerPixel = this.samplesPerPixel(frameIndex);
    const pixelRepresentation = this.pixelRepresentation(frameIndex);

    // format data for the RLE decoder
    const imageFrame = {
      pixelRepresentation,
      bitsAllocated,
      planarConfiguration,
      columns,
      rows,
      samplesPerPixel,
    };

    const pixelData = DicomParser.readEncapsulatedPixelDataFromFragments(
      this._dataSet,
      this._dataSet.elements.x7fe00010,
      frameIndex
    );

    const decoded = RLEDecoder(imageFrame, pixelData);
    return decoded.pixelData;
  }