Skip to content

ENH: Allow CompCor to skip initial volumes #2122

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
Jul 28, 2017

Conversation

effigies
Copy link
Member

@effigies effigies commented Jul 19, 2017

Follow-up to #2107.

Changes proposed in this pull request

  • Permit CompCor to ignore initial volumes, intended to take the output of the NonSteadyStateDetector interface
  • Adds a "SteadyState" column to the filter_basis
  • filter_basis and components are calculated on the truncated series, then zero-padded to fit original series

Todo:

  • Downstream testing

@satra
Copy link
Member

satra commented Jul 19, 2017

@effigies - zero-padding will change the filter characteristics. if necessary this should be applied only to the pca components. on the other hand you can add N columns with a 1 at the location for every volume that is discarded (similar to ArtifactDetect).

if nvols:
ss_col = np.zeros((components.shape[0], 1),
dtype=filter_basis.dtype)
ss_col[:nvols] = 1
Copy link
Member

Choose a reason for hiding this comment

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

I think we should model each volume with a separate regressor. Like artifacts in ArtDetect

@effigies
Copy link
Member Author

@satra Ah, you're right. The "steady state" column should be N columns with a single 1 in each.

But to be clear, the data is truncated, the filter basis is constructed and applied before extracting the components. After that, the filter basis is zero-padded, to include in the GLM along with the components. Does that resolve the issue for you, or is there a problem I'm missing?

@effigies effigies force-pushed the enh/compcor_exclude branch from 5c89ec5 to ccbce0f Compare July 19, 2017 20:28
@codecov-io
Copy link

codecov-io commented Jul 25, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@3b15d39). Click here to learn what that means.
The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2122   +/-   ##
=========================================
  Coverage          ?   47.44%           
=========================================
  Files             ?      115           
  Lines             ?    23564           
  Branches          ?        0           
=========================================
  Hits              ?    11180           
  Misses            ?    12384           
  Partials          ?        0
Flag Coverage Δ
#smoketests 47.44% <6.25%> (?)
Impacted Files Coverage Δ
nipype/algorithms/confounds.py 28.18% <6.25%> (ø)

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 3b15d39...0927cab. Read the comment docs.

@effigies effigies changed the title [WIP] ENH: Allow CompCor to skip initial volumes ENH: Allow CompCor to skip initial volumes Jul 25, 2017
@effigies
Copy link
Member Author

@satra I believe the CircleCI issues are unrelated to this PR.

I also added docs to explain the behavior of this change and the high-pass filter. Let me know what you think.

@effigies
Copy link
Member Author

Sorry. Realized a bug was being picked up downstream. Will check the box when ready.

@effigies
Copy link
Member Author

@satra Sorry to bug you, but do you have any issues with this as it stands?

@satra
Copy link
Member

satra commented Jul 28, 2017

lgtm

@effigies effigies merged commit 9b0686d into nipy:master Jul 28, 2017
@effigies effigies deleted the enh/compcor_exclude branch July 28, 2017 20:26
effigies added a commit to nipreps/niworkflows that referenced this pull request Jul 28, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants