Skip to content
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

Plot tweaks to make paper quality #576

Merged
merged 19 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions AFQ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,7 @@ def _viz_bundles(self, row,
color_by_volume=None,
cbv_lims=[None, None],
xform_color_by_volume=False,
volume_opacity=0.3,
n_points=40):
bundles_file = self._clean_bundles(row)

Expand All @@ -1555,6 +1556,7 @@ def _viz_bundles(self, row,
)

figure = self.viz.visualize_volume(volume,
opacity=volume_opacity,
interact=False,
inline=False)

Expand Down Expand Up @@ -1598,6 +1600,7 @@ def _viz_ROIs(self, row,
color_by_volume=None,
cbv_lims=[None, None],
xform_color_by_volume=False,
volume_opacity=0.3,
n_points=40):
bundles_file = self._clean_bundles(row)

Expand All @@ -1617,6 +1620,7 @@ def _viz_ROIs(self, row,
self.logger.info(f"Generating {bundle_name} visualization...")
uid = self.bundle_dict[bundle_name]['uid']
figure = self.viz.visualize_volume(volume,
opacity=volume_opacity,
interact=False,
inline=False)
try:
Expand Down Expand Up @@ -1996,6 +2000,7 @@ def viz_bundles(self,
color_by_volume=None,
cbv_lims=[None, None],
xform_color_by_volume=False,
volume_opacity=0.3,
n_points=40,
inline=False,
interactive=False):
Expand All @@ -2007,6 +2012,7 @@ def viz_bundles(self,
color_by_volume=color_by_volume,
cbv_lims=cbv_lims,
xform_color_by_volume=xform_color_by_volume,
volume_opacity=volume_opacity,
n_points=n_points,
inline=inline,
interactive=interactive)
Expand All @@ -2019,6 +2025,7 @@ def viz_ROIs(self,
color_by_volume=None,
cbv_lims=[None, None],
xform_color_by_volume=False,
volume_opacity=0.3,
n_points=40,
inline=False,
interactive=False):
Expand All @@ -2034,6 +2041,7 @@ def viz_ROIs(self,
color_by_volume=color_by_volume,
cbv_lims=cbv_lims,
xform_color_by_volume=xform_color_by_volume,
volume_opacity=volume_opacity,
n_points=n_points)

def plot_tract_profiles(self):
Expand Down
15 changes: 14 additions & 1 deletion AFQ/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,33 @@
"UF_L": "UNC_L", "UF_R": "UNC_R",
"IFOF_L": "IFO_L", "IFOF_R": "IFO_R",
"CST_L": "CST_L", "CST_R": "CST_R",
"ILF_L": "ILF_L", "ILF_R": "ILF_R",
"SLF_L": "SLF_L", "SLF_R": "SLF_R"
}

BUNDLE_MAT_2_PYTHON = \
{'Right Corticospinal': 'CST_R', 'Left Corticospinal': 'CST_L',
'RightCorticospinal': 'CST_R', 'LeftCorticospinal': 'CST_L',
'Right Uncinate': 'UNC_R', 'Left Uncinate': 'UNC_L',
'RightUncinate': 'UNC_R', 'LeftUncinate': 'UNC_L',
'Left IFOF': 'IFO_L', 'Right IFOF': 'IFO_R',
'LeftIFOF': 'IFO_L', 'RightIFOF': 'IFO_R',
'Right Arcuate': 'ARC_R', 'Left Arcuate': 'ARC_L',
'RightArcuate': 'ARC_R', 'LeftArcuate': 'ARC_L',
'Right Thalamic Radiation': 'ATR_R', 'Left Thalamic Radiation': 'ATR_L',
'RightThalamicRadiation': 'ATR_R', 'LeftThalamicRadiation': 'ATR_L',
'Right Cingulum Cingulate': 'CGC_R', 'Left Cingulum Cingulate': 'CGC_L',
'RightCingulumCingulate': 'CGC_R', 'LeftCingulumCingulate': 'CGC_L',
'Right Cingulum Hippocampus': 'HCC_R',
'Left Cingulum Hippocampus': 'HCC_L',
'RightCingulumHippocampus': 'HCC_R',
'LeftCingulumHippocampus': 'HCC_L',
'Callosum Forceps Major': 'FP', 'Callosum Forceps Minor': 'FA',
'CallosumForcepsMajor': 'FP', 'CallosumForcepsMinor': 'FA',
'Right ILF': 'ILF_R', 'Left ILF': 'ILF_L',
'Right SLF': 'SLF_R', 'Left SLF': 'SLF_L'}
'RightILF': 'ILF_R', 'LeftILF': 'ILF_L',
'Right SLF': 'SLF_R', 'Left SLF': 'SLF_L',
'RightSLF': 'SLF_R', 'LeftSLF': 'SLF_L'}

afq_home = op.join(op.expanduser('~'), 'AFQ_data')

Expand Down
10 changes: 5 additions & 5 deletions AFQ/viz/plotly_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def _draw_streamlines(figure, sls, dimensions, color, name, cbv=None,
y_pts = np.zeros(plotting_shape)
z_pts = np.zeros(plotting_shape)

if cbv_lims[0] is None:
cbv_lims[0] = 0
if cbv_lims[1] is None:
cbv_lims[1] = cbv.max()

if cbv is not None:
if cbv_lims[0] is None:
cbv_lims[0] = 0
if cbv_lims[1] is None:
cbv_lims[1] = cbv.max()

customdata = np.zeros(plotting_shape)
line_color = np.zeros((plotting_shape, 3))
color_constant = (color / color.max())\
Expand Down
Loading