How to use the loglevelnext.warn function in loglevelnext

To help you get started, we’ve selected a few loglevelnext 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 dcmjs-org / dcmjs / src / normalizers.js View on Github external
let distance = ImageNormalizer.vec3Dot(positionVector, scanAxis);
            distanceDatasetPairs.push([distance, dataset]);
        });
        distanceDatasetPairs.sort(function(a, b) {
            return b[0] - a[0];
        });

        // assign array buffers
        if (ds.BitsAllocated !== 16) {
            log.error(
                "Only works with 16 bit data, not " +
                    String(this.dataset.BitsAllocated)
            );
        }
        if (referenceDataset._vrMap && !referenceDataset._vrMap.PixelData) {
            log.warn("No vr map given for pixel data, using OW");
            ds._vrMap = { PixelData: "OW" };
        } else {
            ds._vrMap = { PixelData: referenceDataset._vrMap.PixelData };
        }
        let frameSize = referenceDataset.PixelData.byteLength;
        ds.PixelData = new ArrayBuffer(ds.NumberOfFrames * frameSize);
        let frame = 0;
        distanceDatasetPairs.forEach(function(pair) {
            let dataset = pair[1];
            let pixels = new Uint16Array(dataset.PixelData);
            let frameView = new Uint16Array(
                ds.PixelData,
                frame * frameSize,
                frameSize / 2
            );
            try {
github dcmjs-org / dcmjs / src / DicomMetaDictionary.js View on Github external
vr.maxLength
                                }`
                            );
                            return value.slice(0, vr.maxLength);
                        } else {
                            return value;
                        }
                    });
                }

                var tag = DicomMetaDictionary.unpunctuateTag(entry.tag);
                unnaturalDataset[tag] = dataItem;
            } else {
                const validMetaNames = ["_vrMap", "_meta"];
                if (validMetaNames.indexOf(name) == -1) {
                    log.warn(
                        "Unknown name in dataset",
                        name,
                        ":",
                        dataset[name]
                    );
                }
            }
        });
        return unnaturalDataset;
github dcmjs-org / dcmjs / src / adapters / Cornerstone / Segmentation_4X.js View on Github external
const pixelData = new Uint8Array(multiframe.PixelData);

    const max = multiframe.MaximumFractionalValue;
    const onlyMaxAndZero =
        pixelData.find(element => element !== 0 && element !== max) ===
        undefined;

    if (!onlyMaxAndZero) {
        log.warn(
            "This is a fractional segmentation, which is not currently supported."
        );
        return;
    }

    log.warn(
        "This segmentation object is actually binary... processing as such."
    );

    return pixelData;
}
github dcmjs-org / dcmjs / src / adapters / Cornerstone / Segmentation_4X.js View on Github external
function unpackPixelData(multiframe) {
    const segType = multiframe.SegmentationType;

    if (segType === "BINARY") {
        return BitArray.unpack(multiframe.PixelData);
    }

    const pixelData = new Uint8Array(multiframe.PixelData);

    const max = multiframe.MaximumFractionalValue;
    const onlyMaxAndZero =
        pixelData.find(element => element !== 0 && element !== max) ===
        undefined;

    if (!onlyMaxAndZero) {
        log.warn(
            "This is a fractional segmentation, which is not currently supported."
        );
        return;
    }

    log.warn(
        "This segmentation object is actually binary... processing as such."
    );

    return pixelData;
}
github dcmjs-org / dcmjs / src / DicomMetaDictionary.js View on Github external
dataItem.Value = dataItem.Value.map(value => {
                        if (value.length > vr.maxLength) {
                            log.warn(
                                `Truncating value ${value} of ${naturalName} because it is longer than ${
                                    vr.maxLength
                                }`
                            );
                            return value.slice(0, vr.maxLength);
                        } else {
                            return value;
                        }
                    });
                }

loglevelnext

A modern logging library for Node.js and modern browsers that provides log level mapping to the console

MPL-2.0
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis