Skip to content

Commit

Permalink
Fix rmsd and SVD issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Sep 18, 2024
1 parent a46343e commit 76915f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions xcp_d/interfaces/censoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ def _run_interface(self, runtime):

new_confound_df[column] = confound_df[column]

# Replace NaNs in new column with zeros
new_confound_df[column].fillna(0, inplace=True)

# Collect column metadata
for column in new_confound_df.columns:
if column in confound_metadata:
Expand Down
9 changes: 8 additions & 1 deletion xcp_d/utils/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def load_motion(
motion_confounds_df : pandas.DataFrame
The six motion regressors.
The three rotations are listed first, then the three translations.
Plus rmsd, and possibly filtered motion regressors.
References
----------
Expand Down Expand Up @@ -91,10 +92,16 @@ def load_motion(
columns=[f"{c}_filtered" for c in motion_confounds_df.columns],
)
motion_confounds_df = pd.concat(
[motion_confounds_df, filtered_motion_confounds_df, confounds_df[["rmsd"]]],
[motion_confounds_df, filtered_motion_confounds_df],
axis=1,
)

# Add RMSD column (used for QC measures later on)
motion_confounds_df = pd.concat(
[motion_confounds_df, confounds_df[["rmsd"]]],
axis=1,
)

return motion_confounds_df


Expand Down

0 comments on commit 76915f0

Please sign in to comment.