Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

Merged
merged 9 commits into from
May 26, 2018
Merged

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented May 24, 2018

Changes proposed in this pull request

  • initial support for connectome workbench interfaces
  • interface MetricResample (wb_command -metric-resample)
  • added some empty files to show clearer use-case within doctest

@mgxd mgxd changed the title Enh/workbench ENH: initial connectome workbench support May 24, 2018
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)
Copy link
Member Author

@mgxd mgxd May 24, 2018

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

@effigies
Copy link
Member

effigies commented May 25, 2018

You need to add nipype/interfaces/workbench/tests/__init__.py to pacify the tests.

Copy link
Member

@effigies effigies left a 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")
Copy link
Member

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"))
Copy link
Member

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.

@effigies effigies added this to the 1.0.4 milestone May 25, 2018
@codecov-io
Copy link

codecov-io commented May 25, 2018

Codecov Report

Merging #2594 into master will decrease coverage by <.01%.
The diff coverage is 66.19%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#smoketests 50.74% <ø> (ø) ⬆️
#unittests 65.07% <66.19%> (-0.03%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/workbench/__init__.py 100% <100%> (ø)
nipype/interfaces/workbench/base.py 56% <56%> (ø)
nipype/interfaces/workbench/metric.py 71.11% <71.11%> (ø)
nipype/utils/profiler.py 43.1% <0%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9eaa2a3...9e61ec7. Read the comment docs.

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)
Copy link
Member

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

Copy link
Contributor

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``.

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@effigies effigies merged commit f092055 into nipy:master May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants