Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/viewer/src/components/CostMatrixComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import {

function getMatchingResultInZoomBlock(
results: MatchingResultElement[],
zoomParams: ZoomBlockParams
zoomParams: ZoomBlockParams,
) {
return results.filter(
(result) =>
result.queryId >= zoomParams.topLeftY &&
result.queryId < zoomParams.topLeftY + zoomParams.windowHeightPx &&
result.refId >= zoomParams.topLeftX &&
result.refId < zoomParams.topLeftX + zoomParams.windowWidthPx
result.refId < zoomParams.topLeftX + zoomParams.windowWidthPx,
);
}

Expand Down Expand Up @@ -70,7 +70,7 @@ function CostMatrixComponent(props: CostMatrixProps): React.ReactElement {
}
readProtoFromFile(
props.matchingResultProtoFile,
ProtoMessageType.MatchingResult
ProtoMessageType.MatchingResult,
)
.then((matchingResultProto) => {
setMatchingResult(readMatchingResultFromProto(matchingResultProto));
Expand All @@ -88,8 +88,8 @@ function CostMatrixComponent(props: CostMatrixProps): React.ReactElement {
costMatrix.getSubMatrix(
zoomParams.topLeftX,
zoomParams.topLeftY,
zoomParams.windowHeightPx
)
zoomParams.windowHeightPx,
),
);
}, [zoomParams, costMatrix]);

Expand Down Expand Up @@ -132,7 +132,7 @@ function CostMatrixComponent(props: CostMatrixProps): React.ReactElement {
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "center",
backgroundColor: "ghostwhite"
backgroundColor: "ghostwhite",
}}
>
<div>
Expand Down
4 changes: 3 additions & 1 deletion src/viewer/src/components/DataLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function DataLoader(props: DataLoaderProps): React.ReactElement {
const files = Array.from(fileList);

const costMatrixProtoFile = files.find((file) => {
return file.webkitRelativePath.split("/")[1].endsWith(".CostMatrix.pb");
return file.webkitRelativePath
.split("/")[1]
.endsWith(".SimilarityMatrix.pb");
});
if (costMatrixProtoFile == null) {
console.warn("CostMatrix proto file was not found");
Expand Down
6 changes: 3 additions & 3 deletions src/viewer/src/resources/readers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function readImageAsync(file: Blob) {
}

enum ProtoMessageType {
CostMatrix = "CostMatrix",
CostMatrix = "SimilarityMatrix",
MatchingResult = "MatchingResult",
}

Expand Down Expand Up @@ -52,7 +52,7 @@ async function readProtoFromFile(file: File, messageType: ProtoMessageType) {
}
let protoMessage = await readProtoFromBuffer(
new Uint8Array(contentBuffer),
"image_sequence_localizer." + messageType.toString()
"image_sequence_localizer." + messageType.toString(),
);
console.log("Read proto message", protoMessage);
return protoMessage;
Expand All @@ -68,7 +68,7 @@ type MatchingResultElement = {
};

function readMatchingResultFromProto(
matchingResultProto?: any
matchingResultProto?: any,
): MatchingResultElement[] | undefined {
if (matchingResultProto == null) {
return undefined;
Expand Down
Loading