<div dir="ltr">Dear Brad,<div><br></div><div>Thank you for your time and helpful email.</div><div><br></div><div>Here is my edited code for the first part which tries to resmaple Coronal image using the direction of Axial image:</div><div><br></div><div># imageA : Axial MRI scan, size : 256x256x56 , spacing: 1,1,3, slice gap : 1</div><div># imageC : Coronal MRI scan, size : 256x256x68 , spacing: 1,1,3, slice gap : 1</div><div><div><div>resample = sitk.ResampleImageFilter()</div><div>resample.SetReferenceImage(imageC)</div><div>resample.SetOutputDirection(imageA.GetDirection())</div><div>resample.SetOutputOrigin(imageA.GetOrigin())</div><div>imageCA = resample.Execute(imageC)</div><div>sitk.Show(imageCA)</div></div></div><div># imageCA: size : 256x256x68</div><div><br>I believe I have missed something here because the size of resampled coronal image (imageCA) should be 68x256x256. Should I change the OutputSpacing to [3,1,1]?</div><div><br></div><div><br></div><div>For resizing the imageCA considering slice thickness and slice gap parameters, should I use something like "resample.SetSize([256,256,256)"? How should I calculate and specify OutputSpacing? </div><div><br></div><div><br></div><div>Best regards,</div><div>Sara</div><div><div><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 20, 2016 at 11:12 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hello,
<div><br>
</div>
<div>I am not sure what you mean by you “re-arranged the coronal scan to be in the axial view”. I hope you did it in a way to preserve the meta-data and the direction cosine matrix. You should be able to do this all in what step with the resample
filter.</div>
<div><br>
</div>
<div>You need to use the input’s direction matrix for the OutputDirection of the resample filter. Next set the OutputSize, and then correctly calculate the OutputSpacing so that the result has the same physical extent as the input.</div>
<div><br>
</div>
<div>If you need further help, perhaps sharing a snip-it of code would help.</div>
<div><br>
</div>
<div>HTH,</div>
<div>Brad</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite"><div><div class="h5">
<div>On Jun 19, 2016, at 10:22 PM, Sara Gh <<a href="mailto:sg.ele.eng@gmail.com" target="_blank">sg.ele.eng@gmail.com</a>> wrote:</div>
<br>
</div></div><div><div><div class="h5">
<div dir="ltr">Hello experts,
<div><br>
</div>
<div>I have two MRI scans: axial (256x256x56) and coronal (68x256x256). For both of them, slice thickness and slice gap parameters are 2 and 1, respectively.</div>
<div>I have re-arranged the coronal scan to be in the axial view. Therefore, the new coronal scan (with the axial view) is 256x256x68.</div>
<div>Now, I am trying to use SimpleITK to resize/upsample both scans to 256x256x256. Considering
<b>slice gap and slice thickness parameters</b>, how can I perform this 3D-resizing in SimpleITK?<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Sara Gh</div>
</div></div></div>
_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote></div><br><div><br></div>
</div></div>