From 1b00243cca008e2f48ba0d8d88fa4d375c561029 Mon Sep 17 00:00:00 2001 From: 36000 Date: Fri, 26 Aug 2022 16:03:18 -0700 Subject: [PATCH 01/15] unnecessary param --- AFQ/utils/volume.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/AFQ/utils/volume.py b/AFQ/utils/volume.py index 95e770da2..3568e7323 100644 --- a/AFQ/utils/volume.py +++ b/AFQ/utils/volume.py @@ -89,7 +89,7 @@ def patch_up_roi(roi, bundle_name="ROI", make_convex=True): return hole_filled -def density_map(tractogram, n_sls=None, to_vox=False, normalize=False): +def density_map(tractogram, n_sls=None, normalize=False): """ Create a streamline density map. based on: @@ -104,10 +104,6 @@ def density_map(tractogram, n_sls=None, to_vox=False, normalize=False): n_sls to randomly select to make the density map. If None, all streamlines are used. Default: None - to_vox : bool, optional - Whether to put the stateful tractogram in VOX space before making - the density map. - Default: False normalize : bool, optional Whether to normalize maximum values to 1. Default: False @@ -116,8 +112,7 @@ def density_map(tractogram, n_sls=None, to_vox=False, normalize=False): ------- Nifti1Image containing the density map. """ - if to_vox: - tractogram.to_vox() + tractogram.to_vox() sls = tractogram.streamlines if n_sls is not None: From 99e370640c676a69c2815e48502fd39290c347fc Mon Sep 17 00:00:00 2001 From: 36000 Date: Fri, 26 Aug 2022 16:03:44 -0700 Subject: [PATCH 02/15] add density maps per subject, group density, and example --- AFQ/api/group.py | 25 +++++++++++++++++++++++++ AFQ/tasks/segmentation.py | 22 ++++++++++++++++++++++ examples/plot_afq_callosal.py | 16 ++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 6c2afc6bd..6ddcfdede 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -776,6 +776,31 @@ def upload_to_s3(self, s3fs, remote_path): if op.exists(self.afqb_path): s3fs.put(self.afqb_path, remote_path, recursive=True) + def export_group_density(self): + """ + Generate a group density map by combining single subject density maps. + """ + densities = self.export("density_maps", collapse=False) + ex_density_img = densities[ + self.valid_sub_list[0]][ + self.valid_ses_list[0]] # for shape and affine + + group_density = np.zeros_like(ex_density_img.shape) + self.logger.info("Generating Group Density...") + for ii in tqdm(range(len(self.valid_ses_list))): + this_sub = self.valid_sub_list[ii] + this_ses = self.valid_ses_list[ii] + this_density = nib.load(densities[this_sub][this_ses]).get_fdata() + + group_density = group_density + this_density # TODO: more options here + + out_fname = op.abspath(op.join( + self.afq_path, + f"desc-density_subjects-all_space-MNI_dwi.nii.gz")) + nib.save(nib.Nifti1Image( + group_density, ex_density_img.affine), out_fname) + return out_fname + def assemble_AFQ_browser(self, output_path=None, metadata=None, page_title="AFQ Browser", page_subtitle="", page_title_link="", page_subtitle_link=""): diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index e5b48ecad..9c45d1e43 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -17,6 +17,7 @@ from AFQ.data.s3bids import write_json import AFQ.api.bundle_dict as abd import AFQ.utils.streamlines as aus +import AFQ.utils.volume as auv from dipy.io.streamline import load_tractogram, save_tractogram from dipy.io.stateful_tractogram import Space @@ -260,6 +261,26 @@ def export_bundle_lengths(data_imap, return counts_df, dict(sources=bundles_files) +@pimms.calc("density_maps") +@as_file('_desc-density_dwi.nii.gz', include_track=True, include_seg=True) +def export_density_maps(clean_bundles, dwi, data_imap): + """ + full path to 4d nifti file containing streamline counts per voxel + per bundle, where the 4th dimension encodes the bundle + """ + bundle_dict = data_imap["bundle_dict"] + seg_sft = aus.SegmentedSFT.fromfile( + clean_bundles) + entire_density_map = np.zeros((*nib.load(dwi).shape, len(bundle_dict))) + for bundle_name in bundle_dict.keys(): + bundle_sl = seg_sft.get_bundle(bundle_name) + bundle_density = auv.density_map(bundle_sl).get_fdata() + entire_density_map[..., :] = bundle_density + + return entire_density_map, dict( + source=clean_bundles, bundles=list(bundle_dict.keys())) + + @pimms.calc("profiles") @as_file('_desc-profiles_dwi.csv', include_track=True, include_seg=True) def tract_profiles(clean_bundles, data_imap, @@ -394,6 +415,7 @@ def get_segmentation_plan(kwargs): export_sl_counts, export_bundle_lengths, export_bundles, + export_density_maps, clean_bundles, segment, tract_profiles]) diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index 1dbebea3e..9af5404e0 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -6,6 +6,8 @@ http://hdl.handle.net/1773/34926 """ import os.path as op +import matplotlib.pyplot as plt +import nibabel as nib import plotly @@ -74,6 +76,20 @@ myafq.export_all() +########################################################################## +# Create Group Density Maps: +# ------------------------- +# +# pyAFQ can make density maps of streamline counts per subject/session +# by doing myafq.export("density_map") . When using GroupAFQ, you can also +# combine these into one file by doing myafq.export_group_density() . +group_density = myafq.export_group_density() +group_density = nib.load(group_density).get_fdata() +fig, ax = plt.subplots(1) +ax.matshow(group_density[:, :, group_density.shape[-1] // 2], cmap='viridis') +ax.axis("off") + + ########################################################################## # Visualizing bundles and tract profiles: # --------------------------------------- From 9b564e058ae6a93453f86891a18862f565f5264b Mon Sep 17 00:00:00 2001 From: 36000 Date: Fri, 26 Aug 2022 16:27:38 -0700 Subject: [PATCH 03/15] update group density parameters --- AFQ/api/group.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 6ddcfdede..077682990 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -776,9 +776,19 @@ def upload_to_s3(self, s3fs, remote_path): if op.exists(self.afqb_path): s3fs.put(self.afqb_path, remote_path, recursive=True) - def export_group_density(self): + def export_group_density(self, boolify=True): """ Generate a group density map by combining single subject density maps. + + Parameters + ---------- + boolify : bool + Whether to turn subject streamline count images into booleans + before adding them into the group density map. + + Return + ------ + Path to density nifti file. """ densities = self.export("density_maps", collapse=False) ex_density_img = densities[ @@ -791,8 +801,10 @@ def export_group_density(self): this_sub = self.valid_sub_list[ii] this_ses = self.valid_ses_list[ii] this_density = nib.load(densities[this_sub][this_ses]).get_fdata() + if boolify: + this_density = this_density.astype(bool) - group_density = group_density + this_density # TODO: more options here + group_density = group_density + this_density out_fname = op.abspath(op.join( self.afq_path, From 14047f02535fea75fd4239b7f9b8f09ba378d134 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 11 Oct 2022 11:20:55 -0700 Subject: [PATCH 04/15] update these examples --- examples/plot_callosal_tract_profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/plot_callosal_tract_profile.py b/examples/plot_callosal_tract_profile.py index 3acc634f3..2968cedf5 100644 --- a/examples/plot_callosal_tract_profile.py +++ b/examples/plot_callosal_tract_profile.py @@ -331,7 +331,7 @@ save_tractogram(tractogram, op.join(working_dir, 'dti_streamlines.trk'), bbox_valid_check=False) - tractogram_img = density_map(tractogram, n_sls=1000, to_vox=True) + tractogram_img = density_map(tractogram, n_sls=1000) nib.save(tractogram_img, op.join(working_dir, 'afq_dti_density_map.nii.gz')) else: @@ -402,7 +402,7 @@ save_tractogram(tractogram, op.join(working_dir, f'afq_{bundle}_seg.trk'), bbox_valid_check=False) - tractogram_img = density_map(tractogram, n_sls=1000, to_vox=True) + tractogram_img = density_map(tractogram, n_sls=1000) nib.save(tractogram_img, op.join(working_dir, f'afq_{bundle}_seg_density_map.nii.gz')) show_anatomical_slices(tractogram_img.get_fdata(), @@ -448,7 +448,7 @@ save_tractogram(tractogram, op.join(working_dir, f'afq_{bundle}.trk'), bbox_valid_check=False) - tractogram_img = density_map(tractogram, n_sls=1000, to_vox=True) + tractogram_img = density_map(tractogram, n_sls=1000) nib.save(tractogram_img, op.join(working_dir, f'afq_{bundle}_density_map.nii.gz')) show_anatomical_slices(tractogram_img.get_fdata(), From fa672664dc6841469ec1f817ced1cec8d8d28027 Mon Sep 17 00:00:00 2001 From: 36000 Date: Wed, 12 Oct 2022 10:27:06 -0700 Subject: [PATCH 05/15] typos --- AFQ/tasks/segmentation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index 9c45d1e43..4b1d75840 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -271,11 +271,11 @@ def export_density_maps(clean_bundles, dwi, data_imap): bundle_dict = data_imap["bundle_dict"] seg_sft = aus.SegmentedSFT.fromfile( clean_bundles) - entire_density_map = np.zeros((*nib.load(dwi).shape, len(bundle_dict))) - for bundle_name in bundle_dict.keys(): + entire_density_map = np.zeros((*nib.load(dwi).shape[:3], len(bundle_dict))) + for ii, bundle_name in enumerate(bundle_dict.keys()): bundle_sl = seg_sft.get_bundle(bundle_name) bundle_density = auv.density_map(bundle_sl).get_fdata() - entire_density_map[..., :] = bundle_density + entire_density_map[..., ii] = bundle_density return entire_density_map, dict( source=clean_bundles, bundles=list(bundle_dict.keys())) From 4421ae5f74cf638ff5e68d36145a4d3b555f94e6 Mon Sep 17 00:00:00 2001 From: 36000 Date: Thu, 13 Oct 2022 08:46:17 -0700 Subject: [PATCH 06/15] add numpy as file support --- AFQ/tasks/decorators.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/AFQ/tasks/decorators.py b/AFQ/tasks/decorators.py index 40a395af2..3a6c23652 100644 --- a/AFQ/tasks/decorators.py +++ b/AFQ/tasks/decorators.py @@ -130,16 +130,18 @@ def wrapper_as_file(*args, **kwargs): tracking_params=tracking_params, segmentation_params=segmentation_params) if not op.exists(this_file): - img_trk_or_csv, meta = func(*args[:og_arg_count], **kwargs) + img_trk_np_or_csv, meta = func(*args[:og_arg_count], **kwargs) logger.info(f"Saving {this_file}") - if isinstance(img_trk_or_csv, nib.Nifti1Image): - nib.save(img_trk_or_csv, this_file) - elif isinstance(img_trk_or_csv, StatefulTractogram): + if isinstance(img_trk_np_or_csv, nib.Nifti1Image): + nib.save(img_trk_np_or_csv, this_file) + elif isinstance(img_trk_np_or_csv, StatefulTractogram): save_tractogram( - img_trk_or_csv, this_file, bbox_valid_check=False) + img_trk_np_or_csv, this_file, bbox_valid_check=False) + elif isinstance(img_trk_np_or_csv, np.ndarray): + np.save(this_file, img_trk_np_or_csv) else: - img_trk_or_csv.to_csv(this_file) + img_trk_np_or_csv.to_csv(this_file) if include_seg: meta["dependent"] = "rec" From 5ca7b329717456d23f506b147cfb3988f121374e Mon Sep 17 00:00:00 2001 From: 36000 Date: Fri, 4 Nov 2022 11:16:51 -0700 Subject: [PATCH 07/15] bf --- AFQ/api/group.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 077682990..6e74a30c2 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -791,11 +791,11 @@ def export_group_density(self, boolify=True): Path to density nifti file. """ densities = self.export("density_maps", collapse=False) - ex_density_img = densities[ + ex_density_img = nib.load(densities[ self.valid_sub_list[0]][ - self.valid_ses_list[0]] # for shape and affine + self.valid_ses_list[0]]) # for shape and affine - group_density = np.zeros_like(ex_density_img.shape) + group_density = np.zeros_like(ex_density_img.get_fdata().shape) self.logger.info("Generating Group Density...") for ii in tqdm(range(len(self.valid_ses_list))): this_sub = self.valid_sub_list[ii] From 938719a2814fa19be957dc0e9037e98bbfe5f4b3 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 8 Nov 2022 10:48:39 -0800 Subject: [PATCH 08/15] finally get this working --- AFQ/api/group.py | 11 +++++------ AFQ/tasks/segmentation.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 6e74a30c2..0a1b5c872 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -791,16 +791,16 @@ def export_group_density(self, boolify=True): Path to density nifti file. """ densities = self.export("density_maps", collapse=False) - ex_density_img = nib.load(densities[ + ex_density_init = np.load(densities[ self.valid_sub_list[0]][ - self.valid_ses_list[0]]) # for shape and affine + self.valid_ses_list[0]]) # for shape - group_density = np.zeros_like(ex_density_img.get_fdata().shape) + group_density = np.zeros_like(ex_density_init) self.logger.info("Generating Group Density...") for ii in tqdm(range(len(self.valid_ses_list))): this_sub = self.valid_sub_list[ii] this_ses = self.valid_ses_list[ii] - this_density = nib.load(densities[this_sub][this_ses]).get_fdata() + this_density = np.load(densities[this_sub][this_ses]) if boolify: this_density = this_density.astype(bool) @@ -809,8 +809,7 @@ def export_group_density(self, boolify=True): out_fname = op.abspath(op.join( self.afq_path, f"desc-density_subjects-all_space-MNI_dwi.nii.gz")) - nib.save(nib.Nifti1Image( - group_density, ex_density_img.affine), out_fname) + np.save(out_fname, group_density) return out_fname def assemble_AFQ_browser(self, output_path=None, metadata=None, diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index 4b1d75840..badb2b320 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -262,7 +262,7 @@ def export_bundle_lengths(data_imap, @pimms.calc("density_maps") -@as_file('_desc-density_dwi.nii.gz', include_track=True, include_seg=True) +@as_file('_desc-density_dwi.npy', include_track=True, include_seg=True) def export_density_maps(clean_bundles, dwi, data_imap): """ full path to 4d nifti file containing streamline counts per voxel From 6dca40fb5ebf2ae95094aa711853e206704eca87 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 8 Nov 2022 14:59:04 -0800 Subject: [PATCH 09/15] update example --- examples/plot_afq_callosal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index 9af5404e0..ae9fcadf9 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -7,7 +7,7 @@ """ import os.path as op import matplotlib.pyplot as plt -import nibabel as nib +import numpy as np import plotly @@ -84,7 +84,7 @@ # by doing myafq.export("density_map") . When using GroupAFQ, you can also # combine these into one file by doing myafq.export_group_density() . group_density = myafq.export_group_density() -group_density = nib.load(group_density).get_fdata() +group_density = np.load(group_density) fig, ax = plt.subplots(1) ax.matshow(group_density[:, :, group_density.shape[-1] // 2], cmap='viridis') ax.axis("off") From ff26ed2cf1007919ff6cb9d2f500d27325fc8de2 Mon Sep 17 00:00:00 2001 From: 36000 Date: Thu, 10 Nov 2022 09:36:10 -0800 Subject: [PATCH 10/15] one more nii.gz to npy fix --- AFQ/api/group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index 0a1b5c872..a7fd3e1fc 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -808,7 +808,7 @@ def export_group_density(self, boolify=True): out_fname = op.abspath(op.join( self.afq_path, - f"desc-density_subjects-all_space-MNI_dwi.nii.gz")) + f"desc-density_subjects-all_space-MNI_dwi.npy")) np.save(out_fname, group_density) return out_fname From 0a968a77e6b4d917a526823f8da7d1a91bb259b6 Mon Sep 17 00:00:00 2001 From: 36000 Date: Thu, 10 Nov 2022 13:08:10 -0800 Subject: [PATCH 11/15] fix matshow here --- examples/plot_afq_callosal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index ae9fcadf9..81b9ea89a 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -86,7 +86,9 @@ group_density = myafq.export_group_density() group_density = np.load(group_density) fig, ax = plt.subplots(1) -ax.matshow(group_density[:, :, group_density.shape[-1] // 2], cmap='viridis') +ax.matshow( + group_density[:, :, group_density.shape[-1] // 2, 0], + cmap='viridis') ax.axis("off") From c157d47010fdf406d0314f71a467e20064bdc67e Mon Sep 17 00:00:00 2001 From: 36000 Date: Fri, 11 Nov 2022 08:07:47 -0800 Subject: [PATCH 12/15] change this to .nii.gz --- AFQ/api/group.py | 18 ++++++++++++------ AFQ/tasks/segmentation.py | 2 +- examples/plot_afq_callosal.py | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/AFQ/api/group.py b/AFQ/api/group.py index a7fd3e1fc..2e79592b4 100644 --- a/AFQ/api/group.py +++ b/AFQ/api/group.py @@ -791,25 +791,31 @@ def export_group_density(self, boolify=True): Path to density nifti file. """ densities = self.export("density_maps", collapse=False) - ex_density_init = np.load(densities[ + ex_density_init = nib.load(densities[ self.valid_sub_list[0]][ - self.valid_ses_list[0]]) # for shape + self.valid_ses_list[0]]) # for shape and header - group_density = np.zeros_like(ex_density_init) + group_density = np.zeros_like(ex_density_init.get_fdata()) self.logger.info("Generating Group Density...") for ii in tqdm(range(len(self.valid_ses_list))): this_sub = self.valid_sub_list[ii] this_ses = self.valid_ses_list[ii] - this_density = np.load(densities[this_sub][this_ses]) + this_density = nib.load(densities[this_sub][this_ses]).get_fdata() if boolify: this_density = this_density.astype(bool) group_density = group_density + this_density + group_density = group_density / len(self.valid_sub_list) + group_density = nib.Nifti1Image( + group_density, + ex_density_init.affine, + header=ex_density_init.header + ) out_fname = op.abspath(op.join( self.afq_path, - f"desc-density_subjects-all_space-MNI_dwi.npy")) - np.save(out_fname, group_density) + f"desc-density_subjects-all_space-MNI_dwi.nii.gz")) + nib.save(group_density, out_fname) return out_fname def assemble_AFQ_browser(self, output_path=None, metadata=None, diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index badb2b320..4b1d75840 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -262,7 +262,7 @@ def export_bundle_lengths(data_imap, @pimms.calc("density_maps") -@as_file('_desc-density_dwi.npy', include_track=True, include_seg=True) +@as_file('_desc-density_dwi.nii.gz', include_track=True, include_seg=True) def export_density_maps(clean_bundles, dwi, data_imap): """ full path to 4d nifti file containing streamline counts per voxel diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index 81b9ea89a..9df5ef3ff 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -7,7 +7,7 @@ """ import os.path as op import matplotlib.pyplot as plt -import numpy as np +import nibabel as nib import plotly @@ -84,7 +84,7 @@ # by doing myafq.export("density_map") . When using GroupAFQ, you can also # combine these into one file by doing myafq.export_group_density() . group_density = myafq.export_group_density() -group_density = np.load(group_density) +group_density = nib.load(group_density).get_fdata() fig, ax = plt.subplots(1) ax.matshow( group_density[:, :, group_density.shape[-1] // 2, 0], From 0904b30db2064d59748de6058cb14d0082cb3087 Mon Sep 17 00:00:00 2001 From: 36000 Date: Sat, 19 Nov 2022 11:01:10 -0800 Subject: [PATCH 13/15] this should do it --- AFQ/tasks/segmentation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index 4b1d75840..3fc54e5d7 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -8,7 +8,7 @@ import pimms -from AFQ.tasks.decorators import as_file +from AFQ.tasks.decorators import as_file, as_img from AFQ.tasks.utils import get_fname, with_name, str_to_desc import AFQ.segmentation as seg from AFQ.utils.path import drop_extension @@ -263,6 +263,7 @@ def export_bundle_lengths(data_imap, @pimms.calc("density_maps") @as_file('_desc-density_dwi.nii.gz', include_track=True, include_seg=True) +@as_img def export_density_maps(clean_bundles, dwi, data_imap): """ full path to 4d nifti file containing streamline counts per voxel From e3f942f912c513aa50cbbb1de8a5521492c29f48 Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Sat, 19 Nov 2022 16:57:57 -0800 Subject: [PATCH 14/15] Update examples/plot_afq_callosal.py --- examples/plot_afq_callosal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index 9df5ef3ff..608ea5f92 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -81,7 +81,7 @@ # ------------------------- # # pyAFQ can make density maps of streamline counts per subject/session -# by doing myafq.export("density_map") . When using GroupAFQ, you can also +# by calling `myafq.export("density_map")`. When using `GroupAFQ`, you can also # combine these into one file by doing myafq.export_group_density() . group_density = myafq.export_group_density() group_density = nib.load(group_density).get_fdata() From 5faa426e4314c887b6a84d0787d176f089ee2afe Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Sat, 19 Nov 2022 16:58:05 -0800 Subject: [PATCH 15/15] Update examples/plot_afq_callosal.py --- examples/plot_afq_callosal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/plot_afq_callosal.py b/examples/plot_afq_callosal.py index 608ea5f92..110b7237e 100644 --- a/examples/plot_afq_callosal.py +++ b/examples/plot_afq_callosal.py @@ -82,7 +82,7 @@ # # pyAFQ can make density maps of streamline counts per subject/session # by calling `myafq.export("density_map")`. When using `GroupAFQ`, you can also -# combine these into one file by doing myafq.export_group_density() . +# combine these into one file by calling `myafq.export_group_density()`. group_density = myafq.export_group_density() group_density = nib.load(group_density).get_fdata() fig, ax = plt.subplots(1)