# Fill Slice Views without Changing Image Spacing

**URL:** <https://discourse.slicer.org/t/fill-slice-views-without-changing-image-spacing/8382>\
**Category:** Support\
**Created:** [September 11, 2019, 2:45pm UTC](https://discourse.slicer.org/t/fill-slice-views-without-changing-image-spacing/8382 "2019-09-11T14:45:35Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [October 1, 2021, 4:26pm UTC](https://discourse.slicer.org/t/fill-slice-views-without-changing-image-spacing/8382/14 "2021-10-01T16:26:15Z")

</div>

@lassoan, I’ve looked into the FOV resetting and found that the vtkMRMLSliceLogic is checking the aspect ratio of the window against the pane AR [here](https://github.com/Slicer/Slicer/blob/1b21b7208594f3b6c1ed387ae648c3e9d757f1d0/Libs/MRML/Logic/vtkMRMLSliceLogic.cxx#L1778)

How do you feel about the following modification proposal?

```cpp
  double windowAspect = (newWidth != 0. ? newHeight / newWidth : 1.);
  double planeAspect = (newFOV[0] != 0. ? newFOV[1] / newFOV[0] : 1.);
  double oldWindowAspect = (oldDimensions[0] != 0. ? oldDimensions[1] / oldDimensions[0] : 1.);
  double oldPlaneAspect = (oldFOV[0] != 0. ? oldFOV[1] / oldFOV[0] : 1.);
  if (windowAspect != planeAspect && oldWindowAspect == oldPlaneAspect)
    {
    newFOV[0] = (windowAspect != 0. ? newFOV[1] / windowAspect : newFOV[0]);
    }

```

This way the newFOV is corrected only if the user/dev did not change the aspect ratio of the slice view. If the aspect ratio is custom, there is no correction of the AR. While on a custom AR, if the user clicks center to volume on sliceviewcontroller, the AR returns to the original one.  
I find it minimally invasive and it keeps the current behavior for the standard not distorted AR. If you think is a good idea I can open a PR for this.  
This fix does not perform the behavior I want for the use case above, but the changes I need to apply to the FOV are less dramatic, improving the overall user experience.  
Thank you very much.

---

_[View the full topic](https://discourse.slicer.org/t/fill-slice-views-without-changing-image-spacing/8382)._
