-
Notifications
You must be signed in to change notification settings - Fork 535
FIX: DTITK Interface #2514
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
FIX: DTITK Interface #2514
Changes from 1 commit
094c475
f818961
0c28b39
b412659
6673083
70d8d63
19f4904
01d9666
a913e6f
1ef2ca6
50a9f1c
6bb86e4
197b793
e670fe1
b1581ab
db590d5
f474554
32e4f02
de50d4e
cb2b537
aeb2c55
5049458
98e181a
f601c68
49d0138
78e155d
605f3b5
ea6afb8
2acb241
ddfd19d
37fb6f9
1bc8a1c
2fea4fa
1deaad8
def5d6b
5499794
0244983
cfcb91d
a10da5d
0839823
1379dc6
d40ba45
4cedad9
155ae52
e921ddf
08babbc
f1fac40
cae974e
7c41d5d
5b2462c
a3c391c
c644343
5df307c
898db0c
ca52d94
6224080
769a0fc
62e3456
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,9 +163,9 @@ class ComposeXfmInputSpec(CommandLineInputSpec): | |
argstr="-df %s", copyfile=False, mandatory=True) | ||
in_aff = File(desc='affine transform file', exists=True, | ||
argstr="-aff %s", mandatory=True) | ||
out_file = traits.File(desc='output path', | ||
argstr="-out %s", name_source="in_df", | ||
name_template="%s_aff.df", keep_extension=True) | ||
out_file = File(desc='output path', | ||
argstr="-out %s", name_source="in_df", | ||
name_template="%s_aff.df", keep_extension=True) | ||
|
||
|
||
class ComposeXfmOutputSpec(TraitedSpec): | ||
|
@@ -196,9 +196,9 @@ class ComposeXfm(CommandLineDtitk): | |
class affSymTensor3DVolInputSpec(CommandLineInputSpec): | ||
in_file = File(desc='moving tensor volume', exists=True, | ||
argstr="-in %s", mandatory=True) | ||
out_file = traits.File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_affxfmd", keep_extension=True) | ||
out_file = File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_affxfmd", keep_extension=True) | ||
transform = File(exists=True, argstr="-trans %s", | ||
xor=['target', 'translation', 'euler', 'deformation'], | ||
desc='transform to apply: specify an input transformation\ | ||
|
@@ -254,16 +254,17 @@ class affSymTensor3DVol(CommandLineDtitk): | |
class affScalarVolInputSpec(CommandLineInputSpec): | ||
in_file = File(desc='moving scalar volume', exists=True, | ||
argstr="-in %s", mandatory=True) | ||
out_file = traits.File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_affxfmd", keep_extension=True) | ||
out_file = File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_affxfmd", keep_extension=True) | ||
transform = File(exists=True, argstr="-trans %s", | ||
xor=['target', 'translation', 'euler', 'deformation'], | ||
desc='transform to apply: specify an input transformation\ | ||
file; parameters input will be ignored',) | ||
interpolation = traits.Enum(0, 1, usedefault=True, | ||
argstr="-interp %s", | ||
desc='0=trilinear (def); 1=nearest neighbor') | ||
interpolation = traits.Enum('trilinear', 'NN', | ||
usedefault=True, argstr="-interp %s", | ||
desc='trilinear or nearest neighbor\ | ||
interpolation') | ||
target = File(exists=True, argstr="-target %s", xor=['transform'], | ||
desc='output volume specification read from the target volume\ | ||
if specified') | ||
|
@@ -301,13 +302,18 @@ class affScalarVol(CommandLineDtitk): | |
output_spec = affScalarVolOutputSpec | ||
_cmd = 'affineScalarVolume' | ||
|
||
def _format_arg(self, name, spec, value): | ||
if name == 'interpolation': | ||
value = {'trilinear': 0, 'NN': 1}[value] | ||
super(affScalarVol, self)._format_arg(name, spec, value) | ||
|
||
|
||
class diffeoSymTensor3DVolInputSpec(CommandLineInputSpec): | ||
in_file = File(desc='moving tensor volume', exists=True, | ||
argstr="-in %s", mandatory=True) | ||
out_file = traits.File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_diffeoxfmd", keep_extension=True) | ||
out_file = File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_diffeoxfmd", keep_extension=True) | ||
transform = File(exists=True, argstr="-trans %s", | ||
mandatory=True, desc='transform to apply') | ||
df = traits.Str('FD', argstr="-df %s", usedefault=True) | ||
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. Description? And if 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. Usage of deformationSymTensor3DVolume : 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. Here is the documentation. I think that is the case... "df" usually means "deformation field" in this package, but I'm not sure what FD stands for (I didn't find it in the documentation). 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. Gotcha. Okay, this makes sense. It sets the default, but because it's |
||
|
@@ -326,7 +332,8 @@ class diffeoSymTensor3DVolInputSpec(CommandLineInputSpec): | |
argstr="-vsize %g %g %g", xor=['target']) | ||
flip = traits.Tuple((traits.Int(), traits.Int(), traits.Int()), | ||
exists=True, argstr="-flip %d %d %d") | ||
resampling_type = traits.Enum(1, 0, desc='1=backward(def), 0=forward', | ||
resampling_type = traits.Enum('backward', 'forward', | ||
desc='use backward or forward resampling', | ||
exists=True, argstr="-type %d") | ||
|
||
|
||
|
@@ -355,13 +362,18 @@ class diffeoSymTensor3DVol(CommandLineDtitk): | |
output_spec = diffeoSymTensor3DVolOutputSpec | ||
_cmd = 'deformationSymTensor3DVolume' | ||
|
||
def _format_arg(self, name, spec, value): | ||
if name == 'resampling_type': | ||
value = {'forward': 0, 'backward': 1}[value] | ||
super(diffeoSymTensor3DVol, self)._format_arg(name, spec, value) | ||
|
||
|
||
class diffeoScalarVolInputSpec(CommandLineInputSpec): | ||
in_file = File(desc='moving scalar volume', exists=True, | ||
argstr="-in %s", mandatory=True) | ||
out_file = traits.File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_diffeoxfmd", keep_extension=True) | ||
out_file = File(desc='output filename', | ||
argstr="-out %s", name_source="in_file", | ||
name_template="%s_diffeoxfmd", keep_extension=True) | ||
transform = transform = File(exists=True, argstr="-trans %s", | ||
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.
|
||
mandatory=True, desc='transform to apply') | ||
target = File(exists=True, argstr="-target %s", xor=['voxel_size'], | ||
|
@@ -372,10 +384,13 @@ class diffeoScalarVolInputSpec(CommandLineInputSpec): | |
argstr="-vsize %g %g %g", xor=['target']) | ||
flip = traits.Tuple((traits.Int(), traits.Int(), traits.Int()), | ||
exists=True, argstr="-flip %d %d %d") | ||
resampling_type = traits.Enum(1, 0, desc='1=backward(def), 0=forward', | ||
resampling_type = traits.Enum('backward', 'forward', | ||
desc='use backward or forward resampling', | ||
exists=True, argstr="-type %d") | ||
interp = traits.Enum(0, 1, desc='0=trilinear(def), 1=nearest neighbor', | ||
exists=True, argstr="-interp %d", usedefault=True) | ||
interpolation = traits.Enum('trilinear', 'NN', | ||
desc='trilinear, or nearest neighbor', | ||
exists=True, argstr="-interp %d", | ||
usedefault=True) | ||
|
||
|
||
class diffeoScalarVolOutputSpec(TraitedSpec): | ||
|
@@ -402,3 +417,11 @@ class diffeoScalarVol(CommandLineDtitk): | |
input_spec = diffeoScalarVolInputSpec | ||
output_spec = diffeoScalarVolOutputSpec | ||
_cmd = 'deformationScalarVolume' | ||
|
||
def _format_arg(self, name, spec, value): | ||
if name == 'resampling_type': | ||
value = {'forward': 0, 'backward': 1}[value] | ||
super(diffeoScalarVol, self)._format_arg(name, spec, value) | ||
if name == 'interpolation': | ||
value = {'trilinear': 0, 'NN': 1}[value] | ||
super(diffeoScalarVol, self)._format_arg(name, spec, value) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,12 @@ | |
class TVAdjustVoxSpInputSpec(CommandLineInputSpec): | ||
in_file = File(desc="tensor volume to modify", exists=True, | ||
mandatory=True, argstr="-in %s") | ||
out_file = traits.File(genfile=True, desc='output path', | ||
argstr="-out %s", name_source='in_file', | ||
name_template='%s_avs', keep_extension=True) | ||
target_file = traits.File(desc='target volume to match', | ||
argstr="-target %s", | ||
xor=['voxel_size', 'origin']) | ||
out_file = File(genfile=True, desc='output path', | ||
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 think 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. Should 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. Yes, that one is fine to leave, since we're not modifying it to use |
||
argstr="-out %s", name_source='in_file', | ||
name_template='%s_avs', keep_extension=True) | ||
target_file = File(desc='target volume to match', | ||
argstr="-target %s", | ||
xor=['voxel_size', 'origin']) | ||
voxel_size = traits.Tuple((traits.Float(), traits.Float(), traits.Float()), | ||
desc='xyz voxel size (superseded by target)', | ||
argstr="-vsize %g %g %g", xor=['target_file']) | ||
|
@@ -77,9 +77,9 @@ class TVAdjustVoxSp(CommandLineDtitk): | |
class SVAdjustVoxSpInputSpec(CommandLineInputSpec): | ||
in_file = File(desc="scalar volume to modify", exists=True, | ||
mandatory=True, argstr="-in %s") | ||
out_file = traits.File(desc='output path', argstr="-out %s", | ||
name_source="in_file", name_template='%s_avs', | ||
keep_extension=True) | ||
out_file = File(desc='output path', argstr="-out %s", | ||
name_source="in_file", name_template='%s_avs', | ||
keep_extension=True) | ||
target_file = File(desc='target volume to match', | ||
argstr="-target %s", xor=['voxel_size', 'origin']) | ||
voxel_size = traits.Tuple((traits.Float(), traits.Float(), traits.Float()), | ||
|
@@ -118,9 +118,9 @@ class SVAdjustVoxSp(CommandLineDtitk): | |
class TVResampleInputSpec(CommandLineInputSpec): | ||
in_file = File(desc="tensor volume to resample", exists=True, | ||
mandatory=True, argstr="-in %s") | ||
out_file = traits.File(desc='output path', | ||
name_source="in_file", name_template="%s_resampled", | ||
keep_extension=True, argstr="-out %s") | ||
out_file = File(desc='output path', | ||
name_source="in_file", name_template="%s_resampled", | ||
keep_extension=True, argstr="-out %s") | ||
target_file = File(desc='specs read from the target volume', | ||
argstr="-target %s", | ||
xor=['array_size', 'voxel_size', 'origin']) | ||
|
@@ -166,9 +166,9 @@ class TVResample(CommandLineDtitk): | |
class SVResampleInputSpec(CommandLineInputSpec): | ||
in_file = File(desc="image to resample", exists=True, | ||
mandatory=True, argstr="-in %s") | ||
out_file = traits.File(desc='output path', | ||
name_source="in_file", name_template="%s_resampled", | ||
keep_extension=True, argstr="-out %s") | ||
out_file = File(desc='output path', | ||
name_source="in_file", name_template="%s_resampled", | ||
keep_extension=True, argstr="-out %s") | ||
target_file = File(desc='specs read from the target volume', | ||
argstr="-target %s", | ||
xor=['array_size', 'voxel_size', 'origin']) | ||
|
@@ -215,8 +215,7 @@ class TVtoolInputSpec(CommandLineInputSpec): | |
'''NOTE: there are a lot more options here; not implementing all of them''' | ||
in_flag = traits.Enum('fa', 'tr', 'ad', 'rd', 'pd', 'rgb', exists=True, | ||
argstr="-%s", desc='') | ||
out_file = traits.File(exists=True, | ||
argstr="-out %s", genfile=True) | ||
out_file = File(exists=True, argstr="-out %s", genfile=True) | ||
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.
|
||
|
||
|
||
class TVtoolOutputSpec(TraitedSpec): | ||
|
@@ -263,9 +262,9 @@ def _gen_filename(self, name): | |
class BinThreshInputSpec(CommandLineInputSpec): | ||
in_file = File(desc='Image to threshold/binarize', exists=True, | ||
position=0, argstr="%s", mandatory=True) | ||
out_file = traits.File(desc='', position=1, argstr="%s", | ||
keep_extension=True, name_source='in_file', | ||
name_template='%s_thrbin') | ||
out_file = File(desc='', position=1, argstr="%s", | ||
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. Empty description. |
||
keep_extension=True, name_source='in_file', | ||
name_template='%s_thrbin') | ||
lower_bound = traits.Float(0.01, position=2, argstr="%g", mandatory=True) | ||
upper_bound = traits.Float(100, position=3, argstr="%g", mandatory=True) | ||
inside_value = traits.Float(1, position=4, argstr="%g", usedefault=True, | ||
|
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.
Is
copyfile=False
required here? I thinkname_source
should handle changing directories fine, but you should check.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.
I'm not sure about this... @satra changed it in #2463. I can look into it.
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.
Okay. It's not a big deal, either way.