The output of mrinfo
doesn’t report the information as stored in the NIfTI directly, but rather as MRtrix3 interprets it. In this instance, the fact that fslhd
and the TRK metadata match is all we need to know.
Incidentally, the only time the mrinfo output would be expected to match the sform
as stored in the NIfTI header is in the special case of close-to-axial orientations (i.e. strides: 1 2 3
) with unit voxel sizes. This is because the transform reported by mrinfo
is the pure rotation applied to the image axes, having modified them to be close to axial (see the documentation for details). In contrast, the sform
includes the voxel scaling, and does not try to account for the orientation of the axes in any way.
So the issue is elsewhere. I have no idea what could be causing this – as I mentioned earlier, there’s been no changes to the format or conventions assumed for the streamlines data. There have been a few changes to the NIfTI handling though, which may account for the discrepancy – but these were included into 3.0_RC3
, not RC2. We also had quite a bit of fun investigating fundamental instabilities in the qform
if you’re really interested – but these changes are on master
only, not even 3.0_RC3
. I can’t find any changes in the NIfTI handling between RC1 & RC2 – here’s the full diff for the relevant files:
$ git log -p 3.0_RC1..3.0_RC2 -- core/file/nifti* core/formats/nifti*
which basically gives copyright notice changes and not a lot else:
commit 3db1bb2b07b2cbeed35596a63c67bdd310a0492d
Author: Robert Smith <robert.smith@florey.edu.au>
Date: Sat May 20 01:08:36 2017 +1000
Remove #include <vector> usages
This header should no longer be included directly, since class MR::vector (defined in core/types.h) should always be used.
diff --git a/core/file/nifti_utils.h b/core/file/nifti_utils.h
index ba232f38f..b5b2d9398 100644
--- a/core/file/nifti_utils.h
+++ b/core/file/nifti_utils.h
@@ -15,8 +15,6 @@
#ifndef __file_nifti_utils_h__
#define __file_nifti_utils_h__
-#include <vector>
-
#include "types.h"
namespace MR
commit 729dd6cfc1a773f0f16592b8533c6e9d89d03ac3
Author: Thijs Dhollander <thijs.dhollander@gmail.com>
Date: Mon May 15 10:33:05 2017 +1000
copyright update and cleanup
diff --git a/core/file/nifti1_utils.cpp b/core/file/nifti1_utils.cpp
index ded0e761e..9b53dd81e 100644
--- a/core/file/nifti1_utils.cpp
+++ b/core/file/nifti1_utils.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti1_utils.h b/core/file/nifti1_utils.h
index ecd412789..16b117eaa 100644
--- a/core/file/nifti1_utils.h
+++ b/core/file/nifti1_utils.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti2.h b/core/file/nifti2.h
index d9e4de475..5643fa909 100644
--- a/core/file/nifti2.h
+++ b/core/file/nifti2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti2_utils.cpp b/core/file/nifti2_utils.cpp
index 1d76659c1..d0fafa7ee 100644
--- a/core/file/nifti2_utils.cpp
+++ b/core/file/nifti2_utils.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti2_utils.h b/core/file/nifti2_utils.h
index dcd629e9c..39f272b8f 100644
--- a/core/file/nifti2_utils.h
+++ b/core/file/nifti2_utils.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti_utils.cpp b/core/file/nifti_utils.cpp
index 1d0d6e19c..2e909f671 100644
--- a/core/file/nifti_utils.cpp
+++ b/core/file/nifti_utils.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/file/nifti_utils.h b/core/file/nifti_utils.h
index 18e9d0bf0..ba232f38f 100644
--- a/core/file/nifti_utils.h
+++ b/core/file/nifti_utils.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/formats/nifti1.cpp b/core/formats/nifti1.cpp
index f188bb60c..06d4977df 100644
--- a/core/formats/nifti1.cpp
+++ b/core/formats/nifti1.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/formats/nifti1_gz.cpp b/core/formats/nifti1_gz.cpp
index 41938ff75..588f1a322 100644
--- a/core/formats/nifti1_gz.cpp
+++ b/core/formats/nifti1_gz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/formats/nifti2.cpp b/core/formats/nifti2.cpp
index 0ccd4cde6..06c76faa1 100644
--- a/core/formats/nifti2.cpp
+++ b/core/formats/nifti2.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git a/core/formats/nifti2_gz.cpp b/core/formats/nifti2_gz.cpp
index c63e8e22b..b79a28145 100644
--- a/core/formats/nifti2_gz.cpp
+++ b/core/formats/nifti2_gz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2017 the MRtrix3 contributors
+/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
In short, I can’t think of anything that would affect this… The only other option that might play a role here is if there’s a discrepancy between the sform
and the qform
in your reference image. We did introduce checks on that front in 3.0_RC3
(this commit), along with a config file option to set which of the two to use when they don’t match (this commit). I’m not sure what might have happened in the past, although I have a feeling it would have silently defaulted to the sform
. If that doesn’t match what nipype
is defaulting to in case of mismatch, that could introduce the kinds of errors you’re seeing… You should be able to check this with a quick look through fslhd
– and a 3.0_RC3
version of mrinfo
should also warn you if there is a mismatch…