Hi,

I'm trying to create a CIFTI dlabel.nii file from a novel parcellation we have 
generated from a structural connectivity matrix. However, I seem to hit a 
problem when the number of new clusters is less than those present in the 
template CIFTI file I am using for its header-info. In this example below, I 
want to generate a dlabel file with 68 clusters using the Desikan-Killiany 
dlabel file as a skeleton.

Here are the commands I am using:

  wb_command -cifti-label-import 100307.aparc.32k_fs_LR.dlabel.nii  
CIFTI_LUT_ModelA_Clusters68.txt 
100307.aparc.32k_fs_LR_ButWithClusterLUT.dlabel.nii -drop-unused-labels

  wb_command -cifti-convert -from-text ClusterIDs_ModelA_Clusters68.txt 
100307.aparc.32k_fs_LR_ButWithClusterLUT.dlabel.nii 
ModelA_Clusters68.32k_fs_LR.dlabel.nii

  wb_command -set-map-names ModelA_Clusters68.32k_fs_LR.dlabel.nii -map 1 
ModelA_Clusters68

Where the two textfiles used are defined thus:

# CIFTI_LUT_ModelA_Clusters68.txt
A plain text file with lines:
Cluster_0001
1 85 85 0 255
Cluster_0002
2 85 170 0 255
Cluster_0003
3 85 255 0 255
etc

# ClusterIDs_ModelA_Clusters68.txt
A plain text file with lines:
48
23
34
19
etc

However, running the command:

    wb_command -file-information <CIFTI_ModelClusters_dlabel>

generates the following output:


Name:                    ModelA_Clusters68.32k_fs_LR.dlabel.nii
Type:                    Connectivity - Dense Label
Structure:               CortexLeft CortexRight
Data Size:               237.65 Kilobytes
Maps to Surface:         true
Maps to Volume:          false
Maps with LabelTable:    true
Maps with Palette:       false
Number of Maps:          1
Number of Rows:          59412
Number of Columns:       1
Volume Dim[0]:           0
Volume Dim[1]:           0
Volume Dim[2]:           0
Palette Type:            None
CIFTI Dim[0]:            1
CIFTI Dim[1]:            59412
ALONG_ROW map type:      LABELS
ALONG_COLUMN map type:   BRAIN_MODELS
Has Volume Data:     false
CortexLeft:          29696 out of 32492 vertices
CortexRight:         29716 out of 32492 vertices

Map   Map Name
 1   ModelA_Clusters68

Label table for ALL maps
  KEY   NAME                RED   GREEN    BLUE   ALPHA
0   ???                    1.000   1.000   1.000   0.000
1   Cluster_0001   0.333   0.333   0.000   1.000
2   Cluster_0002   0.333   0.667   0.000   1.000
...
68   Cluster_0068   1.000   1.000   1.000   1.000
69   LABEL_69         0.776   0.055   0.686   1.000
70   LABEL_70         0.196   0.569   0.169   1.000

As you can see, the original number of labels is somehow retained. And even 
though label values 69 and 70 are not present in the vertex:label mapping.
(If I use the 100307.aparc.a2009s.32k_fs_LR.dlabel.nii file as a template, then 
I get a label table with 150 entries, again with the first 68 being the new 
ones).

This is despite passing the '-drop-unused-labels' option to "wb_command 
-cifti-label-import”. (Not using ‘-drop-unused-labels’ gives the same result).

So somehow I need to fully purge the CIFTI template file of its original LUT 
when the number of clusters that I want to insert is less than was originally 
present in the file.
Any ideas? Is there a better way to do this?

Cheers,

M@
--
Matthew George Liptrot

<http://about.me/matthewliptrot>
Assistant Professor
Image Group
Department of Computer Science
University of Copenhagen
&
Section for Cognitive Systems
Department of Applied Mathematics and Computer Science
Technical University of Denmark

http://about.me/matthewliptrot


_______________________________________________
HCP-Users mailing list
[email protected]
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

Reply via email to