Adding color property to fcsv files created in matlab

Hi all,

In Matlab, I have a function to create .fcsv files to visualize my recording sites in Slicer. Now, I want to be able to add color property to the each recording site.
I cannot do this manually using Markups module, since I have 100’s of recording sites, and also I want to be able to use continuous color coding.

How can achieve this ? I can also create another that stores color information; I don’t have to store it in the fcsv file. I can also use Python if that is what is needed.

Thanks a lot !

fid = fopen([name2save ‘.fcsv’],‘w’);
%fprintf(fid,‘# Markups fiducial file version = 4.10 \n’);
fprintf(fid,‘# Markups fiducial file version = 4.11 \n’);
fprintf(fid,‘# CoordinateSystem = RAS \n’);
fprintf(fid,‘# columns = id,x,y,z,ow,ox,oy,oz,Vis,Sel,Lock,Name,Description \n’);
% id x y z owoxoyozV S L N Desc
fprintf(fid,‘id_%i,%f,%f,%f,0,0,0,1,1,0,1,%i,electrode%i \r\n’,pp’);
fid=fclose(fid);

You should use JSON format for markups if you want the individual files to retain the color property.

1 Like

I see, if my understanding is right, this the related documentation ?

https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html#markups

Thanks a lot ! (Tesekkurler :slight_smile: )

You can find the full schema here; Slicer/Modules/Loadable/Markups/Resources/Schema/markups-schema-v1.0.3.json at main · Slicer/Slicer · GitHub

display color is the property you will need to set.

1 Like