# rotational MIP around a specified axis in physical coordinates system

**URL:** <https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255>\
**Category:** Beginner Questions\
**Created:** [July 12, 2021, 7:49am UTC](https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255 "2021-07-12T07:49:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_Hahn1](https://discourse.itk.org/user_avatar/discourse.itk.org/stephan_hahn1/32/1871_2.png) [@Stephan\_Hahn1](https://discourse.itk.org/u/Stephan_Hahn1)\
**Post date:** [July 12, 2021, 7:49am UTC](https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255/1 "2021-07-12T07:49:43Z")

</div>

Hi everyone.  
I have a very simple question that maybe @zivy can answer (based on previous related topics).

I want to generate a rotational MIP around a specified axis with an image that has not an unit direction cosine matrix.  
Following other topics on the forum ([rotational around specified axis](https://discourse.itk.org/t/rotation-around-a-specified-axis/1875), [Rotational MIP](https://discourse.itk.org/t/generate-rotational-maximum-intensity-projections/3226)) I successfully do the rotational MIP around specified axis but the MIP is not on the proper axis of the image (meaning that the image stack is inclined).

How can I get image in the image coordinate using direction cosine matrix + origin? (easiest way. So I can get an image with unit direction cosine matrix and do all my transformation in this space).  
Or  
how I can used maximum intensity projection along a specified axis? (and Keep the physical coordinates system for the MIP).

thanks in advance

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [July 12, 2021, 3:37pm UTC](https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255/2 "2021-07-12T15:37:10Z")

</div>

Hello @Stephan_Hahn1,

Not clear what is the desired output vs. what you obtain. Possibly provide some drawings/images to clarify?

If the goal is to easily generate rotational DRRs, possibly look to [plastimatch](https://plastimatch.org), specifically its [DRR command line tool](https://plastimatch.org/drr.html), or to [RTK](https://www.openrtk.org/) which I think has similar functionality (not sure about this one).

---

<div class="post-metadata">

**Author:** ![Stephan\_Hahn1](https://discourse.itk.org/user_avatar/discourse.itk.org/stephan_hahn1/32/1871_2.png) [@Stephan\_Hahn1](https://discourse.itk.org/u/Stephan_Hahn1)\
**Post date:** [July 13, 2021, 8:00am UTC](https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255/3 "2021-07-13T08:00:24Z")

</div>

Hello @zivy

yes my explanation is unclear but I finally solve my problem.

So the idea was to get a rotating MIP on an inclined image stack. Do the rotation around the image axis (using direction cosine matrix). The problem I was facing is that for the resampler, I used as OutputDIrection an unit direction cosine matrix, instead of the image direction. But with the image direction cosine, it is working.

Do you want me to put the full code solution?

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [July 13, 2021, 12:49pm UTC](https://discourse.itk.org/t/rotational-mip-around-a-specified-axis-in-physical-coordinates-system/4255/4 "2021-07-13T12:49:55Z")

</div>

Hello @Stephan_Hahn1,

Happy to hear that you were able to resolve your issue.

If your solution is not too long then it would be great if you posted the code here so that other developers will benefit from your solution.
