Skip to content

Commit d8bd921

Browse files
authored
Fix DTI protocol (#228) (#229)
* Update reslicing to use new `mrgrid` command This also works with older `mrreslice` * Fix bad indent in tensorReorder() * Update documentation
1 parent 00bc50e commit d8bd921

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

CHANGELOG.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ Changelog
44
All notable changes to this project will be documented in this file or
55
page
66

7+
`v1.0_RC4`_
8+
-----------
9+
10+
Sep 22, 2020
11+
12+
**Added**:
13+
14+
* Reslicing compatibility udpated for new MRTrix3 version
15+
where ``mrrelice`` has been changed to ``mrgrid``.
16+
PyDesigner will work with either versions.
17+
18+
**Changed**:
19+
20+
* Fixed a bad indent in tensor reordering function
21+
that produced an error in DTI protocols.
22+
23+
**Removed**:
24+
25+
* None
26+
727
`v1.0_RC3`_
828
-----------
929

@@ -198,6 +218,7 @@ Initial port of MATLAB code to Python. 200,000,000,000 BCE
198218

199219
.. Links
200220
221+
.. _v1.0_RC4: https://github.com/m-ama/PyDesigner/releases/tag/v1.0_RC4
201222
.. _v1.0_RC3: https://github.com/m-ama/PyDesigner/releases/tag/v1.0_RC3
202223
.. _v1.0_RC2: https://github.com/m-ama/PyDesigner/releases/tag/v1.0_RC2
203224
.. _v1.0_RC1: https://github.com/m-ama/PyDesigner/releases/tag/v1.0-RC1

designer/fitting/dwipy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ def tensorReorder(self, dwiType):
25762576
dt[20, :] = self.dt[14, :] # K14
25772577
DT = vectorize(dt[0:6, :], self.mask)
25782578
KT = vectorize(dt[6:21, :], self.mask)
2579-
return DT, KT
2579+
return DT, KT
25802580

25812581
def irllsviolmask(self, reject):
25822582
"""

designer/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
)
1111
)
1212
__packagename__ = 'PyDesigner'
13-
__version__='v1.0-RC3'
13+
__version__='v1.0-RC4'
1414
__author__ = 'PyDesigner developers'
1515
__copyright__ = 'Copyright 2020, PyDesigner developers, MUSC Advanced Image Analysis (MAMA)'
1616
__credits__ = [

designer/preprocessing/mrpreproc.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,16 +953,33 @@ def reslice(input, output, size, interp='linear',
953953
'reslicing'.format(specified_size, current_size))
954954
copyfile(input, output)
955955
return
956-
arg = ['mrresize']
956+
arg = []
957+
if which('mrresize') is None:
958+
arg.extend(
959+
[
960+
'mrgrid',
961+
input,
962+
'regrid',
963+
dim_str, size,
964+
'-interp', interp,
965+
output
966+
]
967+
)
968+
else:
969+
arg.extend(
970+
[
971+
'mrresize',
972+
dim_str, size,
973+
'-interp', interp,
974+
input, output
975+
]
976+
)
957977
if force:
958978
arg.append('-force')
959979
if not verbose:
960980
arg.append('-quiet')
961981
if not (nthreads is None):
962982
arg.extend(['-nthreads', str(nthreads)])
963-
arg.extend([dim_str, size])
964-
arg.extend(['-interp', interp])
965-
arg.extend([input, output])
966983
completion = subprocess.run(arg)
967984
if completion.returncode != 0:
968985
raise Exception('Failed to reslice. See above for errors.')

0 commit comments

Comments
 (0)