# module 'SimpleITK' has no attribute 'GetDefaultParameterMap'

**URL:** <https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422>\
**Category:** Beginner Questions\
**Tags:** registration\
**Created:** [January 31, 2024, 1:35pm UTC](https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422 "2024-01-31T13:35:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdoungchawee](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/9fc348/32.png) [@jdoungchawee](https://discourse.itk.org/u/jdoungchawee)\
**Post date:** [January 31, 2024, 1:35pm UTC](https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422/1 "2024-01-31T13:35:18Z")

</div>

I tried to do image registration which worked well before but after a while, I will get this error with the same code that worked before. Please anyone know what is the problem and how to fix it?  
Example of code:

```py
def registration(fixed_image, moving_image, parameter_map):
    FixedImage = sitk.GetImageFromArray(fixed_image)
    MovingImage = sitk.GetImageFromArray(moving_image)
    ParameterMap = sitk.GetDefaultParameterMap(parameter_map)
    elastixImageFilter = sitk.ElastixImageFilter()
    elastixImageFilter.SetFixedImage(FixedImage)
    elastixImageFilter.SetMovingImage(MovingImage)
    elastixImageFilter.SetParameterMap(ParameterMap)
    elastixImageFilter.Execute()

    ResultImage = elastixImageFilter.GetResultImage()
    TransParameterMap =elastixImageFilter.GetTransformParameterMap()
    
    ResultArray = sitk.GetArrayFromImage(ResultImage)
    FixedArray = sitk.GetArrayFromImage(FixedImage)
    MovingArray = sitk.GetArrayFromImage(MovingImage)
    
    return ResultArray, FixedArray, MovingArray, TransParameterMap
fixed_image = A_image
moving_image = B_image
parameter_map = 'affine'
ResultArray, FixedArray, MovingArray, TransParameterMap = registration(fixed_image, moving_image, parameter_map)

# Generate registration images
registration_plot(ResultArray, FixedArray, MovingArray)

```

---

<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:** [January 31, 2024, 1:49pm UTC](https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422/2 "2024-01-31T13:49:20Z")

</div>

Hello @jdoungchawee,

The registration you are using is part of SimpleElastix. The official SimpleITK binaries do not include the SimplElastix components. To include those you will need to [build SimpleITK](https://simpleitk.readthedocs.io/en/master/building.html) from source (use the SuperBuild) and set the CMake `SimpleITK_USE_ELASTIX` flag to on.

The resulting binary will include the SimpleElastix components.
