chore(prettier): full repo linting and code reformatting once and for all (#3627)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-01 16:19:39 -04:00
1 parent 01500a2d4c
commit 9045ddaedc
656 files changed
+21737 -20628

No files matched your search

@@ -11,11 +11,7 @@
* @returns Array view containing the palette data, or a promise to return one.
* Returns undefined if the palette data is absent.
*/
export default function fetchPaletteColorLookupTableData(
item,
tag,
descriptorTag
) {
export default function fetchPaletteColorLookupTableData(item, tag, descriptorTag) {
const { PaletteColorLookupTableUID } = item;
const paletteData = item[tag];
if (paletteData === undefined && PaletteColorLookupTableUID === undefined) {
@@ -55,19 +51,12 @@ function _getPaletteColor(paletteColorLookupTableData, lutDescriptor) {
if (paletteColorLookupTableData.InlineBinary) {
try {
const arraybuffer = Uint8Array.from(
atob(paletteColorLookupTableData.InlineBinary),
c => c.charCodeAt(0)
const arraybuffer = Uint8Array.from(atob(paletteColorLookupTableData.InlineBinary), c =>
c.charCodeAt(0)
);
return (paletteColorLookupTableData.palette = arrayBufferToPaletteColorLUT(
arraybuffer
));
return (paletteColorLookupTableData.palette = arrayBufferToPaletteColorLUT(arraybuffer));
} catch (e) {
console.log(
"Couldn't decode",
paletteColorLookupTableData.InlineBinary,
e
);
console.log("Couldn't decode", paletteColorLookupTableData.InlineBinary, e);
return undefined;
}
}
@@ -75,12 +64,7 @@ function _getPaletteColor(paletteColorLookupTableData, lutDescriptor) {
if (paletteColorLookupTableData.retrieveBulkData) {
return paletteColorLookupTableData
.retrieveBulkData()
.then(
val =>
(paletteColorLookupTableData.palette = arrayBufferToPaletteColorLUT(
val
))
);
.then(val => (paletteColorLookupTableData.palette = arrayBufferToPaletteColorLUT(val)));
}
console.error(`No data found for ${paletteColorLookupTableData} palette`);
@@ -48,11 +48,7 @@ export default function getPixelSpacingInformation(instance) {
type: TYPES.UNKNOWN,
isProjection,
};
} else if (
PixelSpacing &&
ImagerPixelSpacing &&
PixelSpacing === ImagerPixelSpacing
) {
} else if (PixelSpacing && ImagerPixelSpacing && PixelSpacing === ImagerPixelSpacing) {
// If Imager Pixel Spacing and Pixel Spacing are present and they have the same values,
// then the user should be informed that the measurements are at the detector plane
return {
@@ -60,11 +56,7 @@ export default function getPixelSpacingInformation(instance) {
type: TYPES.DETECTOR,
isProjection,
};
} else if (
PixelSpacing &&
ImagerPixelSpacing &&
PixelSpacing !== ImagerPixelSpacing
) {
} else if (PixelSpacing && ImagerPixelSpacing && PixelSpacing !== ImagerPixelSpacing) {
// If Imager Pixel Spacing and Pixel Spacing are present and they have different values,
// then the user should be informed that these are "calibrated"
// (in some unknown manner if Pixel Spacing Calibration Type and/or
@@ -95,10 +87,7 @@ export default function getPixelSpacingInformation(instance) {
PixelSpacing: CorrectedImagerPixelSpacing,
isProjection,
};
} else if (
SequenceOfUltrasoundRegions &&
typeof SequenceOfUltrasoundRegions === 'object'
) {
} else if (SequenceOfUltrasoundRegions && typeof SequenceOfUltrasoundRegions === 'object') {
const { PhysicalDeltaX, PhysicalDeltaY } = SequenceOfUltrasoundRegions;
const USPixelSpacing = [PhysicalDeltaX * 10, PhysicalDeltaY * 10];
@@ -5,8 +5,7 @@ export default function unpackOverlay(arrayBuffer) {
for (let byteIndex = 0; byteIndex < byteArray.length; byteIndex++) {
const bitIndex = byteIndex % 8;
const bitByteIndex = Math.floor(byteIndex / 8);
byteArray[byteIndex] =
1 * ((bitArray[bitByteIndex] & (1 << bitIndex)) >> bitIndex);
byteArray[byteIndex] = 1 * ((bitArray[bitByteIndex] & (1 << bitIndex)) >> bitIndex);
}
return byteArray;