<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello, <div class=""><br class=""><div class="">I thank you for you fast and accurate answer. This was exactly what I was looking for. Actually I don’t need to visualise the data but further process it in a common reference frame. I think that your answer solves the problem. I will look into the ResampleImageFilter (that so far I was using only to adjust the resolution of different volumes acquired with different scanners to a common one).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks a lot!</div><div class=""><br class=""></div><div class="">Fausto Milletari<br class=""><div><blockquote type="cite" class=""><div class="">On 04 May 2016, at 20:36, Lowekamp, Bradley (NIH/NLM/LHC) [C] <<a href="mailto:blowekamp@mail.nih.gov" class="">blowekamp@mail.nih.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hello,
<div class=""><br class="">
</div>
<div class="">If I understand you correctly you want to rotate the image and pad it for visualization before exporting to numpy.</div>
<div class=""><br class="">
</div>
<div class="">Have you looked into the ResampleImageFilter? It accepts a transform, along with output image geometry so that you can readily manipulate the image for display. You also may want to scale the image’s intensity with a WindowLevelImageFilter for
better visualization of the range of interest.</div>
<div class=""><br class="">
</div>
<div class="">HTH,</div>
<div class="">Brad</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On May 4, 2016, at 1:14 PM, fausto milletarì <<a href="mailto:fausto.milletari@gmail.com" class="">fausto.milletari@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hello everyone,
<div class=""><br class="">
<div class="">I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of
the volume.</div>
</div>
<div class=""><br class="">
</div>
<div class="">In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example.</div>
<div class=""><br class="">
</div>
<div class="">when i do simply <span style="color: rgb(128, 128, 128); font-style: italic; font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">sitk.GetArrayFromImage(imgResampledCropped)</span>I get back the raw data itself,
but what I would like to do is to have a numpy array that contains the data “ready to visualise” by simple slicing of the array itself.</div>
<div class=""><br class="">
</div>
<div class="">Do you think this is doable? Is there a standard way of doing it?</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Kind regards,</div>
<div class=""><br class="">
</div>
<div class="">Fausto</div>
<div class=""><br class="">
</div>
</div>
_____________________________________<br class="">
Powered by <a href="http://www.kitware.com/" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at<br class="">
<a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
<br class="">
Kitware offers ITK Training Courses, for more information visit:<br class="">
<a href="http://www.kitware.com/products/protraining.php" class="">http://www.kitware.com/products/protraining.php</a><br class="">
<br class="">
Please keep messages on-topic and check the ITK FAQ at:<br class="">
<a href="http://www.itk.org/Wiki/ITK_FAQ" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/insight-users" class="">http://public.kitware.com/mailman/listinfo/insight-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div></blockquote></div><br class=""></div></div></body></html>