Update dicomParser. Small bug fix in hangingProtocol to avoid errors on non-image files
This commit is contained in:
parent
48a9990f32
commit
1bcf4fc02d
@ -1,4 +1,4 @@
|
|||||||
/*! dicom-parser - v1.1.5 - 2015-08-17 | (c) 2014 Chris Hafey | https://github.com/chafey/dicomParser */
|
/*! dicom-parser - v1.2.0 - 2015-11-02 | (c) 2014 Chris Hafey | https://github.com/chafey/dicomParser */
|
||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
|
|
||||||
// node.js
|
// node.js
|
||||||
@ -33,7 +33,7 @@
|
|||||||
* @throws error if an error occurs while parsing. The exception object will contain a property dataSet with the
|
* @throws error if an error occurs while parsing. The exception object will contain a property dataSet with the
|
||||||
* elements successfully parsed before the error.
|
* elements successfully parsed before the error.
|
||||||
*/
|
*/
|
||||||
var dicomParser = (function(dicomParser) {
|
var dicomParser = (function(dicomParser) {
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
{
|
{
|
||||||
dicomParser = {};
|
dicomParser = {};
|
||||||
@ -46,49 +46,12 @@
|
|||||||
throw "dicomParser.parseDicom: missing required parameter 'byteArray'";
|
throw "dicomParser.parseDicom: missing required parameter 'byteArray'";
|
||||||
}
|
}
|
||||||
|
|
||||||
var littleEndianByteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray);
|
|
||||||
|
|
||||||
function readPrefix()
|
|
||||||
{
|
|
||||||
littleEndianByteStream.seek(128);
|
|
||||||
var prefix = littleEndianByteStream.readFixedString(4);
|
|
||||||
if(prefix !== "DICM")
|
|
||||||
{
|
|
||||||
throw "dicomParser.parseDicom: DICM prefix not found at location 132";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function readPart10Header()
|
|
||||||
{
|
|
||||||
// Per the DICOM standard, the header is always encoded in Explicit VR Little Endian (see PS3.10, section 7.1)
|
|
||||||
// so use littleEndianByteStream throughout this method regardless of the transfer syntax
|
|
||||||
readPrefix();
|
|
||||||
|
|
||||||
var warnings = [];
|
|
||||||
var elements = {};
|
|
||||||
while(littleEndianByteStream.position < littleEndianByteStream.byteArray.length) {
|
|
||||||
var position = littleEndianByteStream.position;
|
|
||||||
var element = dicomParser.readDicomElementExplicit(littleEndianByteStream, warnings);
|
|
||||||
if(element.tag > 'x0002ffff') {
|
|
||||||
littleEndianByteStream.position = position;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Cache the littleEndianByteArrayParser for meta header elements, since the rest of the data set may be big endian
|
|
||||||
// and this parser will be needed later if the meta header values are to be read.
|
|
||||||
element.parser = dicomParser.littleEndianByteArrayParser;
|
|
||||||
elements[element.tag] = element;
|
|
||||||
}
|
|
||||||
var metaHeaderDataSet = new dicomParser.DataSet(littleEndianByteStream.byteArrayParser, littleEndianByteStream.byteArray, elements);
|
|
||||||
metaHeaderDataSet.warnings = littleEndianByteStream.warnings;
|
|
||||||
return metaHeaderDataSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
function readTransferSyntax(metaHeaderDataSet) {
|
function readTransferSyntax(metaHeaderDataSet) {
|
||||||
if(metaHeaderDataSet.elements.x00020010 === undefined) {
|
if(metaHeaderDataSet.elements.x00020010 === undefined) {
|
||||||
throw 'dicomParser.parseDicom: missing required meta header attribute 0002,0010';
|
throw 'dicomParser.parseDicom: missing required meta header attribute 0002,0010';
|
||||||
}
|
}
|
||||||
var transferSyntaxElement = metaHeaderDataSet.elements.x00020010;
|
var transferSyntaxElement = metaHeaderDataSet.elements.x00020010;
|
||||||
return dicomParser.readFixedString(littleEndianByteStream.byteArray, transferSyntaxElement.dataOffset, transferSyntaxElement.length);
|
return dicomParser.readFixedString(byteArray, transferSyntaxElement.dataOffset, transferSyntaxElement.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isExplicit(transferSyntax) {
|
function isExplicit(transferSyntax) {
|
||||||
@ -100,16 +63,30 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDataSetByteStream(transferSyntax) {
|
function getDataSetByteStream(transferSyntax, position) {
|
||||||
|
if(transferSyntax === '1.2.840.10008.1.2.1.99')
|
||||||
|
{
|
||||||
|
if(typeof(pako) === "undefined") {
|
||||||
|
throw 'dicomParser.parseDicom: deflated transfer syntax encountered but pako not loaded';
|
||||||
|
}
|
||||||
|
var deflated = byteArray.slice(position);
|
||||||
|
var inflated = pako.inflateRaw(deflated);
|
||||||
|
|
||||||
|
// create a single byte array with the full header bytes and the inflated bytes
|
||||||
|
var fullByteArray = new Uint8Array(inflated.length + position);
|
||||||
|
fullByteArray.set(byteArray.slice(0, position), 0);
|
||||||
|
fullByteArray.set(inflated, position);
|
||||||
|
return new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, fullByteArray, 0);
|
||||||
|
}
|
||||||
if(transferSyntax === '1.2.840.10008.1.2.2') // explicit big endian
|
if(transferSyntax === '1.2.840.10008.1.2.2') // explicit big endian
|
||||||
{
|
{
|
||||||
return new dicomParser.ByteStream(dicomParser.bigEndianByteArrayParser, byteArray, littleEndianByteStream.position);
|
return new dicomParser.ByteStream(dicomParser.bigEndianByteArrayParser, byteArray, position);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// all other transfer syntaxes are little endian; only the pixel encoding differs
|
// all other transfer syntaxes are little endian; only the pixel encoding differs
|
||||||
// make a new stream so the metaheader warnings don't come along for the ride
|
// make a new stream so the metaheader warnings don't come along for the ride
|
||||||
return new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray, littleEndianByteStream.position);
|
return new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +109,7 @@
|
|||||||
{
|
{
|
||||||
var transferSyntax = readTransferSyntax(metaHeaderDataSet);
|
var transferSyntax = readTransferSyntax(metaHeaderDataSet);
|
||||||
var explicit = isExplicit(transferSyntax);
|
var explicit = isExplicit(transferSyntax);
|
||||||
var dataSetByteStream = getDataSetByteStream(transferSyntax);
|
var dataSetByteStream = getDataSetByteStream(transferSyntax, metaHeaderDataSet.position);
|
||||||
|
|
||||||
var elements = {};
|
var elements = {};
|
||||||
var dataSet = new dicomParser.DataSet(dataSetByteStream.byteArrayParser, dataSetByteStream.byteArray, elements);
|
var dataSet = new dicomParser.DataSet(dataSetByteStream.byteArrayParser, dataSetByteStream.byteArray, elements);
|
||||||
@ -159,7 +136,7 @@
|
|||||||
|
|
||||||
// main function here
|
// main function here
|
||||||
function parseTheByteStream() {
|
function parseTheByteStream() {
|
||||||
var metaHeaderDataSet = readPart10Header();
|
var metaHeaderDataSet = dicomParser.readPart10Header(byteArray, options);
|
||||||
|
|
||||||
var dataSet = readDataSet(metaHeaderDataSet);
|
var dataSet = readDataSet(metaHeaderDataSet);
|
||||||
|
|
||||||
@ -171,9 +148,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
})(dicomParser);
|
})(dicomParser);
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser) {
|
var dicomParser = (function (dicomParser) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (dicomParser === undefined) {
|
if (dicomParser === undefined) {
|
||||||
@ -239,8 +216,8 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
var dicomParser = (function (dicomParser) {
|
var dicomParser = (function (dicomParser) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if (dicomParser === undefined) {
|
if (dicomParser === undefined) {
|
||||||
@ -322,13 +299,13 @@
|
|||||||
return textResult;
|
return textResult;
|
||||||
};
|
};
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Utility functions for dealing with DICOM
|
* Utility functions for dealing with DICOM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -389,13 +366,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Utility functions for dealing with DICOM
|
* Utility functions for dealing with DICOM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -450,13 +427,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Utility functions for dealing with DICOM
|
* Utility functions for dealing with DICOM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -541,13 +518,13 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Functionality for extracting encapsulated pixel data
|
* Functionality for extracting encapsulated pixel data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -604,12 +581,15 @@
|
|||||||
|
|
||||||
// move to the start of this frame
|
// move to the start of this frame
|
||||||
var frameOffset = pixelDataElement.basicOffsetTable[frame];
|
var frameOffset = pixelDataElement.basicOffsetTable[frame];
|
||||||
|
var firstFragment = byteStream.position;
|
||||||
byteStream.seek(frameOffset);
|
byteStream.seek(frameOffset);
|
||||||
|
|
||||||
// Find the end of this frame
|
// Find the end of this frame
|
||||||
var endOfFrameOffset = pixelDataElement.basicOffsetTable[frame + 1];
|
var endOfFrameOffset = pixelDataElement.basicOffsetTable[frame + 1];
|
||||||
if(endOfFrameOffset === undefined) { // special case for last frame
|
if(endOfFrameOffset === undefined) { // special case for last frame
|
||||||
endOfFrameOffset = byteStream.position + pixelDataElement.length;
|
endOfFrameOffset = byteStream.position + pixelDataElement.length;
|
||||||
|
} else {
|
||||||
|
endOfFrameOffset += firstFragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read this frame
|
// read this frame
|
||||||
@ -690,14 +670,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing different types from a big-endian byte array
|
* Internal helper functions for parsing different types from a big-endian byte array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -865,13 +845,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions common to parsing byte arrays of any type
|
* Internal helper functions common to parsing byte arrays of any type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -918,8 +898,8 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Internal helper class to assist with parsing. Supports reading from a byte
|
* Internal helper class to assist with parsing. Supports reading from a byte
|
||||||
* stream contained in a Uint8Array. Example usage:
|
* stream contained in a Uint8Array. Example usage:
|
||||||
@ -928,8 +908,8 @@
|
|||||||
* var byteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray);
|
* var byteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray);
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1050,8 +1030,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* The DataSet class encapsulates a collection of DICOM Elements and provides various functions
|
* The DataSet class encapsulates a collection of DICOM Elements and provides various functions
|
||||||
* to access the data in those elements
|
* to access the data in those elements
|
||||||
@ -1071,8 +1051,8 @@
|
|||||||
* UT = Strip trailing spaces
|
* UT = Strip trailing spaces
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1326,13 +1306,13 @@
|
|||||||
//dicomParser.DataSet = DataSet;
|
//dicomParser.DataSet = DataSet;
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1420,13 +1400,13 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1476,13 +1456,13 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing different types from a little-endian byte array
|
* Internal helper functions for parsing different types from a little-endian byte array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1652,13 +1632,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing implicit and explicit DICOM data sets
|
* Internal helper functions for parsing implicit and explicit DICOM data sets
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1731,14 +1711,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for for parsing DICOM elements
|
* Internal helper functions for for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1821,13 +1801,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for for parsing DICOM elements
|
* Internal helper functions for for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -1894,13 +1874,82 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
|
* Parses a DICOM P10 byte array and returns a DataSet object with the parsed elements. If the options
|
||||||
|
* argument is supplied and it contains the untilTag property, parsing will stop once that
|
||||||
|
* tag is encoutered. This can be used to parse partial byte streams.
|
||||||
|
*
|
||||||
|
* @param byteArray the byte array
|
||||||
|
* @param options object to control parsing behavior (optional)
|
||||||
|
* @returns {DataSet}
|
||||||
|
* @throws error if an error occurs while parsing. The exception object will contain a property dataSet with the
|
||||||
|
* elements successfully parsed before the error.
|
||||||
|
*/
|
||||||
|
var dicomParser = (function(dicomParser) {
|
||||||
|
if(dicomParser === undefined)
|
||||||
|
{
|
||||||
|
dicomParser = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
dicomParser.readPart10Header = function(byteArray, options) {
|
||||||
|
|
||||||
|
if(byteArray === undefined)
|
||||||
|
{
|
||||||
|
throw "dicomParser.readPart10Header: missing required parameter 'byteArray'";
|
||||||
|
}
|
||||||
|
|
||||||
|
var littleEndianByteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray);
|
||||||
|
|
||||||
|
function readPrefix()
|
||||||
|
{
|
||||||
|
littleEndianByteStream.seek(128);
|
||||||
|
var prefix = littleEndianByteStream.readFixedString(4);
|
||||||
|
if(prefix !== "DICM")
|
||||||
|
{
|
||||||
|
throw "dicomParser.readPart10Header: DICM prefix not found at location 132";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// main function here
|
||||||
|
function readTheHeader() {
|
||||||
|
// Per the DICOM standard, the header is always encoded in Explicit VR Little Endian (see PS3.10, section 7.1)
|
||||||
|
// so use littleEndianByteStream throughout this method regardless of the transfer syntax
|
||||||
|
readPrefix();
|
||||||
|
|
||||||
|
var warnings = [];
|
||||||
|
var elements = {};
|
||||||
|
while(littleEndianByteStream.position < littleEndianByteStream.byteArray.length) {
|
||||||
|
var position = littleEndianByteStream.position;
|
||||||
|
var element = dicomParser.readDicomElementExplicit(littleEndianByteStream, warnings);
|
||||||
|
if(element.tag > 'x0002ffff') {
|
||||||
|
littleEndianByteStream.position = position;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Cache the littleEndianByteArrayParser for meta header elements, since the rest of the data set may be big endian
|
||||||
|
// and this parser will be needed later if the meta header values are to be read.
|
||||||
|
element.parser = dicomParser.littleEndianByteArrayParser;
|
||||||
|
elements[element.tag] = element;
|
||||||
|
}
|
||||||
|
var metaHeaderDataSet = new dicomParser.DataSet(littleEndianByteStream.byteArrayParser, littleEndianByteStream.byteArray, elements);
|
||||||
|
metaHeaderDataSet.warnings = littleEndianByteStream.warnings;
|
||||||
|
metaHeaderDataSet.position = littleEndianByteStream.position;
|
||||||
|
return metaHeaderDataSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is where we actually start parsing
|
||||||
|
return readTheHeader();
|
||||||
|
};
|
||||||
|
|
||||||
|
return dicomParser;
|
||||||
|
})(dicomParser);
|
||||||
|
|
||||||
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -2004,13 +2053,13 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -2116,13 +2165,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -2156,13 +2205,13 @@
|
|||||||
|
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Internal helper functions for parsing DICOM elements
|
* Internal helper functions for parsing DICOM elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -2190,13 +2239,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
/**
|
/**
|
||||||
* Version
|
* Version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dicomParser = (function (dicomParser)
|
var dicomParser = (function (dicomParser)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if(dicomParser === undefined)
|
if(dicomParser === undefined)
|
||||||
@ -2204,9 +2253,9 @@
|
|||||||
dicomParser = {};
|
dicomParser = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
dicomParser.version = "1.1.5";
|
dicomParser.version = "1.2.0";
|
||||||
|
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}(dicomParser));
|
}(dicomParser));
|
||||||
return dicomParser;
|
return dicomParser;
|
||||||
}));
|
}));
|
||||||
@ -9,6 +9,14 @@ function defaultHangingProtocol(inputData) {
|
|||||||
var stacks = [];
|
var stacks = [];
|
||||||
studies.forEach(function(study) {
|
studies.forEach(function(study) {
|
||||||
study.seriesList.forEach(function(series) {
|
study.seriesList.forEach(function(series) {
|
||||||
|
|
||||||
|
// Ensure that the series has image data
|
||||||
|
// (All images have rows)
|
||||||
|
var anInstance = series.instances[0];
|
||||||
|
if (!anInstance || !anInstance.rows) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var stack = {
|
var stack = {
|
||||||
series: series,
|
series: series,
|
||||||
study: study
|
study: study
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user