# vtk BoxWidget coordinates

**URL:** <https://discourse.vtk.org/t/vtk-boxwidget-coordinates/6572>\
**Category:** Development\
**Created:** [September 7, 2021, 6:05pm UTC](https://discourse.vtk.org/t/vtk-boxwidget-coordinates/6572 "2021-09-07T18:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ana\_Margarida\_Mota](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ana_margarida_mota/32/1287_2.png) [@Ana\_Margarida\_Mota](https://discourse.vtk.org/u/Ana_Margarida_Mota)\
**Post date:** [September 7, 2021, 6:05pm UTC](https://discourse.vtk.org/t/vtk-boxwidget-coordinates/6572/1 "2021-09-07T18:05:06Z")

</div>

Hello!  
I define boxWidget-\>PlaceWidget(xmin, xmax, ymin, ymax, zmin, zmax).  
Than, When I try to “read” again the same coordinates, the values are completely different and I can’t understand why…? I am sending here part of the code about this issue (0.085 is the pixel size). Could someone please help me?

**(…)**

_vtkBoxWidget boxWidget = vtkBoxWidget::New();_\*  
\*\* boxWidget-\>SetInteractor(rendWindInt);\*\*  
\*\* boxWidget-\>SetProp3D(volume1);\*\*  
\*\* boxWidget-\>PlaceWidget(0, 857 \* 0.085, 0, 883 \* 0.085, 0, 32);\*\*  
\*\* boxWidget-\>SetPlaceFactor(1);\*\*

\*\* renderWindow-\>SetSize(1000, 600);\*\*  
\*\* rendWindInt-\>Initialize();\*\*  
\*\* boxWidget-\>On();\*\*  
\*\* rendWindInt-\>Start();\*\*

**vtkSmartPointer pd = vtkSmartPointer::New();**  
\*\* boxWidget-\>GetPolyData(pd);\*\*  
\*\* double\* bound = pd-\>GetBounds(); \*\*

\*\* double boundXmin = floor(bound[0] / x\_voxelsize);\*\*  
\*\* double boundXmax = floor(bound[1] / x\_voxelsize);\*\*  
\*\* double boundYmin = floor(bound[2] / y\_voxelsize);\*\*  
\*\* double boundYmax = floor(bound[3] / y\_voxelsize);\*\*  
\*\* double boundZmin = floor(bound[4] / z\_voxelsize);\*\*  
\*\* double boundZmax = floor(bound[5] / z\_voxelsize);\*\*

**(…)**

**I was expecting that boundXmin = 0, boundXmax = 857 \* 0.085, boundYmin = 0, boundYmax = 883 \* 0.085, boundZmin = 0, boundZmax = 32.**  
**But instead, I obtained:**  
**boundXmin = 214, boundXmax = 642**  
**boundYmin = 220, boundYmax = 662**  
**boundZmin = 8, boundZmax = 24**

Any help??
