Skip to content

enh: calcmedian interface #2167

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

Merged
merged 4 commits into from
Sep 11, 2017
Merged

enh: calcmedian interface #2167

merged 4 commits into from
Sep 11, 2017

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented Aug 23, 2017

Changes proposed in this pull request

  • ENH: CalculateMedian interface that takes one or more 4D realigned timeseries and returns the average across each timeseries' medians.

@codecov-io
Copy link

Codecov Report

Merging #2167 into master will increase coverage by <.01%.
The diff coverage is 94.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2167      +/-   ##
==========================================
+ Coverage   72.25%   72.26%   +<.01%     
==========================================
  Files        1168     1168              
  Lines       58405    58438      +33     
  Branches     8400     8402       +2     
==========================================
+ Hits        42203    42232      +29     
- Misses      14868    14871       +3     
- Partials     1334     1335       +1
Flag Coverage Δ
#smoketests 72.26% <94.28%> (ø) ⬆️
#unittests 69.92% <94.28%> (+0.01%) ⬆️
Impacted Files Coverage Δ
nipype/algorithms/tests/test_misc.py 100% <100%> (ø) ⬆️
nipype/algorithms/misc.py 45.6% <92%> (+1.38%) ⬆️
nipype/interfaces/base.py 83.3% <0%> (-0.19%) ⬇️

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 32e724c...5b06c8e. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Aug 24, 2017

Codecov Report

Merging #2167 into master will decrease coverage by <.01%.
The diff coverage is 74.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2167      +/-   ##
==========================================
- Coverage   72.25%   72.25%   -0.01%     
==========================================
  Files        1168     1169       +1     
  Lines       58405    58486      +81     
  Branches     8400     8416      +16     
==========================================
+ Hits        42203    42261      +58     
- Misses      14868    14879      +11     
- Partials     1334     1346      +12
Flag Coverage Δ
#smoketests 72.25% <74.69%> (-0.01%) ⬇️
#unittests 69.92% <74.69%> (ø) ⬆️
Impacted Files Coverage Δ
nipype/algorithms/tests/test_misc.py 100% <100%> (ø) ⬆️
nipype/algorithms/misc.py 45.78% <67.79%> (+1.56%) ⬆️
...pype/algorithms/tests/test_auto_CalculateMedian.py 85.71% <85.71%> (ø)
nipype/interfaces/base.py 83.3% <0%> (-0.19%) ⬇️

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 32e724c...7055313. Read the comment docs.

@@ -1380,6 +1380,51 @@ def merge_rois(in_files, in_idxs, in_ref,
return out_file


class CalculateMedianInputSpec(BaseInterfaceInputSpec):
in_file = InputMultiPath(File(exists=True, mandatory=True,
Copy link
Member

Choose a reason for hiding this comment

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

in_files since multiple files are acceptable.

in_file = InputMultiPath(File(exists=True, mandatory=True,
desc="One or more realigned Nifti 4D timeseries"))
median_file = traits.Str('median.nii.gz', usedefault=True,
desc="Filename to store median image")
Copy link
Member

Choose a reason for hiding this comment

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

perhaps add a boolean flag to indicate whether the median should be computed individually or across files. and generate the appropriate outputs based on the flag.

class CalculateMedianInputSpec(BaseInterfaceInputSpec):
in_file = InputMultiPath(File(exists=True, mandatory=True,
desc="One or more realigned Nifti 4D timeseries"))
median_file = traits.Str('median.nii.gz', usedefault=True,
Copy link
Member

Choose a reason for hiding this comment

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

use name_source and template

Copy link
Member Author

Choose a reason for hiding this comment

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

I defined a _gen_fname instead that should handle multiple in_files accordingly

@satra satra merged commit 1dd4995 into nipy:master Sep 11, 2017
@satra satra added this to the 0.14.0 milestone Oct 20, 2017
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.

3 participants