-
Notifications
You must be signed in to change notification settings - Fork 532
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
nipype/algorithms/misc.py
Outdated
@@ -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, |
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.
in_files
since multiple files are acceptable.
nipype/algorithms/misc.py
Outdated
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") |
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.
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.
nipype/algorithms/misc.py
Outdated
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, |
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.
use name_source and template
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 defined a _gen_fname
instead that should handle multiple in_files
accordingly
Changes proposed in this pull request
CalculateMedian
interface that takes one or more 4D realigned timeseries and returns the average across each timeseries' medians.