[ITK] SimpleITK - Resizing MRI scan with slice thickness and slice gap parameters
Sara Gh
sg.ele.eng at gmail.com
Tue Jun 21 14:29:05 EDT 2016
Dear Brad,
Thank you for your time and helpful email.
Here is my edited code for the first part which tries to resmaple Coronal
image using the direction of Axial image:
# imageA : Axial MRI scan, size : 256x256x56 , spacing: 1,1,3, slice gap
: 1
# imageC : Coronal MRI scan, size : 256x256x68 , spacing: 1,1,3, slice
gap : 1
resample = sitk.ResampleImageFilter()
resample.SetReferenceImage(imageC)
resample.SetOutputDirection(imageA.GetDirection())
resample.SetOutputOrigin(imageA.GetOrigin())
imageCA = resample.Execute(imageC)
sitk.Show(imageCA)
# imageCA: size : 256x256x68
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]?
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?
Best regards,
Sara
On Mon, Jun 20, 2016 at 11:12 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <
blowekamp at mail.nih.gov> wrote:
> Hello,
>
> 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.
>
> 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.
>
> If you need further help, perhaps sharing a snip-it of code would help.
>
> HTH,
> Brad
>
> On Jun 19, 2016, at 10:22 PM, Sara Gh <sg.ele.eng at gmail.com> wrote:
>
> Hello experts,
>
> 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.
> I have re-arranged the coronal scan to be in the axial view. Therefore,
> the new coronal scan (with the axial view) is 256x256x68.
> Now, I am trying to use SimpleITK to resize/upsample both scans to
> 256x256x256. Considering *slice gap and slice thickness parameters*, how
> can I perform this 3D-resizing in SimpleITK?
>
> Thanks,
> Sara Gh
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160621/4f4e3c5e/attachment.html>
More information about the Community
mailing list