[ITK] N4 Bias Correction in Python

Addison Elliott addison.elliott at gmail.com
Wed Oct 4 11:34:37 EDT 2017


I need to perform N4 bias correction in Python on two sets of MRI scans. I
am using the default settings for N4BiasFieldCorrectionImageFilter.
Beforehand, I shrink the image by a factor of 4x to speed up the processing.

However, the issue with that is I lose resolution when I get the output
image. I would like to use a shrink factor of 4x but keep the initial
resolution.

An example of how to do that in C++ is shown here:
https://github.com/midas-journal/midas-journal-640/blob/master/Source/itkN3MRIBiasFieldCorrectionImageFilterTest.cxx

My issue is that BSplineControlPointImageFilter is not wrapped in Python.
Just about everything else in that module is. I took a look at the source
code for the module and it would take me a few weeks to understand and
implement that in Python.

So here are my series of questions:

   1. How can I go about wrapping BSplineControlPointImageFilter in Python?
   I'm willing to build the source code to do so.

   2. Assuming I decide to go the route of wrapping
   BSplineControlPointImageFilter, how can I go about contributing my code to
   the project?

   3. I'm confused as to whether you are using GitHub or your own Git
   server for contributions? There is a GitHub project link with no pull
   requests that I could contribute too. But there's also your git server on
   itk.org which has more active contributions.

   4. I'm unable to sign up for Gerrit access as described on this link.
   https://itk.org/Wiki/ITK/Git/Account#Gerrit Am I supposed to mail any
   patches?

   5. As a temporary solution, is it valid to do this to get the bias field:
            v(x) = u(x)f(x) + n(x)

   But since noise is ignored according to Sled's paper, it becomes:
           v(x) = u(x)f(x)



*Can I do this?         f(x) = u(x) / v(x) *

Any help is appreciated.

Thanks,
Addison
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20171004/d576fdde/attachment.html>


More information about the Community mailing list