[caret-users] Palette editing
Donna Dierker
donna at brainvis.wustl.edu
Fri May 9 08:47:09 CDT 2008
Hi Alex,
What you describe is more like what we call a ROI paint volume, like the
AAL map shown here:
http://http://www.sph.sc.edu/comd/rorden/template.htmlwww.sph.sc.edu/comd/rorden/template.html
When you map in Caret, you have the option of mapping functional as
metric, or Paint (ROI); you want the latter.
The tricky bit is that NIfTI (to my imperfect knowledge) doesn't yet
support incoding of ROI lookup tables. (John will correct me if I'm
wrong.) The only two ways I know to do this, using Caret, are with
WUNIL 4dfp ifh files, or with AFNI volumes, using a VElab (non-standard)
LUT tag in the HEAD file. An example of the latter is in the Sept 2006
tutorial dataset http://sumsdb.wustl.edu/sums/directory.do?id=6585200):
CARET_TUTORIAL_SEPT06/PALS_B12.B1-12.BOTH-HEMS.PROB-ATLAS_IDsulci.paint.align_222+orig.HEAD
type = string-attribute
name = LUT_NAMES
count = 423
'???~???_not_used~GYRAL~SUL.STS~SUL.AS~SUL.SF~SUL.ITS~SUL.PoCeS~SUL.PoSubCeS~SUL.CeS~SUL.I
PrCeS~SUL.pITS~SUL~SUL.IFS~SUL.IPS~SUL.AOS~SUL.OTS~CENTRAL~SUL.intFS~SUL.SPrCeS~SUL.FOS~SU
L.MFS~SUL.TOrbS~SUL.LOS~SUL.FMS~SUL.SFS~SUL.CoS~SUL.TOS~SUL.SupPS~SUL.RhS~CALCARINE~MEDIAL
.WALL~SUL.CaSd~SUL.OrbS~SUL.HF~SUL.CaSv~SUL.POS~SUL.CiSmr~SUL.CiS~SUL.SSS~SUL.SubPS~SUL.Ol
fS~SUL.ILS~SUL.SRS~SUL.ISS~SUL.MPrCeS~SUL.PaCeS~SUL.IRS~SUL.LuS~
Here, the ordinal position of the ROI/paint name corresponds to the
intensity value in the volume.
You then map these paint names to RGB colors using an ordinary Caret
area color file.
Donna
On 05/08/2008 10:44 AM, Alex Fornito wrote:
> Hi,
> Thanks for the feedback, although I need it to overlay a volume on the
> surface. I essentially have a volume-based template comprising several
> thousand ROIs, with each ROI being assigned a distinct 'intensity'. I have
> imported the volume-based template into Caret as a metric file, and would
> like to be able to visualize it such that each volume 'intensity'
> (corresponding to a different ROI) is a different colour.
> I imagine the appearance would be much like the image you sent, but somewhat
> coarser, since its not a nodal resolution.
> >From what I understand, a paint file can't be used to colour code a metric
> file?
> Is there another way of achieving my goal that I'm unaware of?
>
> Thanks again,
> Alex
>
>
>
> On 06/05/2008 15:13, "John Harwell" <john at brainvis.wustl.edu> wrote:
>
>
>> Alex,
>>
>> If you generated a palette file with that many colors I think it would
>> be slow to load and slot to make the color assignments. A better
>> alternative is to use this python script to generate an RGB paint file
>> containing random colors. You will need to adjust the "numberOfNodes"
>> variable in the script to match your dataset.
>>
>> ------------------------------------------------------------------------------
>> ----------------------------
>>
>> #!/usr/bin/python
>> #
>> # Create an RGB paint file with random colors
>> #
>> import os
>> import random
>> import sys
>>
>> #
>> # Name of RGB Paint file and number of nodes in the file
>> #
>> rgbPaintFileName = "random.RGB_paint"
>> numberOfNodes = 71723
>>
>> #
>> # Create an RGB paint file with random colors
>> #
>> file = open(rgbPaintFileName, 'w')
>> file.write("tag-version " + str(2) + "\n")
>> file.write("tag-number-of-nodes " + str(numberOfNodes) + "\n")
>> file.write("tag-number-of-columns " + str(1) + "\n")
>> file.write("tag-BEGIN-DATA\n");
>> for i in range(numberOfNodes):
>> node = str(i)
>> red = str(random.random() * 255.0)
>> green = str(random.random() * 255.0)
>> blue = str(random.random() * 255.0)
>> line = node + " " + red + " " + green + " " + blue + "\n"
>> file.write(line)
>>
>> file.close()
>>
>> ------------------------------------------------------------------------------
>> ----------------------------
>>
>>
>>
>>
>> -----------------------------------
>> John Harwell
>> john at brainvis.wustl.edu
>>
>> Department of Anatomy and Neurobiology
>> Washington University School of Medicine
>> 660 S. Euclid Ave Box 8108
>> Saint Louis, MO 63110
>>
>>
>>
>>
>> On May 6, 2008, at 4:46 AM, Alex Fornito wrote:
>>
>>> Hi,
>>> I need to generate a custom palette for viewing some masks. I need
>>> it to
>>> contain 5000-10000 colours, in no particular order or pattern. I.e.,
>>> they
>>> can be random, they just need to provide some kind of visual
>>> distinction
>>> between 5000-10000 points on the cortical surface. I can see how to
>>> manually
>>> edit palettes, but it does not seem feasible to repeat the process
>>> 1000s of
>>> times. Is there a simple way to generate a palette with several
>>> 1000s of
>>> random colours so that it can be used in Caret?
>>> Thanks for your help,
>>> Alex
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> caret-users mailing list
>>> caret-users at brainvis.wustl.edu
>>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>>
>>>
>> _______________________________________________
>> caret-users mailing list
>> caret-users at brainvis.wustl.edu
>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>
>
>
More information about the caret-users
mailing list