Skip to content

Commit

Permalink
Improve location inforation
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbinian Eckstein committed Feb 2, 2024
1 parent 338759c commit 8324488
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion niivue/src/components/NiiVueCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,13 @@ function setIntensityAndLocation(data: any, intensity: Signal<string>, location:
if (parts.length === 2) {
intensity.value = parts.pop()
}
location.value = parts.pop()
location.value = `${arrayToString(data.mm)} mm | Grid: ${arrayToString(data.vox, 0)}`
}

function arrayToString(array: number[], precision = 2) {
let str = ''
for (const val of array) {
str += val.toFixed(precision) + ' x '
}
return str.slice(0, -3)
}

0 comments on commit 8324488

Please sign in to comment.