Hi, Doug Thanks again for your help. I am really glad to say I managed to get the labels and annotation file I wanted. See attached screenshot for result. There is one final problem I will explain ahead. The parameter that made this possible was --ref. So the final mri_vol2surf that made the trick was:
mri_vol2surf --src binLeftHippoTail.mgz --out LeftHippoTail_surf.mgh --out_type mgh --hemi lh --regheader suj1 --surf surfHippo --projdist-max -2 0 .1 --ref binLeftHippoTail.mgz
This way, using my binary mask both as source and reference I got the correct surface overlay to use as input in:
mri_cor2label --i LeftHippoTail_surf.mgh --surf suj1 lh surfHippo --id 1 --l lh.HippoTail.label
The --projdist parameter you suggested resulted in a a better image so I kept. Repeating this sequence for head and body I got what I wanted. It seems the problem was related to differences in space among the hipocampal subfields filesand orig.mgz (the default reference) perhaps because the first files are 0.5 x 0.5 x 0.5 mm^3 and orig.mgz is 1 x 1 x 1 mm^3 or because the hippocampal subfields are generated from a strict region around the original hippocampal segments you find in aseg.mgz. Both Freeview and tksurfer can load the labels with no error message. Both can load the annotation file too. But at terminal window they show lots of vertices out of index (that is, present in lh.hippo.annot and absent in lh.surfHippo). Labels seem ok with about 12000 vertices if I sum the number of vertices in the 3 files because some vertices are present in more than 1 label but annot includes a huge amount of vertices mapped to unknown. It follows mris_info output.
mris_info --s suj1 lh surfHippo --a ../label/lh.Hippo.annot ERROR: ../label/lh.Hippo.annot has 122886 vertices, while /home/marcos/freesurfer/subjects/suj1/surf/lh.surfHippo has 11627 vertices
It seems that mris_label2annot include a lot of unnecessary unknown vertices not present in my surface nor in the labels during its processing. It does not avoid using the annotation file but produces a huge amount of warning lines at terminal window. I guess mris)label2annot is using some other file as reference and seeing a I did not see any parameter I could add to restrict this behavior. I guess if I had something equivalent to --ref parameter as seem in mri_vol2surf I could have a better result. Alternatively, if I could process the annot file to trim the unmapped vertices I guess it would work too. This is the mris_label2annot I am using:
mris_label2annot --s suj1 --h lh --ctab ../label/Hippo.ctab --a Hippo --l ../label/lh.HippoHead.label --l ../label/lh.HippoBody.label --l ../label/lh.HippoTail.label --maxstatwinner
I hope you can help me in this final issue so we can finnish this thread. Thank you once more for your attention Cheers, Marcos. Em Seg, 2013-11-04 às 18:28 -0500, Douglas N Greve escreveu:
That vol2surf command might miss the values you want to sample. Try adding --projdist-max -2 0 .1 This will sample from 2mm into the hippo out to the surface in .1mm increments and then take the maximum value it finds doug
On 10/30/2013 03:08 PM, Marcos Martins da Silva wrote:
Hi, Doug. Thanks again for all your attention. I am trying to show the head, body and tail segments on the hippocampal surface. Each with one color. I thought the best way to do it would be creating an annot file with 3 surface labels one for each segment. The approach, concatenation of hippo-subfields -> binarize -> tesselation -> smooth, I used gave me a realistic hippocampal surface. I could also segment that concatenated volume into head, body and tail but I do not know how to convert these segments into surface labels.
Unfortunately mapping on the hippo surface did not work too, unless I did something wrong. Could you please check if the following commands are correct? Perhaps all I need is to add or remove one parameter.
*mri_vol2surf --src binLeftHippoBody.mgz --out LeftHippoBody_surf.mgh --out_type mgh --hemi lh --regheader suj1 --surf surfHippo* *mri_cor2label --i LeftHippoBody_surf.mgh --surf suj1 lh surfHippo --id 1 --l lh.HippoBody.label*
Cheers, Marcos.
Em Qua, 2013-10-30 às 10:47 -0400, Douglas N Greve escreveu:
I've lost track of what you are trying to do. Can you just sample it on to your hippo surface? doug
On 10/29/2013 08:05 PM, Marcos Martins da Silva wrote:
I did several tests but I got no luck. But, I guess I know the reason: when you use mri_vol2surf the tool needs a reference surface (lh.white is default, if you do not use --surf argument). The problem is that lh.white, lh.orig and lh.pial all exclude hippocampus. I loaded a volume (orig.mgz) with the p-labels corresponding to left hippocampal head, body and tail. Then I alternatively loaded the surfaces lh.orig, lh.pial and lh.surfhippo. I am attaching screenshots with lh.orig and lh.surfhippo. Registering seems good among volumes, surfaces and p-labels. But hippocampus is completely excluded from lh.orig while lh.pial includes just a few vertices in hippocampal region. On the other side the lh.surfhippo perfectly matches the hippocampus. So, I guess I would need a different approach or a different surface file that includes the hippocampus. I hope you can help me solve this. Thank you for all your attention. BTW, I am not sending the lh.pial screenshot due to list's 500 K restriction, but I can send you if you want to see. Cheers, Marcos Em Qui, 2013-10-24 às 19:39 -0400, Douglas N Greve escreveu:
areyou loading the label (output of mri_cor2label) or did you create an annotation? Try loading the label. Then try loading LeftHippoBody_surf.mgh. If that does not look ok, check the registration between binLeftHippoBody.mgz and subj1 with --regheader
doug
On 10/24/2013 06:40 PM, Marcos Martins da Silva wrote:
Hi, Doug Thanks again for your help. Using the command tksurfer suj1 lh surfHippo, I get the surface loaded in tksurfer in the same way that I get in freeview. The only difference is that the terminal window output is more verbose and that is valuable when investigating this kind of situation. I am attaching a screenshot. I got this just after I used tksurfer to import an annotation (lh.surfHippo + hippo.annot.png). The screenshot show just a few vertices with color. Indeed this is similar to what we see in freeview, except that in this last tool all vertices not in label appears in black and tksurfer preserves the gray color. At terminal output we can see tksurfer expects the surface refers to lh.white. That is not the case, I guess. I think it helps explain the terminal window output we see in freeview and also in tksurfer when I try to load the annot file. It seems we have lots of vertices in annot file that both tools cannot find in surface file and at the same time we have lots of vertices in my surface file not described in the annot files. At least now I can understand the situation. It puzzles me because the surface, binary masks, labels and annotations were created from the same source: the posterior*.mgz files created by recon-all --hippo-subfields. But, well, I probably misunderstood something in documentation and lost my way in some point. I hope you can help me with the correct steps to be followed. I still dream of showing the hippocampus in a similar way we do with cortex when we load lh.pial and lh.aparc.annot. Thank you for your help and attention. Cheers, Marcos. Em Qui, 2013-10-24 às 12:40 -0400, Douglas N Greve escreveu: > Can you load it properly in tksurfer? > > > On 10/23/2013 12:44 AM, Marcos Martins da Silva wrote: > > > > Hi, Doug > > Sorry for this late feedback. > > Just so you can understand what is binLeftHippoBody.mgz I will explain > > its origin. > > 1) recon-all --hippo-subfields > > 2) mri_concat the posterior*.mgz to get the whole hippocampus > > 3) a custom octave routine to segment the whole hippocampus into head, > > body and tail. This routine preserves the probability values of the > > original posterior*.mgz > > 4) mri_binarize the whole hippocampus and its segments. So > > binLeftHippoBody.mgz is the binary mask of left hippocampal body. > > 5) mri-tesselate and mris_smooth the whole hippocampus binary mask to > > create a surface (lh.surfHippo) > > > > Now that is the reason I would like to get the surface labels for > > head, body and tail. I would like to build a annot in order to display > > the colored segments over the whole hippocampus surface. > > Your last tip was great and now I have vertex numbers at the labels > > files and mris_label2annot works. It follows the commands I used to > > process the hippocampal body: > > mri_vol2surf --src binLeftHippoBody.mgz --out LeftHippoBody_surf.mgh > > --out_type mgh --hemi lh --regheader suj1 --surf surfHippo > > mri_cor2label --i LeftHippoBody_surf.mgh --surf suj1 lh surfHippo --id > > 1 --l lh.HippoBody.label > > > > I put the --surf parameter pointing to lh.surfHippo because, if not, > > it would use lh.white (default). As I said it works but the results > > are not visually correct (see attached file). The surface loads on > > freeview with no problem but if I try to load the label representing > > the body or the annot with the 3 segments they do not appear. It seems > > only a small part of the vertices appears in blue. I also get the > > following output at the terminal window I used to start freeview: > > > > MRISreadAnnotationIntoArray: vertex index out of range: 122882 > > i=00000000, in_array_size=11627 > > annot file: ../label/lh.Hippo.annot > > MRISreadAnnotationIntoArray: vertex index out of range: 122883 > > i=00000000, in_array_size=11627 > > annot file: ../label/lh.Hippo.annot > > MRISreadAnnotationIntoArray: vertex index out of range: 122884 > > i=00000000, in_array_size=11627 > > annot file: ../label/lh.Hippo.annot > > MRISreadAnnotationIntoArray: vertex index out of range: 122885 > > i=00000000, in_array_size=11627 > > annot file: ../label/lh.Hippo.annot > > reading colortable from annotation file... > > colortable with 4 entries read (originally ../label/Hippo.ctab) > > colortable with 4 entries read (originally ../label/Hippo.ctab) > > =00000000, in_array_size=11627 > > > > Since the posterior*.mgz files are 0.5 x 0.5 x 0.5 mm I also tried to > > use mri_convert --vs 1 1 1, but it did not worked too. > > I guess, or at least, I hope I am closer the image I want but I guess > > some more steps are necessary. > > Thank you for any help. > > Marcos > > > > > > > > Em Qui, 2013-10-17 às 22:19 -0400, Douglas Greve escreveu: > >> > >> Is *binLeftHippoBody.mgz a volume label or a surface label? If a > >> volume label, map it onto the surface with mri_vol2surf, the run > >> mri_cor2label *specifying --surf > >> > >> doug > >> > >> > >> > >> > >> On 10/17/13 5:00 PM, Marcos Martins da Silva wrote: > >> > >>> Hi, Doug > >>> Thank you for your answer. > >>> > >>> I am trying cor2label as you suggested. First of all I am afraid to > >>> say that website documentation and help from the own command are a > >>> bit different so I got a little confused. But the following command > >>> worked: *mri_cor2label --i binLeftHippoBody.mgz --id 1 --l 2.leftBody* > >>> > >>> Using freeview I could load the hippocampus volume and 2.leftBody as > >>> a ROI. I attached a screenshot that also included 1.leftHead and > >>> 3.leftTail, generated in the same way. > >>> When I tried to concatenate the 3 labels into an annot file I got an > >>> error: > >>> > >>> *mris_label2annot --s bert --h lh --ctab HippoColorLUT.txt --l > >>> 1.leftHead.label --l 2.leftBody.label --l 3.leftTail.label --a > >>> lefthippo* > >>> *Loading /home/marcos/freesurfer/subjects/bert/surf/lh.orig* > >>> *1 16711680 leftHead* > >>> *ERROR: 1.leftHead.label, n=0, vertex -1 out of range* > >>> > >>> When I checked label file generated by mri_cor2label the first > >>> collumn (vertex number) contains only *-1* as value. > >>> It seems that when you use mri_cor2label it does not preserve or > >>> even recover the vertex number. It also seems I need the correct > >>> vertex number in label file to use mris_label2annot > >>> Just to rule out a problem with the hippocampal subfield files I > >>> tried the example command (extracted from command help): > >>> mri_cor2label --i aseg.mgz --id 12 --l left-putamen.label > >>> This label also shows only -1 as vertex number. > >>> > >>> Could you please explain me what do I need to do to get the vertex > >>> numbers in the label file as output of mri_cor2label? > >>> > >>> Cheers, > >>> Marcos > >>> > >>> > >>> > >>> Em Qua, 2013-10-16 às 20:34 -0400, Douglas Greve escreveu: > >>>> I think you need to use mri_cor2label (not very well named:) > >>>> doug > >>>> > >>>> > >>>> On 10/16/13 4:24 PM, Marcos Martins da Silva wrote: > >>>> > >>>>> Hi, Freesurfers. > >>>>> I need to create some labels from binary masks. Sometime ago I > >>>>> read a post > >>>>> (https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2013-October/033783.h... > >>>>> ) and, unless I am wrong, it seemed to me that mri_label2vol could > >>>>> be the tool to get it. If so, could you please explain how? I > >>>>> read documentation on wiki and help from the command itself and > >>>>> could not see how to accomplish that. I could only find how to > >>>>> create a volume from a label. What I need to do is to get a mask > >>>>> like the binLeftHippoHead.mgz (attached) and create a label. > >>>>> Assuming it is possible, I could also make labels for Hippocampal > >>>>> body and head, merge the 3 labels into an annot file. This way i > >>>>> can use Freeview to load the whole hippocampal surface and > >>>>> discriminate the 3 segments by colors with the annot file. > >>>>> Thanks in advance for any help. > >>>>> Cheers, > >>>>> Marcos. > >>>>> > >>>>> _______________________________________________ > >>>>> Freesurfer mailing list > >>>>>Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu > >>>>>https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > >>>> > >>>> _______________________________________________ > >>>> Freesurfer mailing list > >>>>Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu mailto: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. > >>> > >> > > > > >