Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const numLutEntries = lutDescriptor[0];
const bits = lutDescriptor[2];
let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server);
// TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
// incorrect bulk data URIs
if (server.wadoRoot.indexOf('https') === 0 && !uri.includes('https')) {
uri = uri.replace('http', 'https');
}
const config = {
url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
headers: DICOMWeb.getAuthorizationHeader(server),
};
const dicomWeb = new api.DICOMwebClient(config);
const options = {
BulkDataURI: uri,
};
const readUInt16 = (byteArray, position) => {
return byteArray[position] + byteArray[position + 1] * 256;
};
const arrayBufferToPaletteColorLUT = result => {
const arraybuffer = result[0]
const byteArray = new Uint8Array(arraybuffer)
const lut = []
for (let i = 0; i < numLutEntries; i++) {
if (bits === 16) {
lut[i] = readUInt16(byteArray, i * 2);
getClient(url) {
const headers = this.retrieveAuthHeaderFunc();
// TODO: a bit weird we are creating a new dicomweb client instance for every upload
return new api.DICOMwebClient({
url,
headers
});
}
}
const numLutEntries = lutDescriptor[0];
const bits = lutDescriptor[2];
let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server);
// TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
// incorrect bulk data URIs
if (server.wadoRoot.indexOf('https') === 0 && !uri.includes('https')) {
uri = uri.replace('http', 'https');
}
const config = {
url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
headers: DICOMWeb.getAuthorizationHeader(server),
};
const dicomWeb = new api.DICOMwebClient(config);
const options = {
BulkDataURI: uri,
};
const readUInt16 = (byteArray, position) => {
return byteArray[position] + byteArray[position + 1] * 256;
};
const arrayBufferToPaletteColorLUT = result => {
const arraybuffer = result[0];
const byteArray = new Uint8Array(arraybuffer);
const lut = [];
for (let i = 0; i < numLutEntries; i++) {
if (bits === 16) {
lut[i] = readUInt16(byteArray, i * 2);
OHIF.studies.services.QIDO.Instances = function(server, studyInstanceUid) {
// TODO: Are we using this function anywhere?? Can we remove it?
const config = {
url: server.qidoRoot,
headers: OHIF.DICOMWeb.getAuthorizationHeader()
};
const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
const queryParams = getQIDOQueryParams(filter, server.qidoSupportsIncludeField);
const options = {
studyInstanceUID: studyInstanceUid
};
return dicomWeb.searchForInstances(options).then(result => {
return {
wadoUriRoot: server.wadoUriRoot,
studyInstanceUid: studyInstanceUid,
seriesList: resultDataToStudyMetadata(server, studyInstanceUid, result.data)
};
});
};
const bits = lutDescriptor[2];
let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server)
// TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
// incorrect bulk data URIs
if (server.wadoRoot.indexOf('https') === 0 &&
!uri.includes('https')) {
uri = uri.replace('http', 'https');
}
const config = {
url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
headers: OHIF.DICOMWeb.getAuthorizationHeader()
};
const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
const options = {
BulkDataURI: uri
};
const readUInt16 = (byteArray, position) => {
return byteArray[position] + (byteArray[position + 1] * 256);
}
const arrayBufferToPaletteColorLUT = (arraybuffer) =>{
const byteArray = new Uint8Array(arraybuffer);
const lut = [];
for (let i = 0; i < numLutEntries; i++) {
if (bits === 16) {
lut[i] = readUInt16(byteArray, i * 2);
} else {
export default function Instances(server, studyInstanceUid) {
// TODO: Are we using this function anywhere?? Can we remove it?
const config = {
url: server.qidoRoot,
headers: OHIF.DICOMWeb.getAuthorizationHeader()
};
const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
const queryParams = getQIDOQueryParams(filter, server.qidoSupportsIncludeField);
const options = {
studyInstanceUID: studyInstanceUid
};
return dicomWeb.searchForInstances(options).then(result => {
return {
wadoUriRoot: server.wadoUriRoot,
studyInstanceUid: studyInstanceUid,
seriesList: resultDataToStudyMetadata(server, studyInstanceUid, result.data)
};
});
};
const tileLoadFunction = (tile, src) => {
if (src !== null) {
const studyInstanceUID = DICOMwebClient.utils.getStudyInstanceUIDFromUri(src);
const seriesInstanceUID = DICOMwebClient.utils.getSeriesInstanceUIDFromUri(src);
const sopInstanceUID = DICOMwebClient.utils.getSOPInstanceUIDFromUri(src);
const frameNumbers = DICOMwebClient.utils.getFrameNumbersFromUri(src);
const img = tile.getImage();
if (options.retrieveRendered) {
const mediaType = 'image/png';
const retrieveOptions = {
studyInstanceUID,
seriesInstanceUID,
sopInstanceUID,
frameNumbers,
mediaTypes: [{ mediaType }]
};
options.client.retrieveInstanceFramesRendered(retrieveOptions).then((renderedFrame) => {
const blob = new Blob([renderedFrame], {type: mediaType});
img.src = window.URL.createObjectURL(blob);
});
} else {
// TODO: support "image/jp2" and "image/jls"
configLoad() {
const { server } = this;
const client = new api.DICOMwebClient({
url: server.qidoRoot,
headers: DICOMWeb.getAuthorizationHeader(server),
});
this.client = client;
}
async preLoad() {
function createStudyImageIds(baseUrl, studySearchOptions) {
const SOP_INSTANCE_UID = '00080018';
const SERIES_INSTANCE_UID = '0020000E';
const client = new dicomwebClientApi.DICOMwebClient({ url });
return new Promise((resolve, reject) => {
client.retrieveStudyMetadata(studySearchOptions).then(instances => {
const imageIds = instances.map(metaData => {
const imageId =
`wadors:` +
baseUrl +
'/studies/' +
studyInstanceUID +
'/series/' +
metaData[SERIES_INSTANCE_UID].Value[0] +
'/instances/' +
metaData[SOP_INSTANCE_UID].Value[0] +
'/frames/1';
cornerstoneWADOImageLoader.wadors.metaDataManager.add(
async function searchStudySeries(server, studyInstanceUID) {
const dicomWeb = new api.DICOMwebClient({
url: server.qidoRoot,
headers: DICOMWeb.getAuthorizationHeader(server),
});
const seriesList = await dicomWeb.searchForSeries({ studyInstanceUID });
return seriesList
.sort(seriesSortingCriteria)
.map(series => getSeriesInfo(series).seriesInstanceUid);
}