Skip to content

Commit

Permalink
fixed zarr rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Nov 7, 2024
1 parent 728c096 commit c8d5a8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export type ZarrAttrs = {
axes: {
name: "x" | "y" | "z" | string
type: "space" | string
units: "micrometer" | string
unit: "micrometer" | string
}[]
datasets: {
coordinateTransformations: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/state/inputs/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const incInfoPipe = pipe(
if (axes.length !== 3) {
return throwError(() => new Error(`Can only deal with axes with length 3`))
}
for (const { type, units } of axes){
for (const { type } of axes){
if (type !== "space") {
return throwError(() => new Error(`Can only deal with space axes`))
}
Expand Down Expand Up @@ -175,7 +175,7 @@ export const incVoxelSize = pipe(
const dataset = datasets[0]
const { scale, shape } = dataset
return (scale as number[]).map((v, idx: number) => {
const unit = axes[idx].units
const unit = axes[idx].unit
if (!(unit in cvtToNm)) {
console.warn(`${unit} cannot be converted. Using 1 as default`)
return 1
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/state/outputs/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class Effects {
const { mat4, vec3, quat } = export_nehuba;
const { processQuatInput } = consts;



const rotQuat = processQuatInput(input)

const axis = vec3.fromValues(1, 0, 0)
Expand All @@ -43,7 +45,7 @@ export class Effects {

const centralizeMatrix = mat4.fromTranslation(mat4.create(), centerVoxel.map(v => v * -1))
const decentralizeMatrix = mat4.fromTranslation(mat4.create(), centerVoxel)

console.log(centerVoxel, centralizeMatrix, decentralizeMatrix)
mat4.mul(xformMat, centralizeMatrix, xformMat)

mat4.mul(
Expand Down

0 comments on commit c8d5a8a

Please sign in to comment.