-
Notifications
You must be signed in to change notification settings - Fork 533
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
ENH: initial connectome workbench support #2594
Conversation
def _format_arg(self, opt, spec, val): | ||
if opt == "metric_out": | ||
# ensure generated filename is assigned to trait | ||
self.inputs.trait_set(metric_out=val) |
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.
bug? metric_out
was displayed correctly in cmdline
, but without this trait_set
call, remained as Undefined
in _list_outputs
You need to add |
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 looks good.
keep_extension=True, | ||
argstr="%s", | ||
position=4, | ||
desc="The output metric") |
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.
Maybe rename this to out_file
(or rename both here and outputs.out_file
to metric_file
)? In addition to resolving your trait weirdness, I think it'll be less confusing for people for the connected traits to have the same name.
position=6, | ||
argstr="%s", | ||
desc=("A relevant anatomical surface with <current-sphere> mesh OR" | ||
" a metric file with vertex areas for <current-sphere> mesh")) |
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.
Unimportant style point: I don't think parentheses are necessary for the line break and tabbing to be valid.
Codecov Report
@@ Coverage Diff @@
## master #2594 +/- ##
==========================================
- Coverage 67.62% 67.61% -0.01%
==========================================
Files 336 339 +3
Lines 42711 42782 +71
Branches 5278 5287 +9
==========================================
+ Hits 28883 28928 +45
- Misses 13151 13174 +23
- Partials 677 680 +3
Continue to review full report at Codecov.
|
def _format_arg(self, opt, spec, val): | ||
if opt == "out_file": | ||
# ensure generated filename is assigned to trait | ||
self.inputs.trait_set(out_file=val) |
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.
Sorry, I meant to say that I think this (and the _list_outputs
entry) shouldn't be necessary if you make the input spec match the output spec.
class MetricResample(WBCommand): | ||
""" | ||
Resample a metric file to a different mesh | ||
|
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 think it would help documentation to copy a bit more from their docs:
Resample a metric file to a different mesh
Resamples a metric file, given two spherical surfaces that are in
register. If ``ADAP_BARY_AREA`` is used, exactly one of -area-surfs or
``-area-metrics`` must be specified.
The ``ADAP_BARY_AREA`` method is recommended for ordinary metric data,
because it should use all data while downsampling, unlike ``BARYCENTRIC``.
The recommended areas option for most data is individual midthicknesses
for individual data, and averaged vertex area metrics from individual
midthicknesses for group average data.
The ``-current-roi`` option only masks the input, the output may be slightly
dilated in comparison, consider using ``-metric-mask`` on the output when
using ``-current-roi``.
The ``-largest option`` results in nearest vertex behavior when used with
``BARYCENTRIC``. When resampling a binary metric, consider thresholding at
0.5 after resampling rather than using ``-largest``.
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.
@oesteban Want to just push this change? It's after 5pm here.
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.
Sure
Changes proposed in this pull request
wb_command -metric-resample
)