<div dir="ltr"><div><div><div><div><div>Hello guys,<br><br></div>I need help on image rotation. I have two questions:<br><br></div>1 - how can I modify the code in ResampleImageFilter4.cxx to make the size of the output image following the rotation? More specifically: if image size is Size X >> Size Y and I want a 90° rotation the result (using the code in the example without modifications) is cropped because the new image has now Size Y >> Size X but in the example this is not taken into account. I know I could use Permute Axis but I would like to write something that works both for 90 and 180 degrees rotations. <br>
<br></div>2 - I would like to do something like in the scheme attached. Actually, as shown I've reached my goal only partially using AutoCropLabelMapFilter. There is a simple way of doing what I want or I have to compute the angle of inclination of my region of interest and rotate and crop accordingly? Images are not binary!<br>
<br></div>Thanks in advance!<br><br></div>Elena<br></div>