# Crop rotated ImageData to minimum axis aligned bounding box

**URL:** https://discourse.vtk.org/t/crop-rotated-imagedata-to-minimum-axis-aligned-bounding-box/3018
**Category:** Support
**Created:** [April 10, 2020, 9:10am UTC](https://discourse.vtk.org/t/crop-rotated-imagedata-to-minimum-axis-aligned-bounding-box/3018 "2020-04-10T09:10:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rjs44](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rjs44/32/1245_2.png) [@rjs44](https://discourse.vtk.org/u/rjs44)
#### Post date: [April 10, 2020, 9:10am UTC](https://discourse.vtk.org/t/crop-rotated-imagedata-to-minimum-axis-aligned-bounding-box/3018/1 "2020-04-10T09:10:07Z")

</div>

I have an ImageData containing an object which I have transformed (rotated) using ImageReslicer. In order for the object to still be fully visible after the rotation I have set the SetAutoCropOutput of ImageReslicer to True. However, this gives me lots of empty white space around the object, which I want to remove/crop out.

I don’t have any/much experience with VTK (started a week ago) and therefore I am looking for the (best) method to achieve this. My method right now is to find the minimum axis aligned bounding box (AABB) which I can get by using the OutlineFilter applied to the contour of the rotated object.

The problem is that I do not know how to transfer the information given by the OutlineFilter to a so called extent, which can be used as input parameters for ExtractVoi’s SetVOI. Any help is appreciated.

---

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [November 3, 2020, 3:38am UTC](https://discourse.vtk.org/t/crop-rotated-imagedata-to-minimum-axis-aligned-bounding-box/3018/2 "2020-11-03T03:38:57Z")

</div>

I meet the same problem recently. Have you solved it?
