Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Path Length Map example #1631
referenced this pull request
Sep 4, 2018
@@ Coverage Diff @@ ## master #1631 +/- ## ======================================= Coverage 87.34% 87.34% ======================================= Files 246 246 Lines 32265 32265 Branches 3504 3504 ======================================= Hits 28182 28182 Misses 3247 3247 Partials 836 836
Here's a good reference for why `jet` is not a great color-map: https://jakevdp.github.io/blog/2014/10/16/how-bad-is-your-colormap/…
On Sat, Sep 8, 2018 at 11:00 AM Serge Koudoro ***@***.***> wrote: ***@***.**** commented on this pull request. Nice Tutorial, Thank you @kesshijordan <https://github.com/kesshijordan>. I just had a couple of questions. Otherwise, Can you rebase this PR. ------------------------------ In doc/examples/path_length_map.py <#1631 (comment)>: > + +from dipy.data import read_stanford_labels, fetch_stanford_t1 +from dipy.reconst.shm import CsaOdfModel +from dipy.data import default_sphere +from dipy.direction import peaks_from_model +from dipy.tracking.local import ThresholdTissueClassifier +from dipy.tracking import utils +from dipy.tracking.local import LocalTracking +from dipy.tracking.streamline import Streamlines +from dipy.viz import actor, window +from dipy.viz.colormap import line_colors +from dipy.tracking.utils import path_length +import nibabel as nib +import numpy as np +import os +import nilearn.plotting as nip Is it possible to change your plotting tool? Indeed, I do not think we want to add a new library for the doc generation. ------------------------------ In doc/examples/path_length_map.py <#1631 (comment)>: > +streamlines_actor = actor.line(streamlines, line_colors(streamlines)) +surface_opacity = 0.5 +surface_color = [0, 1, 1] +seedroi_actor = actor.contour_from_roi(seed_mask, affine, + surface_color, surface_opacity) + +ren = window.ren() +ren.add(streamlines_actor) +ren.add(seedroi_actor) + +""" +If you set interactive to True (below), the rendering will pop up in an +interactive window. +""" + +interactive = False # this works if it's True but black if False?? but black if False?? What do you mean here? I believe the window just do not appear ------------------------------ In doc/examples/path_length_map.py <#1631 (comment)>: > +path_length_map_base_roi = seed_mask + +# calculate the WMPL + +wmpl = path_length(streamlines, path_length_map_base_roi, affine) + +# save the WMPL as a nifti +path_length_img = nib.Nifti1Image(wmpl.astype(np.float32), affine) +nib.save(path_length_img, 'example_cc_path_length_map.nii.gz') + +# generate display of Path Length map using Nilearn +t1_path = os.path.join(fetch_stanford_t1(), 't1.nii.gz') +nip.plot_stat_map('example_cc_path_length_map.nii.gz', + output_file='Path_Length_Map.png', + bg_img=t1_path, symmetric_cbar=False, + cmap='jet', threshold=1) jet colormap should be avoided apparently. I need to find a good article which explains why. Can you replace it? — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#1631 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAHPNkw3PofkH4lcyN2ay-q_ozcetIJSks5uZAXSgaJpZM4WYapf> .
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews.