# ResliceCursor State management

**URL:** https://discourse.paraview.org/t/reslicecursor-state-management/9808
**Category:** Web Support
**Tags:** vtkjs
**Created:** [June 14, 2022, 2:04pm UTC](https://discourse.paraview.org/t/reslicecursor-state-management/9808 "2022-06-14T14:04:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mayukhdeep\_Mathur](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mayukhdeep\_Mathur](https://discourse.paraview.org/u/Mayukhdeep_Mathur)
#### Post date: [June 14, 2022, 2:04pm UTC](https://discourse.paraview.org/t/reslicecursor-state-management/9808/1 "2022-06-14T14:04:40Z")

</div>

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.

```auto
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**?

---

<div class="post-metadata">

### Author: ![Forrest\_Li](https://discourse.paraview.org/user_avatar/discourse.paraview.org/forrest_li/32/1935_2.png) [@Forrest\_Li](https://discourse.paraview.org/u/Forrest_Li)
#### Post date: [June 14, 2022, 5:07pm UTC](https://discourse.paraview.org/t/reslicecursor-state-management/9808/2 "2022-06-14T17:07:53Z")

</div>

`setCroppingPlanes` is a method on the CropWidget state, so it’s specific to the crop widget.

I would assume you would need to call UpdateReslicePlane. You can also look [at the example code](https://github.com/Kitware/vtk-js/blob/master/Sources/Widgets/Widgets3D/ResliceCursorWidget/example/index.js#L251) to see if there’s anything else you will need.
