[Eeglablist] change individual IC color in clustered 3D image

shirazi at ieee.org shirazi at ieee.org
Tue Dec 4 15:35:08 PST 2018


Hi Anderson

 

You may need to tweak the “std_dipplot” a little. As I just looked into the function, if you want to plot clusters with their respective dipoles, you will stay in the main function (std_dipplot).

The function has a gigantic for loop from line 232 to 303 (I’m on eeglab ver 14.1.2b). The loop plots each cluster (for N clusters) at a time and the centroid of the cluster actually is the last dipole of the cluster. On the line 263 you’ll see that it is saving a cell string (dip_color(1:end-1) = {‘b’}), telling the “dipplot” function (which plots the dipoles) that every dipole should be blue, except the last one which is the centroid. You can substitute the right hand side of this line with your cell array that specify color for each individual dipole.

The cell array for color can look like: { ‘b’ ‘r’ ‘c' …} or you can use color triplets as M*3 arrays (M is the number of dipoles, equal to 1:end-1), and use num2cell(M*3,2) to create your cell array.

 

If you have multiple clusters, I’m sure you can add an input to the main function to account for that as well.

 

Hope it helps.

 

Best

Seyed

--

Seyed Yahya Shirazi, M.Sc.

BRaIN Lab

Universtiy of Central Florida

 <mailto:shirazi at ieee.org> shirazi at ieee.org

 

 

 

From: Anderson de Souza Castelo Oliveira <oliveira at mp.aau.dk> 
Sent: Tuesday, December 4, 2018 3:27 AM
To: Ramón Martinez <nucleuscub at gmail.com>
Cc: eeglablist at sccn.ucsd.edu
Subject: Re: [Eeglablist] change individual IC color in clustered 3D image

 

Dear Ramon,

 

Thanks for the recommendations. My question was related to changing the color of different specific dipoles from the same cluster (not different clusters with different colors). Is there a possibility to do it?

Best regards,

Anderson

 

From: Ramón Martinez <nucleuscub at gmail.com <mailto:nucleuscub at gmail.com> > 
Sent: 4. december 2018 00:36
To: Anderson de Souza Castelo Oliveira <oliveira at mp.aau.dk <mailto:oliveira at mp.aau.dk> >; EEGLAB List <eeglablist at sccn.ucsd.edu <mailto:eeglablist at sccn.ucsd.edu> >
Subject: Re: [Eeglablist] change individual IC color in clustered 3D image

 

Hi Anderson, 

 There are a couple of ways to do this.  See below two of them:

 

 Use std_dipplot.m from the command window (the easy way)

For this, you can use the following sample code.

 

STUDY = std_dipplot(STUDY, ALLEEG, 'clusters', [2 3], 'design',1, 'mode', 'multicolor');

 

 This will plot the clusters 2 and 3 using different colors. The colors here are defined in a list inside the function std_dipplot. But if you want to pass a new set of colors, then you may want to use the option 'dipcolor' in the same function. This will allow you to define a custom list of colors for each cluster.

 

 Command line code (the hard way)

Make sure to get the handle of the figure where dipoles are plotted. Click anywhere on your figure and then:

 h = gcf; % get handles of figure

hdipoles = findobj(h,'-regexp','Tag','dipole\w','Type','surface'); % Get dipole handles in the figure

set(hdipoles,'FaceColor', [0 1 1]); % Set color for dipoles (here [0 1 1] is fuccia)

 

Hope this helps,

Ramon

 

 

 

 

  

 

On Mon, Dec 3, 2018 at 12:08 PM Anderson de Souza Castelo Oliveira <oliveira at mp.aau.dk <mailto:oliveira at mp.aau.dk> > wrote:

Hi all,

 

I have been working on an analysis where I have some EEG clusters, and I’d like to use different colors to highlight two different “sub-samples” that I found in each cluster. Is there a way to change the color of the clustered ICs in the 3D view of the cluster (like in the figure I attached the link to: https://www.dropbox.com/s/fisjxwn5zdrm71s/Example_EEG.png?dl=0 )?

 

Thanks in advance,

Anderson

_______________________________________________
Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu <mailto:eeglablist-unsubscribe at sccn.ucsd.edu> 
For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu <mailto:eeglablist-request at sccn.ucsd.edu> 




 

-- 

_____________________________________________________

Ramon Martinez-Cancino

Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20181204/4b2b4ad8/attachment.html>


More information about the eeglablist mailing list