# Adding color property to fcsv files created in matlab

**URL:** <https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984>\
**Category:** Support\
**Created:** [March 19, 2024, 7:50pm UTC](https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984 "2024-03-19T19:50:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FatihSogukpinar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fatihsogukpinar/32/7257_2.png) [@FatihSogukpinar](https://discourse.slicer.org/u/FatihSogukpinar)\
**Post date:** [March 19, 2024, 7:50pm UTC](https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984/1 "2024-03-19T19:50:41Z")

</div>

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);

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 19, 2024, 7:54pm UTC](https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984/2 "2024-03-19T19:54:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![FatihSogukpinar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fatihsogukpinar/32/7257_2.png) [@FatihSogukpinar](https://discourse.slicer.org/u/FatihSogukpinar)\
**Post date:** [March 19, 2024, 8:05pm UTC](https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984/3 "2024-03-19T20:05:16Z")

</div>

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

[https://slicer.readthedocs.io/en/latest/developer\_guide/modules/markups.html#markups](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html#markups)

Thanks a lot ! (Tesekkurler 🙂 )

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 19, 2024, 8:38pm UTC](https://discourse.slicer.org/t/adding-color-property-to-fcsv-files-created-in-matlab/34984/4 "2024-03-19T20:38:36Z")

</div>

You can find the full schema here; [Slicer/Modules/Loadable/Markups/Resources/Schema/markups-schema-v1.0.3.json at main · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/blob/main/Modules/Loadable/Markups/Resources/Schema/markups-schema-v1.0.3.json)

display color is the property you will need to set.
