Skip to content

[ENH] added slice_encoding_direction input to TShift #2753

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 7 commits into from
Oct 26, 2018

Conversation

fliem
Copy link
Contributor

@fliem fliem commented Oct 25, 2018

Summary

Fixes #2752

List of changes proposed in this PR (pull-request)

  • adds slice_encoding_direction input to TShift
  • if slice_encoding_direction == k-, reverse slice_timing

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@fliem
Copy link
Contributor Author

fliem commented Oct 25, 2018

@effigies is there a simple way to add a test for that?

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.

To test, I would add to the docstring:

     ## EXISTING
     When the ``slice_timing`` input is used, the ``timing_file`` output is populated,
     in this case with the generated file.
 
     >>> tshift._list_outputs()['timing_file']  # doctest: +ELLIPSIS
    '.../slice_timing.1D'
    ## NEW
    >>> np.loadtxt(tshift._list_outputs()['timing_file'])[:5]
    [0.0, 0.4, 0.8, 1.2, 1.6]

    If ``slice_encoding_direction`` is set to ``'k-'``, the slice timing is reversed:

    >>> tshift.slice_encoding_direction = 'k-'
    >>> tshift.cmdline
    '3dTshift -prefix functional_tshift -tpattern @slice_timing.1D -TR 2.5s -tzero 0.0 functional.nii'
    >>> np.loadtxt(tshift._list_outputs()['timing_file'])[:5]
    [15.6, 15.2, 14.8, 14.4, 14.0]

Seem reasonable?

@codecov-io
Copy link

codecov-io commented Oct 25, 2018

Codecov Report

Merging #2753 into master will decrease coverage by 3.41%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2753      +/-   ##
==========================================
- Coverage   67.44%   64.03%   -3.42%     
==========================================
  Files         340      338       -2     
  Lines       43164    43117      -47     
  Branches     5351     5349       -2     
==========================================
- Hits        29110    27608    -1502     
- Misses      13355    14430    +1075     
- Partials      699     1079     +380
Flag Coverage Δ
#smoketests ?
#unittests 64.03% <60%> (-0.78%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/afni/preprocess.py 80.66% <60%> (-0.74%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
nipype/utils/spm_docs.py 25.92% <0%> (-44.45%) ⬇️
nipype/interfaces/freesurfer/base.py 49.59% <0%> (-30.9%) ⬇️
nipype/utils/logger.py 59.7% <0%> (-29.86%) ⬇️
nipype/algorithms/rapidart.py 35.39% <0%> (-29.21%) ⬇️
nipype/interfaces/spm/base.py 58.41% <0%> (-29.05%) ⬇️
nipype/utils/provenance.py 55.73% <0%> (-28.99%) ⬇️
nipype/interfaces/fsl/model.py 55.26% <0%> (-25.35%) ⬇️
nipype/testing/fixtures.py 77.33% <0%> (-21.34%) ⬇️
... and 46 more

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 39675df...27bbfc1. Read the comment docs.

@fliem
Copy link
Contributor Author

fliem commented Oct 25, 2018

That all sounds reasonable. If there should be any other changes, I can take a look in a couple of days.

@effigies
Copy link
Member

This LGTM. If it passes the Travis tests for Python < 3.7, I'll merge. Thanks!

@effigies effigies merged commit d83b06d into nipy:master Oct 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.

3 participants