Skip to content

Commit

Permalink
Ignore subcortical figures and plot FOV center of reference brains in…
Browse files Browse the repository at this point in the history
… executive summary (PennLINC#1145)
  • Loading branch information
tsalo authored Apr 16, 2024
1 parent af79139 commit 5699978
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
8 changes: 4 additions & 4 deletions xcp_d/interfaces/execsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ def collect_inputs(self):
ANAT_REGISTRATION_DESCS = [
"AtlasOnAnat",
"AnatOnAtlas",
"AtlasOnSubcorticals",
"SubcorticalsOnAtlas",
# "AtlasOnSubcorticals",
# "SubcorticalsOnAtlas",
]
ANAT_REGISTRATION_TITLES = [
"Atlas On {modality}", # noqa: FS003
"{modality} On Atlas", # noqa: FS003
"Atlas On {modality} Subcorticals", # noqa: FS003
"{modality} Subcorticals On Atlas", # noqa: FS003
# "Atlas On {modality} Subcorticals", # noqa: FS003
# "{modality} Subcorticals On Atlas", # noqa: FS003
]
TASK_REGISTRATION_DESCS = [
"TaskOnT1w",
Expand Down
10 changes: 9 additions & 1 deletion xcp_d/interfaces/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,15 @@ def _run_interface(self, runtime):
arr = img.get_fdata()

fig = plt.figure(constrained_layout=False, figsize=(25, 10))
plot_anat(img, draw_cross=False, figure=fig, vmin=np.min(arr), vmax=np.max(arr))
plot_anat(
img,
draw_cross=False,
figure=fig,
vmin=np.min(arr),
vmax=np.max(arr),
cut_coords=[0, 0, 0],
annotate=False,
)
fig.savefig(self._results["out_file"], bbox_inches="tight", pad_inches=None)
plt.close(fig)

Expand Down
20 changes: 11 additions & 9 deletions xcp_d/utils/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ def load_motion(
)

# Volterra expansion
columns = motion_confounds_df.columns.tolist()
for col in columns:
new_col = f"{col}_derivative1"
motion_confounds_df[new_col] = motion_confounds_df[col].diff()

columns = motion_confounds_df.columns.tolist()
for col in columns:
new_col = f"{col}_power2"
motion_confounds_df[new_col] = motion_confounds_df[col] ** 2
# Ignore pandas SettingWithCopyWarning
with pd.option_context("mode.chained_assignment", None):
columns = motion_confounds_df.columns.tolist()
for col in columns:
new_col = f"{col}_derivative1"
motion_confounds_df[new_col] = motion_confounds_df[col].diff()

columns = motion_confounds_df.columns.tolist()
for col in columns:
new_col = f"{col}_power2"
motion_confounds_df[new_col] = motion_confounds_df[col] ** 2

return motion_confounds_df

Expand Down

0 comments on commit 5699978

Please sign in to comment.