Conversation
98c8958 to
c3c878d
Compare
c3c878d to
e9b9184
Compare
|
@manzt I just tried this with I'm guessing that the Z translation moves the image out of the visible plane and that moving the Z slider doesn't help as its not really 3D viewing? |
|
I see, I just swapped in your implementation for export function coordinateTransformationsToMatrix(multiscales: Array<Ome.Multiscale>): Matrix4 {
let matrix = new Matrix4().identity();
let scaleX = undefined;
let scaleY = undefined;
let dx = undefined;
let dy = undefined;
const coordinateTransformations = multiscales[0].datasets[0]?.coordinateTransformations;
if (coordinateTransformations !== undefined) {
for (const transform of coordinateTransformations) {
if (transform.type === "scale" && transform.scale !== undefined) {
scaleX = transform.scale.at(-1);
scaleY = transform.scale.at(-2);
}
if (transform.type === "translation" && transform.translation !== undefined) {
dx = transform.translation.at(-1);
dy = transform.translation.at(-2);
}
}
}
// Deck.gl translate happens BEFORE scale (opposite of OME-Zarr)
if (dx !== undefined && dy !== undefined) {
// NB: we don't handle the Z translation
matrix.translate([dx, dy, 0]);
}
if (scaleX !== undefined && scaleY !== undefined) {
// NB: we don't handle the Z scale
matrix.scale([scaleX, scaleY, 1]);
}
return matrix;
}
|
|
My implementation was a bit naive in that it simply ignored any Z values for scale and transformation. So it "worked" with translating X and Y in my example. |


Cherry picked changed from #242. There was a pretty substantial refactor of state to make it more consistent and type safe.