0

我正在创建 DICOM web 的实现并将 vanilla OHIF 查看器指向它。UI 中发生的一些事情会阻止任何测量值保存在 OHIF 查看器中。因此,在 dicom web 与它有任何关系之前,我在 javascript 中遇到了查看器本身的问题。我收到这些错误:

DevTools failed to load source map: Could not parse content for http://localhost:8800/index.umd.js.map: Unexpected token < in JSON at position 0

Failed to map 'CornerstoneTools@4' measurement for definition stack: Cannot read property 'toMeasurementSchema' of undefined

Failed to map 'CornerstoneTools@4' measurement for definition stackPrefetch: Cannot read property 'toMeasurementSchema' of undefined

toMeasurementSchema 问题发生在 OHIF 的函数中,定义如下:

function addOrUpdate(source, definition, sourceMeasurement) {
    if (!this._isValidSource(source)) {
        log["a" /* default */].warn('Invalid source. Exiting early.');
        return;
    }

    var sourceInfo = this._getSourceInfo(source);

    if (!definition) {
        console.log('TEST');
        log["a" /* default */].warn('No source definition provided. Exiting early.');
        return;
    }

    if (!this._sourceHasMappings(source)) {
        log["a" /* default */].warn("No measurement mappings found for '".concat(sourceInfo, "' source. Exiting early."));
        return;
    }

    var measurement = {};

    try {
        var sourceMappings = this.mappings[source.id];

        var _sourceMappings$find = sourceMappings.find(function (mapping) {
            return mapping.definition === definition;
        }),
        toMeasurementSchema = _sourceMappings$find.toMeasurementSchema;
        /* Convert measurement */

        measurement = toMeasurementSchema(sourceMeasurement);
        /* Assign measurement source instance */

        measurement.source = source;
    } catch (error) {
        log["a" /* default */].warn("Failed to map '".concat(sourceInfo, "' measurement for definition ").concat(definition, ":"), error.message);
        return;
    }

    if (!this._isValidMeasurement(measurement)) {
        log["a" /* default */].warn("Attempting to add or update a invalid measurement provided by '".concat(sourceInfo, "'. Exiting early."));
        return;
    }

    var internalId = sourceMeasurement.id;

    if (!internalId) {
        internalId = Object(guid["a" /* default */])();
        log["a" /* default */].warn("Measurement ID not found. Generating UID: ".concat(internalId));
    }

    var newMeasurement = _objectSpread({}, measurement, {
        modifiedTimestamp: Math.floor(Date.now() / 1000),
        id: internalId
    });

    if (this.measurements[internalId]) {
        log["a" /* default */].info("Measurement already defined. Updating measurement.", newMeasurement);
        this.measurements[internalId] = newMeasurement;

        this._broadcastChange(this.EVENTS.MEASUREMENT_UPDATED, source, newMeasurement);
    } else {
        log["a" /* default */].info("Measurement added.", newMeasurement);
        this.measurements[internalId] = newMeasurement;

        this._broadcastChange(this.EVENTS.MEASUREMENT_ADDED, source, newMeasurement);
    }

    return newMeasurement.id;
  }

我在想我错过了设置中的一些东西?提前致谢!

4

0 回答 0