Skip to content

Comments

Spike Regression connection fix#2181

Merged
sgiavasis merged 15 commits intodevelopfrom
fix/censor_file
Mar 19, 2025
Merged

Spike Regression connection fix#2181
sgiavasis merged 15 commits intodevelopfrom
fix/censor_file

Conversation

@sgiavasis
Copy link
Collaborator

@sgiavasis sgiavasis commented Jan 31, 2025

Fixes

Fixes #2137 by @sgiavasis

Description

  • Removes an erroneous connection which would send a censor file with a binary spike regressor into the -cenmode KILL flag of AFNI 3dTproject as part of nuisance denoising.
  • This would sometimes cause TRs to be dropped from the timeseries unnecessarily, as if scrubbing was being performed.

Technical details

Tests

  • No TRs dropped when using spike regression as part of the nuisance denoising strategy.
  • Spike regressor is present in the desc-confounds_timeseries matrix.
  • No censor file is submitted to AFNI 3dTproject as an input.

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@sgiavasis
Copy link
Collaborator Author

sgiavasis commented Mar 6, 2025

This was fun! Here's what changed:

  • Functionality identifying the offending timepoints - which TRs/timepoints have a motion measure (FD_J, FD_P, DVARS) higher than the user-set threshold, and producing a censors.tsv binary vector - has been abstracted out into its own function because we realized it needed to be used in different places - thanks @birajstha for that one.
  • When spike regression is enabled, offending timepoints are identified before nuisance regressor creation, and SpikeRegression columns are created and included in the regressors matrix. Thus spike regression is facilitated through the -ort pathway of AFNI 3dTproject and is modeled into the confounds.
  • The rest of the censoring methods continue to operate as they always have, with the offending timepoints going into a binary vector (censors.tsv) and being submitted to 3dTproject via the -censor parameter, along with the censoring mode setting (like KILL - scrubbing, NTRP - interpolate, etc.).

@sgiavasis sgiavasis marked this pull request as ready for review March 6, 2025 21:51
@sgiavasis
Copy link
Collaborator Author

@shnizzedy I incorporated your suggestions - hows it look?

@sgiavasis sgiavasis merged commit 2092a2d into develop Mar 19, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants