# SimpleITK, ResampleImageFilter for orthogonal views of MRI data

**URL:** https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878
**Category:** Beginner Questions
**Created:** [May 14, 2019, 1:44pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878 "2019-05-14T13:44:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![TanjaIvanovska](https://discourse.itk.org/user_avatar/discourse.itk.org/tanjaivanovska/32/885_2.png) [@TanjaIvanovska](https://discourse.itk.org/u/TanjaIvanovska)
#### Post date: [May 14, 2019, 1:44pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/1 "2019-05-14T13:44:50Z")

</div>

Dear All,  
i have the following question:  
i have an MRI dataset and would like to compute the other two orthogonal projections of that dataset. If i understand correctly, ResampleImageFilter should do what i need. But i have a problem with parameter settings.

For instance, my dataset was taken in a sagittal view and its parameters are:

origin: (35.82217025756836, -281.53106689453125, -45.62310028076172)  
size: (448, 448, 15)  
spacing: (1.1160714626312, 1.1160714626312, 4.4000020027160645)  
direction: (4.5691251730000336e-05, -0.0034908494453999993, -0.9999939059226608, 0.9999999989561548, 1.5929806359999996e-07, 4.569097404107829e-05, -2.0321856580351833e-10, -0.9999939069664997, 0.0034908494490346205)  
pixel type: 16-bit unsigned integer  
number of pixel components: 1

Now i want to get the **coronal and axial** views for this dataset to process them separately.  
It is clear how to define the new size and new spacing for coronal and axial views, but i  
do not understand how to get the correct origin and direction vectors. If i copy them from the original image (which is wrong, of course), the result is wrong as expected. But how to compute them?  
Thank you!

Thank you.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [May 14, 2019, 2:04pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/2 "2019-05-14T14:04:56Z")

</div>

Welcome to the community Tanja!

To get orthogonal views, it is best to use [OrientImageFilter](https://itk.org/Doxygen/html/classitk_1_1OrientImageFilter.html). It does not introduce lossy resampling step, and you don’t have to worry about spacing.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [May 14, 2019, 2:18pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/3 "2019-05-14T14:18:25Z")

</div>

Hello TanjaIvanovska,

While SimpleITK does not have the OrientImageFilter. This ITK filter simply uses the PermuteAxesImageFilter and the FlipImageFilter to perform the desire re-orientation:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/6938c77a5524ec8c94396610ee9263677643092f/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx#L158-L179>

---

<div class="post-metadata">

### Author: ![TanjaIvanovska](https://discourse.itk.org/user_avatar/discourse.itk.org/tanjaivanovska/32/885_2.png) [@TanjaIvanovska](https://discourse.itk.org/u/TanjaIvanovska)
#### Post date: [May 15, 2019, 10:40am UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/4 "2019-05-15T10:40:37Z")

</div>

Thank you! The combination of PermuteFilter and FlipFilter worked out as expected!!

---

<div class="post-metadata">

### Author: ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)
#### Post date: [December 13, 2019, 1:47pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/5 "2019-12-13T13:47:01Z")

</div>

Hi tanja,

I need a MRI dataset for a program similar to yours, could you direct me where I can get couple of sets.

Regards,  
sag

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [December 13, 2019, 2:24pm UTC](https://discourse.itk.org/t/simpleitk-resampleimagefilter-for-orthogonal-views-of-mri-data/1878/6 "2019-12-13T14:24:16Z")

</div>

[TCIA](https://www.cancerimagingarchive.net/) has many datasets with MR modality.
