I implemented state management for ResliceCursorWidget within the Glance codebase.I made changes to the src/store/Widgets.js file, and the code now looks like this.
export default ({ proxyManager }) => ({
// reslice
resliceStates: {}, // dataset id -> reslice state
}
mutations: {
setResliceState(state, { datasetId, data }) {
state.resliceStates[datasetId] = Array.from(data);
},
rewriteProxyIds(state, { sources: idMapping }) {
state.resliceStates = remapIdKeys(state.resliceStates, idMapping);
}
}
..........
actions: {
setResliceState: wrapMutationAsAction('setResliceState'), //Reslice State
...
pxmProxyCreated: {
root: true,
handler({ state }, { proxy, proxyId }) {
if (proxyId in state.resliceStates) {
const data = state.resliceStates[proxyId];
const filter = getCropFilter(proxyManager, proxy);
if (filter) {
filter.setResliceData(data);
}
}
},
},
},
I’m confused because setCroppingPlanes
is displayed in the crop widget in the pxmProxyCreated
.
I searched the CropWidget documentation but found nothing similar to setCroppingPlanes
. Now that Reslice is available, I’m wondering what will replace setCroppingPlanes
in Reslice. Will it be UpdateReslicePlane?