Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
William Clarke
fsl_mrs
Commits
0a8565f1
Commit
0a8565f1
authored
Jul 23, 2021
by
William Clarke
Browse files
Fix bug in nifti mrs align.
parent
53cfec37
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.rst
View file @
0a8565f1
...
...
@@ -3,7 +3,9 @@ This document contains the FSL-MRS release history in reverse chronological orde
1.1.4 (WIP)
------------------------------
- Fixed bug in mrs_tools split
- Fixed bug in alignment of multi-dimensional data.
- fsl_mrsi now outputs fitting nuisance parameters: phases, and shifts & linewidths for each metabolite group.
- Add NIfTI-MRS reshape command
1.1.3 (Tuesday 29th June 2021)
------------------------------
...
...
fsl_mrs/tests/test_utils_nifti_mrs_proc.py
View file @
0a8565f1
...
...
@@ -8,6 +8,7 @@ from pathlib import Path
from
fsl_mrs.utils.preproc
import
nifti_mrs_proc
as
nproc
from
fsl_mrs.utils.mrs_io
import
read_FID
from
fsl_mrs.utils.nifti_mrs_tools
import
split
from
fsl_mrs
import
__version__
...
...
@@ -58,11 +59,19 @@ def test_average():
def
test_align
():
nmrs_obj
=
read_FID
(
metab
)
with_coils
,
_
=
split
(
nmrs_obj
,
'DIM_COIL'
,
3
)
aligned1
=
nproc
.
align
(
with_coils
,
'DIM_DYN'
,
ppmlim
=
(
1.0
,
4.0
),
niter
=
1
,
apodize
=
5
)
assert
aligned1
.
hdr_ext
[
'ProcessingApplied'
][
0
][
'Method'
]
==
'Frequency and phase correction'
assert
aligned1
.
hdr_ext
[
'ProcessingApplied'
][
0
][
'Details'
]
\
==
'fsl_mrs.utils.preproc.nifti_mrs_proc.align, dim=DIM_DYN, '
\
'target=None, ppmlim=(1.0, 4.0), niter=1, apodize=5.'
combined
=
nproc
.
coilcombine
(
nmrs_obj
)
aligned
=
nproc
.
align
(
combined
,
'DIM_DYN'
,
ppmlim
=
(
1.0
,
4.0
),
niter
=
1
,
apodize
=
5
)
aligned
2
=
nproc
.
align
(
combined
,
'DIM_DYN'
,
ppmlim
=
(
1.0
,
4.0
),
niter
=
1
,
apodize
=
5
)
assert
aligned
.
hdr_ext
[
'ProcessingApplied'
][
1
][
'Method'
]
==
'Frequency and phase correction'
assert
aligned
.
hdr_ext
[
'ProcessingApplied'
][
1
][
'Details'
]
\
assert
aligned
2
.
hdr_ext
[
'ProcessingApplied'
][
1
][
'Method'
]
==
'Frequency and phase correction'
assert
aligned
2
.
hdr_ext
[
'ProcessingApplied'
][
1
][
'Details'
]
\
==
'fsl_mrs.utils.preproc.nifti_mrs_proc.align, dim=DIM_DYN, '
\
'target=None, ppmlim=(1.0, 4.0), niter=1, apodize=5.'
...
...
fsl_mrs/utils/preproc/nifti_mrs_proc.py
View file @
0a8565f1
...
...
@@ -180,7 +180,7 @@ def align(data, dim, target=None, ppmlim=None, niter=2, apodize=10, figure=False
aligned_obj
=
data
.
copy
()
for
dd
,
idx
in
data
.
iterate_over_dims
(
dim
=
dim
,
iterate_over_space
=
True
,
reduce_dim_index
=
Tru
e
):
reduce_dim_index
=
Fals
e
):
out
=
preproc
.
phase_freq_align
(
dd
.
T
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment