# Control point grid output from NiftyReg not loaded correctly

**URL:** <https://discourse.slicer.org/t/control-point-grid-output-from-niftyreg-not-loaded-correctly/34967>\
**Category:** Development\
**Tags:** registration, segmentation, data-loading\
**Created:** [March 19, 2024, 7:20am UTC](https://discourse.slicer.org/t/control-point-grid-output-from-niftyreg-not-loaded-correctly/34967 "2024-03-19T07:20:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Post date:** [March 19, 2024, 7:20am UTC](https://discourse.slicer.org/t/control-point-grid-output-from-niftyreg-not-loaded-correctly/34967/1 "2024-03-19T07:20:46Z")

</div>

I’m integrating [NiftyReg](http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg_documentation) into an extension.

I registered two images with [f3d](http://cmictig.cs.ucl.ac.uk/wiki/index.php/Reg_f3d) and saved the control point grid (to later get the deformation).

However, the grid isn’t loaded correctly into Slicer. In the Data module it says that it has dimensions (55, 55, 26), however, it actually has dimensions (55, 55, 26, 1, 3) if you extract the data array.

Is this a problem with Slicer or is the output just not according to some standards?

Here’s a [link](https://www.dropbox.com/scl/fi/9gtq37lw1bct1cj0743c9/controlPointGrid.nii?rlkey=enukco6xnp11yyeh0dg81sing&dl=0) to the control point grid output.

---

<div class="post-metadata">

**Author:** ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Post date:** [March 21, 2024, 7:59am UTC](https://discourse.slicer.org/t/control-point-grid-output-from-niftyreg-not-loaded-correctly/34967/2 "2024-03-21T07:59:23Z")

</div>

I actually needed the displacement field anyway, and the way to get it and use it is described in this [issue](https://discourse.slicer.org/t/deforming-with-niftyreg-is-different-than-deforming-in-slicer/34992/3)
