Mrregister error

Dear all,
I’m quite new in the MRtrix environment. I had a look on the internet but no one seems to refer to my problem.

I’m setting a pipeline to perform tractography using atlas as prior knowledge.
Most of the pipeline is running quite well but I would like to perform some registration steps to introduce the atlas. I have tried the mrregister command line with 2 diffusion MRIs as well with 2 standard MRIs (I even tried with the same image as moving and fixed images) and all false in the same way.

With the debug mode and gdb I ended to prompt the following error message.

$ gdb --args mrregister_debug -info -debug image1.mif image2.mif
[...] // some debug level messages, not relevant
mrregister: running affine registration
[...] // some debug level messages, not relevant
mrregister: [INFO] centre: -0.816628558065  0.198100122322  0.403576240122 // last message before crash
mrregister: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.

The begging of the back track says:

(gdb) bt
#0  0x00007ffff6b71418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6b7301a in __GI_abort () at abort.c:89
#2  0x00007ffff6b69bd7 in __assert_fail_base (fmt=<optimized out>, 
    assertion=assertion@entry=0x649420 "(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAss"..., 
    file=file@entry=0x6493e8 "/usr/include/eigen3/Eigen/src/Core/DenseStorage.h", line=line@entry=128, 
    function=function@entry=0x68dd60 <Eigen::internal::plain_array<double, 16, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]") at assert.c:92
#3  0x00007ffff6b69c82 in __GI___assert_fail (
    assertion=assertion@entry=0x649420 "(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAss"..., 
    file=file@entry=0x6493e8 "/usr/include/eigen3/Eigen/src/Core/DenseStorage.h", line=line@entry=128, 
    function=function@entry=0x68dd60 <Eigen::internal::plain_array<double, 16, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]") at assert.c:101
#4  0x000000000042cf03 in Eigen::internal::plain_array<double, 16, 0, 32>::plain_array (this=<optimized out>)
    at /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128
#5  Eigen::DenseStorage<double, 16, 4, 4, 0>::DenseStorage (this=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:187
#6  Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> >::PlainObjectBase (this=<optimized out>)
    at /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:457
#7  Eigen::Matrix<double, 4, 4, 0, 4, 4>::Matrix (this=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/Matrix.h:259
#8  Eigen::Transform<double, 3, 32, 0>::Transform (other=..., this=<optimized out>) at /usr/include/eigen3/Eigen/src/Geometry/Transform.h:262
#9  __gnu_cxx::new_allocator<Eigen::Transform<double, 3, 32, 0> >::construct<Eigen::Transform<double, 3, 32, 0>, Eigen::Transform<double, 3, 32, 0> const&> (
    __p=<optimized out>, this=0x7fffffff8b40) at /usr/include/c++/5/ext/new_allocator.h:120
#10 std::allocator_traits<std::allocator<Eigen::Transform<double, 3, 32, 0> > >::construct<Eigen::Transform<double, 3, 32, 0>, Eigen::Transform<double, 3, 32, 0> const&> (__p=<optimized out>, __a=...) at /usr/include/c++/5/bits/alloc_traits.h:530
#11 std::vector<Eigen::Transform<double, 3, 32, 0>, std::allocator<Eigen::Transform<double, 3, 32, 0> > >::_M_emplace_back_aux<Eigen::Transform<double, 3, 32, 0> const&> (this=this@entry=0x7fffffff8b40) at /usr/include/c++/5/bits/vector.tcc:416
#12 0x00000000004f5428 in std::vector<Eigen::Transform<double, 3, 32, 0>, std::allocator<Eigen::Transform<double, 3, 32, 0> > >::push_back (
    this=this@entry=0x7fffffff8b40, __x=...) at /usr/include/c++/5/bits/stl_vector.h:923
#13 0x0000000000503f9c in MR::compute_minimum_average_header<MR::Image<double>, MR::Image<double>, MR::Registration::Transform::Affine> (im1=..., im2=..., 
    transformation=..., voxel_subsampling=@0x7fffffff8fd0: 1, padding=...) at ./lib/math/average_space.h:55
#14 0x00000000005e8992 in MR::Registration::Linear::run_masked<MR::Registration::Metric::MeanSquared4D<MR::Image<double>, MR::Image<double> >, MR::Registration::Transform::Affine, MR::Image<double>, MR::Image<double>, MR::Image<double>, MR::Image<double> > (this=this@entry=0x7fffffffca80, metric=..., transform=..., 
    im1_image=..., im2_image=..., im1_mask=..., im2_mask=...) at src/registration/linear.h:298
#15 0x00000000004b86dc in run () at cmd/mrregister.cpp:724
#16 0x00000000004bc7c6 in main (cmdline_argc=<optimized out>, cmdline_argv=<optimized out>) at ./lib/command.h:90

I visited the web page the error message refers to (ie http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html) but it presents some solution for code development not usage.

Can anyone help me with that?

I’m using MRtrix 3, running everything on Linux 16.04, 8Gb memory, built with gcc 5.4

Thanks a lot in advance.

That’s the problem we get when using the default version of Eigen on Ubuntu 16.04, which ships the unstable beta for some reason. See this post and this post for details, and use these commands to fix the issue. It looks like we’ll need to dig into mrregister to figure out how to make it work with the forthcoming version of Eigen…

Thanks a lot for your prompt reply ! I did have the seg fault with mrview but it was inconsistent and didn’t thought it was connected.
I will have a look and let you know.

Hey, quick feedback, the trick presented here solved the problem. Cheers !!

1 Like