# custom output extent and spacing in vtkImagePlaneWidget

**URL:** https://discourse.vtk.org/t/custom-output-extent-and-spacing-in-vtkimageplanewidget/9039
**Category:** Support
**Created:** [July 29, 2022, 2:41am UTC](https://discourse.vtk.org/t/custom-output-extent-and-spacing-in-vtkimageplanewidget/9039 "2022-07-29T02:41:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gregthom992](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gregthom992/32/7988_2.png) [@gregthom992](https://discourse.vtk.org/u/gregthom992)
#### Post date: [July 29, 2022, 2:41am UTC](https://discourse.vtk.org/t/custom-output-extent-and-spacing-in-vtkimageplanewidget/9039/1 "2022-07-29T02:41:30Z")

</div>

hi, I am using vtkImagePlaneWidget because it has the window leveling, cursor and text display all bundled in. However, I have a question, is there a way to make the vtkImagePlaneWidget output a specific size and resolution ?  
I have access to a GetReslice() method on the vtkImagePlaneWidget but doing something like the below did not wok:

```
  double[] sp = new double[] { 0.4, 0.4, 0.4 };
  int dimX = 400;
  int dimY = 500;

```

> planeWidget.GetReslice().SetOutputSpacing(sp[0], sp[1], sp[2]);  
> planeWidget.GetReslice().SetOutputExtent(0, dimX-1, 0, dimY-1, 0, 0);  
> planeWidget.GetReslice().SetOutputOrigin( - 0.5\*(dimX - 1) \* sp[0], - 0.5 \* (dimY - 1) \* sp[1], 0.0);

Any idea on how I can make the output extent, spacing and origin of the imagePlaneWidget to what I want such as the above rather than the extent being fixed by the input data extent ?

Thanks

GT
