Dear Doug,

thank you, adding  --no-unknown indeed fixed the global shuffling of the label 
names. However, last line of .ctab seems not to be read this time and produced 
.annot does not contain perirhinal label.

My modified .ctab file looks like this:

 0  Unknown                           0   0   0    0
  1  G&S_frontomargin                 23 220  60    0
  2  G&S_occipital_inf                23  60 180    0
  3  G&S_paracentral                  63 100  60    0
  4  G&S_subcentral                   63  20 220    0
  5  G&S_transv_frontopol             13   0 250    0
  6  G&S_cingul-Ant                   26  60   0    0
  7  G&S_cingul-Mid-Ant               26  60  75    0
  8  G&S_cingul-Mid-Post              26  60 150    0
  9  G_cingul-Post-dorsal             25  60 250    0
 10  G_cingul-Post-ventral            60  25  25    0
 11  G_cuneus                        180  20  20    0
 12  G_front_inf-Opercular           220  20 100    0
 13  G_front_inf-Orbital             140  60  60    0
 14  G_front_inf-Triangul            180 220 140    0
 15  G_front_middle                  140 100 180    0
 16  G_front_sup                     180  20 140    0
 17  G_Ins_lg&S_cent_ins              23  10  10    0
 18  G_insular_short                 225 140 140    0
 19  G_occipital_middle              180  60 180    0
 20  G_occipital_sup                  20 220  60    0
 21  G_oc-temp_lat-fusifor            60  20 140    0
 22  G_oc-temp_med-Lingual           220 180 140    0
 23  G_oc-temp_med-Parahip            65 100  20    0
 24  G_orbital                       220  60  20    0
 25  G_pariet_inf-Angular             20  60 220    0
 26  G_pariet_inf-Supramar           100 100  60    0
 27  G_parietal_sup                  220 180 220    0
 28  G_postcentral                    20 180 140    0
 29  G_precentral                     60 140 180    0
 30  G_precuneus                      25  20 140    0
 31  G_rectus                         20  60 100    0
 32  G_subcallosal                    60 220  20    0
 33  G_temp_sup-G_T_transv            60  60 220    0
 34  G_temp_sup-Lateral              220  60 220    0
 35  G_temp_sup-Plan_polar            65 220  60    0
 36  G_temp_sup-Plan_tempo            25 140  20    0
 37  G_temporal_inf                  220 220 100    0
 38  G_temporal_middle               180  60  60    0
 39  Lat_Fis-ant-Horizont             61  20 220    0
 40  Lat_Fis-ant-Vertical             61  20  60    0
 41  Lat_Fis-post                     61  60 100    0
 42  Medial_wall                      25  25  25    0
 43  Pole_occipital                  140  20  60    0
 44  Pole_temporal                   220 180  20    0
 45  S_calcarine                      63 180 180    0
 46  S_central                       221  20  10    0
 47  S_cingul-Marginalis             221  20 100    0
 48  S_circular_insula_ant           221  60 140    0
 49  S_circular_insula_inf           221  20 220    0
 50  S_circular_insula_sup            61 220 220    0
 51  S_collat_transv_ant             100 200 200    0
 52  S_collat_transv_post             10 200 200    0
 53  S_front_inf                     221 220  20    0
 54  S_front_middle                  141  20 100    0
 55  S_front_sup                      61 220 100    0
 56  S_interm_prim-Jensen            141  60  20    0
 57  S_intrapariet&P_trans           143  20 220    0
 58  S_oc_middle&Lunatus             101  60 220    0
 59  S_oc_sup&transversal             21  20 140    0
 60  S_occipital_ant                  61  20 180    0
 61  S_oc-temp_lat                   221 140  20    0
 62  S_oc-temp_med&Lingual           141 100 220    0
 63  S_orbital_lateral               221 100  20    0
 64  S_orbital_med-olfact            181 200  20    0
 65  S_orbital-H_Shaped              101  20  20    0
 66  S_parieto_occipital             101 100 180    0
 67  S_pericallosal                  181 220  20    0
 68  S_postcentral                    21 140 200    0
 69  S_precentral-inf-part            21  20 240    0
 70  S_precentral-sup-part            21  20 200    0
 71  S_suborbital                     21  20  60    0
 72  S_subparietal                   101  60  60    0
 73  S_temporal_inf                   21 180 180    0
 74  S_temporal_sup                  223 220  60    0
 75  S_temporal_transverse           221  60  60    0
 76  entorhinal_exvivo.thresh        222  62  67    0
 77  perirhninal_exvivo.thresh       223  65  60    0

with newline in the end.

However, I was able to successfully generate annotation with 2 labels ( 
previous swap of names in .annot produced using --l options was my fault since 
I did not read the help to the detail to learn that the order of label files of 
--l arguments has to match the order of names in .ctab). So I could possibly 
achieve my goal by run mri_aparc2aseg on this simple 2-label annot and somehow 
merge the result with the default aparc.a2009s to bring the rhinal labels into 
that. Do you see any pitfall with that?

In any case, however, before running aparc2aseg I have to cope with another 
problem with rhinal labels - the rhinal.thresh labels are overlapping and I 
would need to correctly assign vertices in the label intersection (see my 
previous post 
http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg51919.html ).

Regards,

Antonin


Try adding --no-unknown to the label2annot command line
On 02/28/2017 04:45 PM, Antonin Skoch wrote:
> Dear experts,
>
> I would like to create modified aparc.a2009s+aseg file with relevant 
> parts of parahippocampal cortical ribbon voxel labels replaced by 
> labels derived from surface labels of entorhinal and parahippocampal 
> cortex (created also by default in recon-all). This modified 
> aparc.a2009s+aseg file I want to use for streamline assignment in 
> structural connectome generation in MrTrix3.
>
> I think that mri_label2vol is not optimal way to do it since it would 
> leave some voxels in the ribbon unassigned.
>
> I think that the better, but much complicated, way to do this is to 
> modify aparc.a2009s.annot with the information from these labels and 
> then run again mris_aparc2aseg.
>
> I tried to do this by using:
>
> mri_annotation2label
>
> and
>
> mris_label2annot --hemi lh --subject my_subject --ldir my_labels --a 
> my_aparc.a2009s --ctab my_aparc.annot.a2009s.ctab --debug
>
> I took the  aparc.annot.a2009s.ctab from the my_subject/label 
> directory and added to the end 2 row with entorrhinal and perirhinal 
> parcellations with unique RGB values to assure the relevant parts of 
> parahippocampal gyrus label are replaced by these new labels I want to 
> supply.
>
> But the resulting new .annot file is not correct - the labels are in 
> correct position on cortical surfaces, but the label names of all 
> labels are shuffled.
>
> I even tried the sequence of mri_annotation2label, mris_label2annot 
> without adding new labels, just converting annotation to labels and 
> back, and the annotation naming is also corrupted.
>
> I also tried to create new annotation just from 2 new labels, 
> preparing .ctab file and running mris_label2annot by explicitly 
> specifying my 2 labels like
>
> mris_label2annot --hemi lh --subject my_subject --l 
> lh_labels/lh.perirhinal_exvivo.thresh.label --l 
> lh_labels/lh.entorhinal_exvivo.thresh.label --a rhinal_aparc.a2009s 
> --debug --ctab rhinal_aparc.annot.a2009s.ctab
>
> In this case the label names in annotation are swapped (entorhinal is 
> perirhinal and vice versa), swapped are also file names of labels 
> which I tried to back convert by using mri_annotation2label.
>
> I am using quite recent build of dev version of Freesurfer from 
> 28/2/2017.
>
> Could you suggest where could be the problem?
>
> Or could you advice different, possibly more simple way, how to 
> achieve my goal?
>
> Thank you in advance.
>
> Regards,
>
> Antonin Skoch
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply via email to