Skip to content

Instantly share code, notes, and snippets.

@johncolby
Created April 26, 2011 17:33
Show Gist options
  • Save johncolby/942711 to your computer and use it in GitHub Desktop.
Save johncolby/942711 to your computer and use it in GitHub Desktop.
Tweak to trk_plot to highlight different levels
diff --git a/trk_plot.m b/trk_plot.m
index 30e0a4a..26cf093 100644
--- a/trk_plot.m
+++ b/trk_plot.m
@@ -37,6 +37,9 @@ if nargin < 4 || isempty(slices), slices = header.dim/2; end
if ~isstruct(tracks), error('Tracks must be in structure form. Try running TRK_RESTRUC first.'), end
+levels = [0 25 50 75 100];^M
+levels = round(levels*(97-1)/100 + 1);^M
+^M
% Plot streamlines
hold on
for iTrk = 1:length(tracks)
@@ -46,8 +49,11 @@ for iTrk = 1:length(tracks)
if strcmp(plottype, 'rainbow')
cline(matrix(:,1), matrix(:,2), matrix(:,3), (0:(size(matrix, 1)-1))/size(matrix, 1))
else
- plot3(matrix(:,1), matrix(:,2), matrix(:,3))
- plot3(matrix(1,1), matrix(1,2), matrix(1,3), 'r.')
+ %plot3(matrix(:,1), matrix(:,2), matrix(:,3))^M
+ %plot3(matrix(1,1), matrix(1,2), matrix(1,3), 'r.')^M
+ for i=1:length(levels)^M
+ plot3(matrix(levels(i),1), matrix(levels(i),2), matrix(levels(i),3), 'k.')^M
+ end^M
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment