How to realign PATCH object along with plotted 3D GRAPH network?
Mostrar comentarios más antiguos
I try to plot a 3d graph network over a loaded STL object to enhanced visualization. I would like to know if I can move and rotate the plotted PATCH object to align perfectly under plotted scalph graph network?
Here is a list of function I used in the script:
- EEGLAB for getting EEG.chanlocs (electrode position) for plotting graph network, this value is constant for all plot.
- STL File Reader by Eric Johnson for import 3d brain file
Here is my code so far:
W1 = threshold_proportional(plv, 0.2); % thresholding for PLV
W2 = threshold_proportional(pliComputed, 0.2); % thresholding for PLI
W3 = threshold_proportional(PTE,0.2); % thresholding for PTE
W4 = threshold_proportional(dPTE,0.2); % thresholding for dPTE
w = W1; % change data here
st = sum(w,2); % compute network strength
[links,wij,rgb] = convMatrixGraph(w); % compute plotting parameters
figure
hold on;
for ll = 1 : length(links) %% plotting links
line([EEG.chanlocs(links(ll,1)).X, EEG.chanlocs(links(ll,2)).X], [EEG.chanlocs(links(ll,1)).Y, EEG.chanlocs(links(ll,2)).Y], [EEG.chanlocs(links(ll,1)).Z, EEG.chanlocs(links(ll,2)).Z], 'LineWidth', wij(ll), 'Color', rgb(ll,:) );
end
colormap(jet);
% colorbar
for nn = 1 : 32 %% plotting nodes
plot3(EEG.chanlocs(nn).X, EEG.chanlocs(nn).Y, EEG.chanlocs(nn).Z, 'ro', 'MarkerSize', st(nn), 'MarkerFaceColor', 'y')
text(EEG.chanlocs(nn).X+0.5, EEG.chanlocs(nn).Y, EEG.chanlocs(nn).Z, EEG.chanlocs(nn).labels, 'FontSize', 11);
end
% read brain model file
fv = stlread('brain.stl');
%% Render
% The model is rendered with a PATCH graphics object. We also add some dynamic
% lighting, and adjust the material properties to change the specular
% highlighting.
patch(fv,'FaceColor', [0.8 0.8 1.0], ...
'EdgeColor', 'none', ...
'FaceLighting', 'gouraud', ...
'AmbientStrength', 0.15, ...
'FaceAlpha', 0.07);
% Add a camera light, and tone down the specular highlighting
camlight('headlight');
material('dull');
% Fix the axes scaling, and set a nice view angle
axis('image');
view([-135 35]);
% view([270 90]); %% rotating to vertical view
axis equal; axis off;
title('test mapping 3D')
set(gcf, 'units','normalized','outerposition',[0 0 1 1]) %EXPANDING FIGURE ON SCREEN
Here is the current result and how I would like to move it:
Top view & side & front view



My expected result:

to rotate, move under the plotted graph and enlarge to fit the scale. The brain model is set to semi-transparent also to see the line connection.
Any help would be greatly appreciate, thank you.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Object Containers en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!