-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support complex-valued dwidenoising #679
Changes from 6 commits
56772f6
f1bea5f
3d6b10d
3d1ce20
a6bc0a3
970f367
88844cf
a305138
ad1974c
9f06f2a
35df866
0774bc3
b182f12
ddea10e
2aef726
39c50ff
310d9f2
16aeb98
e09cfb5
ae88d98
f155c35
d9c8bdb
2e04518
3d3588f
09394f3
30aab41
ae8acc7
2e983b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1356,3 +1356,61 @@ class TransformHeader(CommandLine): | |
input_spec = _TransformHeaderInputSpec | ||
output_spec = _TransformHeaderOutputSpec | ||
_cmd = "mrtransform -strides -1,-2,3" | ||
|
||
|
||
class _PolarToComplexInputSpec(CommandLineInputSpec): | ||
mag_file = traits.File( | ||
exists=True, | ||
mandatory=True, | ||
position=0, | ||
argstr="%s" | ||
) | ||
phase_file = traits.File( | ||
exists=True, | ||
mandatory=True, | ||
position=1, | ||
argstr="%s" | ||
) | ||
out_file = traits.File( | ||
exists=False, | ||
mandatory=True, | ||
position=-1, | ||
argstr="-polar %s" | ||
) | ||
|
||
|
||
class _PolarToComplexOutputSpec(TraitedSpec): | ||
out_file = File(exists=True) | ||
|
||
|
||
class PolarToComplex(CommandLine): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you remember where you found the mrcalc commands? Was it on the mrtrix forum? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got it from the docstring of mrcalc: https://mrtrix.readthedocs.io/en/latest/reference/commands/mrcalc.html#complex-numbers |
||
input_spec = _PolarToComplexInputSpec | ||
output_spec = _PolarToComplexOutputSpec | ||
|
||
_cmd = "mrcalc" | ||
|
||
|
||
class _ComplexToMagnitudeInputSpec(CommandLineInputSpec): | ||
complex_file = traits.File( | ||
exists=True, | ||
mandatory=True, | ||
position=0, | ||
argstr="%s" | ||
) | ||
out_file = traits.File( | ||
exists=False, | ||
mandatory=True, | ||
position=-1, | ||
argstr="-abs %s" | ||
) | ||
|
||
|
||
class _ComplexToMagnitudeOutputSpec(TraitedSpec): | ||
out_file = File(exists=True) | ||
|
||
|
||
class ComplexToMagnitude(CommandLine): | ||
input_spec = _ComplexToMagnitudeInputSpec | ||
output_spec = _ComplexToMagnitudeOutputSpec | ||
|
||
_cmd = "mrcalc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a great idea - it doesn't require a new commandline flag and is easy to understand