# (Segmentation fault.) Is it possible to use a single data set with integers (double) as the fixed and moving inputs for registration?

**URL:** https://discourse.itk.org/t/segmentation-fault-is-it-possible-to-use-a-single-data-set-with-integers-double-as-the-fixed-and-moving-inputs-for-registration/5690
**Category:** Beginner Questions
**Tags:** itk, registration, python
**Created:** [February 9, 2023, 4:07pm UTC](https://discourse.itk.org/t/segmentation-fault-is-it-possible-to-use-a-single-data-set-with-integers-double-as-the-fixed-and-moving-inputs-for-registration/5690 "2023-02-09T16:07:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![edgar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@edgar](https://discourse.itk.org/u/edgar)
#### Post date: [February 9, 2023, 4:07pm UTC](https://discourse.itk.org/t/segmentation-fault-is-it-possible-to-use-a-single-data-set-with-integers-double-as-the-fixed-and-moving-inputs-for-registration/5690/1 "2023-02-09T16:07:40Z")

</div>

Hi. I’m getting a segmentation fault. I’m almost sure that I must be messing something up. In summary, I want to check if using a single data set as both moving and fixed images can be registered. I tried the same with floats (`np.float32`, `itk.F`) and I did not get the segmentation fault. Thanks.

```auto
import numpy as np
import pyvista as pv
import itk

ref_vti = pv.UniformGrid("tmp_gmsh.vti")
ref_vti.save("tmp_ref_vti.vti")
print("tmp_ref_vti.vti")

image_type = itk.Image[itk.D, 3]
nx, ny, nz = [val - 1 for val in ref_vti.dimensions]
fixed_image_arr = np.reshape(
    np.asarray(ref_vti.cell_data["material"], dtype=int), [nz, nx, ny])
fixed_image = itk.image_from_array(
    fixed_image_arr.astype(int), ttype=image_type)

param_obj = itk.ParameterObject.New()
param_map_rigid = param_obj.GetDefaultParameterMap('rigid')
param_map_bspline = param_obj.GetDefaultParameterMap('bspline')

param_obj.AddParameterMap(param_map_rigid)
param_obj.AddParameterMap(param_map_bspline)

registration_res = itk.elastix_registration_method(
    fixed_image, fixed_image,
    parameter_object=param_obj,
    output_directory='./')
# | itk | 5.3.0 |
# | itk-core | 5.3.0 |
# | itk-elastix | 0.15.0 |
# | itk-filtering | 5.3.0 |
# | itk-io | 5.3.0 |
# | itk-meshtopolydata | 0.10.0 |
# | itk-minimalpathextraction | 1.2.4 |
# | itk-numerics | 5.3.0 |
# | itk-registration | 5.3.0 |
# | itk-segmentation | 5.3.0 |
# | itk-strain | 0.3.6 |
# | itk-tubetk | 1.3.4 |
# | itkwidgets | 0.32.5 |
# | numpy | 1.24.1 |
# | pyvista | 0.37.0 |
# | scipy | 1.10.0 |
# | python | 3.10.9 |

```

This is what I get

```auto
Process Python segmentation fault (core dumped)

```

[tmp\_gmsh.vti](https://discourse.itk.org/uploads/short-url/nOTbHiSTD0ytZknE6gXzEyRbtZy.vti) (25.6 KB)

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [February 10, 2023, 9:03pm UTC](https://discourse.itk.org/t/segmentation-fault-is-it-possible-to-use-a-single-data-set-with-integers-double-as-the-fixed-and-moving-inputs-for-registration/5690/2 "2023-02-10T21:03:33Z")

</div>

Hi @edgar ,

Elastix is currently only wrapped for 32-bit floats, so you will need to use that for now.

HTH,  
Matt

---

<div class="post-metadata">

### Author: ![edgar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@edgar](https://discourse.itk.org/u/edgar)
#### Post date: [February 12, 2023, 3:22pm UTC](https://discourse.itk.org/t/segmentation-fault-is-it-possible-to-use-a-single-data-set-with-integers-double-as-the-fixed-and-moving-inputs-for-registration/5690/3 "2023-02-12T15:22:41Z")

</div>

Thanks, @matt.mccormick .
