Ha, that was my error! Thanks Doug!

Do you have any thoughts on how I can solve the following error when running glmfit?

FWHM = -nan
ERROR: input FWHM is NaN (not a number).
  Check the mask in the glm directory.   

I checked the mask from the glm directory using the 2mm version of fsaverage, and it seems fine.

This is my code:

set labels = (accumb)
foreach label ($labels)
mri_glmfit --y ces.nii.gz --osgm --glmdir glm.${label} --mask /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/ROI_handmade_labels/${label}_lh.mgz
mri_glmfit-sim --glmdir glm.${label} --sim mc-z 10000 2.3 mc-z.pos.23.lh --sim-sign pos
end 

Best, 
Suzanne




On Tue, Nov 19, 2013 at 5:30 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu> wrote:

The label will be totally off because it was not created in the conformed anatomical space of fsaverage. Does the mask look ok? If you want to view the label, use something like

tkmedit -f $SUBJECTS_DIR/fsaverage/mri.2mm/orig.mgz -ov sig.mgh -seg $SUBJECTS_DIR/fsaverage/mri.2mm/aseg.mgz

doug




On 11/19/2013 08:41 AM, Suzanne Oosterwijk wrote:
Hi Doug,

I use the following command to open tkmedit and then I load the mask, the ocn.mgh file or the original label (created by mri_binarize) as a segmentation (through the tkmedit menu). In this case a label does open, but it is totally off.

tkmedit fsaverage orig.mgz -aux brain.mgz -bc-main-fsavg -overlay /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_functional/ff_image/feedback_gamma_image_vol/omnibus/glm.amygdala/osgm/sig.mgh -fthresh 2.3 -fmax 4 -aparc+aseg

Thanks!
Suzanne








On Thu, Nov 14, 2013 at 8:48 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>> wrote:

    What is your tkmedit command used to view the segmentation?
    doug


    On 11/14/2013 07:10 AM, Suzanne Oosterwijk wrote:

        Hi Doug,

        Thanks for the code, this works. Nevertheless, I am a bit
        unsure about whether the masks that are used as input into
        this command are correct. I like to check all the stages of
        the process and when I open the mask.mgh file within the
        appropriate glm folder, the segmentation is totally off (the
        putamen is somewhere in the OFC). Furthermore, even though the
        file that holds the output cluster from the Monte Carlo
        simulation (mc-z.pos.23.lh.sig.cluster.mgh) seems correct, the
        segmentation file that I use as input into the mri_segstats
        command is also totally off (mc-z.pos.23.lh.sig.ocn.mgh) when
        I load it in tkmedit. Am I loading it incorrectly as a
        segmentation? Does this have anything to do with the fact that
        you advised me to use the 2mm version
        fsaverage/mri.2mm/aseg.mgz? Should I adapt for that in my
        tkmedit command?

        Finally, I also run into a problem with the nucleus accumbens
        specifically. For some reason I get an error when I run the
        glmfit and mc simulation within this specific mask. First I
        make the mask:

        mri_binarize --match 26 --i
        /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/fsaverage/mri.2mm/aseg.mgz
        --o
        /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/ROI_handmade_labels/accumb_lh.mgz

        Then I run glmfit:

        set labels = (accumb)
        foreach label ($labels)
        mri_glmfit --y ces.nii.gz --osgm --glmdir glm.${label} --mask
        /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/ROI_handmade_labels/${label}_lh.mgz
        mri_glmfit-sim --glmdir glm.${label} --sim mc-z 10000 2.3
        mc-z.pos.23.lh --sim-sign pos
        end

        But I get an error saying:

        FWHM = -nan
        ERROR: input FWHM is NaN (not a number).
          Check the mask in the glm directory.

        Any ideas what I am doing wrong?

        Thanks again!

        Suzanne


        On Tue, Nov 5, 2013 at 12:04 AM, Douglas N Greve
        <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
        <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>> wrote:


            Hi Suzanne, there is probably an easier way to do this. If you
            create contrasts of each condition vs baseline then run
            isxconcat-sess on each, you can then run something like

            mri_segstats --seg mc-z.pos.23.lh.sig.ocn.mgh --i
            condition1.nii.gz --avgwf condition1.table.dat --excludeid 0

            where condition1.nii.gz is the output of isxconcat-sess for
            condition 1. The output fo mri_segstats will be
            condition1.table.dat which will have a row for each
        subject and a
            column for each of the clusters

            doug



            On 11/01/2013 09:51 AM, Suzanne Oosterwijk wrote:


                Hello again,

                I am stuck again in my analysis and I am not sure that
        my code
                is right. I want to do the following. With a Monte Carlo
                simulation I search for significant clusters within a
                particular ROI in my all conditions vs baseline
        contrast. Then
                I want to translate this functional cluster to each
                individuals native space (as a label) and extract percent
                signal change for each condition separately from that
        label.
                This is no problem in my surface analysis, but I am
        not sure
                how to do this in the volume. I ran the Monte Carlo
        simulation
                within the mask, which provides a segmentation called
                mc-z.pos.23.lh.sig.ocn.mgh. I assume that this would
        be the
                label that would go into mri_vol2vol to translate the
        cluster
                to native space. I found on the website, however, that you
                need to use tkregister first. So I used the following
        code,
                but I am doubtful about whether I am doing this right.

                tkregister2 --mov
                       /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_functional/ff_image/feedback_gamma_image_vol
                /omnibus/glm.amygdala/osgm/mc-z.pos.23.lh.sig.ocn.mgh --s
                ff_01_030512 --regheader --reg
        ff_01_030512/register.dat --surf

                The results of this command do not look good at
        all....(see
                attached image). The cluster in the -mov file does not
        overlap
                with the amygdala. For the next step, I assumed to use
                mri_vol2vol to save the cluster as a native space label,
                although I'd like to make sure the first step is correct
                before continuing with this step.

                mri_vol2vol --mov
                       /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_functional/ff_image/feedback_gamma_image_vol

                /omnibus/glm.amygdala/osgm/mc-z.pos.23.lh.sig.ocn.mgh
        --reg
                ff_01_030512/register.dat --fstarg --interp nearest --o
                ff_01_030512/label/lh.amygdala.imact.mgz --s ff_01_030512


                What am I missing? Is the translation off because I did
                something wrong, or does that point to a deeper issue?


                Any help is much appreciated!


                Suzanne



                On Tue, Oct 29, 2013 at 6:04 PM, Douglas N Greve
                <greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>
        <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>
                <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>

                <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>>> wrote:

                    Hi suzanne, you'll need to use the 2mm version
                    fsaverage/mri.2mm/aseg.mgz
                    doug

                    On 10/29/2013 11:46 AM, Suzanne Oosterwijk wrote:
                    > Hello all,
                    >
                    > I want to run a Monte Carlo simulation within a
        volume
                ROI and I am
                    > running into a problem when I use the --mask
        flag while
                running
                    > glmfit. My question is very similar to the
        question asked in
                    > "[Freesurfer] Volume-based Monte Carlo
        Restricted to a
                within mask
                    > area" but I could not find the response to this
        question.
                    >
                    > Here is my code.
                    >
                    > First, I created a volume mask with mri_binarize:
                    >
                    > mri_binarize --match 18 --i
                    >
                                  home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/fsaverage/mri/aseg.mgz
                    > --o
                    >
                                  /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/ROI_handmade_labels/amygdala_lh.mgz
                    >
                    > I checked the mask and it looked good. Then I
        use the
                mask in
                    glmfit.
                    >
                    > mri_glmfit --y ces.nii.gz --osgm --glmdir
                glm.amygdala_lh --mask
                    >
                                  /home/sooster1/Desktop/FALSE_FEEDBACK_imaging/DATA/feedback_structural/ROI_handmade_labels/amygdala_lh.mgz
                    >
                    > When I do this, I get the following error:
                    >
                    > ERROR: dimension mismatch 1 between y and mask
                    >
                    > I guess this means that the ces.nii.gz file and mask
                file don't
                    match,
                    > but I have no idea how to solve this. Any thoughts?
                    >
                    > Thanks!
                    > Suzanne
                    >
                    >
                    > --
                    >
                    > Suzanne Oosterwijk, Ph.D.
                    >
                    > Postdoctoral Researcher
                    >
                    > Department of Social Psychology
                    >
                    > University of Amsterdam
                    >
                    > s.oosterwijk@u <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>
                <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>>
                    <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>
                <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>>>>va.nl <http://va.nl>
        <http://va.nl>
                <http://va.nl> <http://va.nl>

                    >
                    > https://sites.google.com/site/suzanneoosterwijk/
                    >
                    >
                    >
                    > _______________________________________________
                    > 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
        <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

                    --
                    Douglas N. Greve, Ph.D.
                    MGH-NMR Center
        greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
        <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>
                <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>

                <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>>
                    Phone Number: 617-724-2358 <tel:617-724-2358>
        <tel:617-724-2358 <tel:617-724-2358>>
                <tel:617-724-2358 <tel:617-724-2358> <tel:617-724-2358
        <tel:617-724-2358>>>
                    Fax: 617-726-7422 <tel:617-726-7422>
        <tel:617-726-7422 <tel:617-726-7422>> <tel:617-726-7422
        <tel:617-726-7422>

                <tel:617-726-7422 <tel:617-726-7422>>>


                    Bugs:
        surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
        <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                           <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                    FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
        www.nmr.mgh.harvard.edu/facility/filedrop/index.html
        <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                       <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                           <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>

                    Outgoing:
        ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/

                    _______________________________________________
                    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
        <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.




                --
                Suzanne Oosterwijk, Ph.D.

                Postdoctoral Researcher

                Department of Social Psychology

                University of Amsterdam

                s.oosterwijk@u <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>
                <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>>>va.nl <http://va.nl>
        <http://va.nl> <http://va.nl>

        https://sites.google.com/site/suzanneoosterwijk/


            --     Douglas N. Greve, Ph.D.
            MGH-NMR Center
        greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
        <mailto:greve@nmr.mgh.harvard.edu
        <mailto:greve@nmr.mgh.harvard.edu>>
            Phone Number: 617-724-2358 <tel:617-724-2358>
        <tel:617-724-2358 <tel:617-724-2358>>
            Fax: 617-726-7422 <tel:617-726-7422> <tel:617-726-7422
        <tel:617-726-7422>>

            Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
        <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
            <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
            FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
        www.nmr.mgh.harvard.edu/facility/filedrop/index.html
        <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
            <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
            Outgoing:
        ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/




        --
        Suzanne Oosterwijk, Ph.D.

        Postdoctoral Researcher

        Department of Social Psychology

        University of Amsterdam

        s.oosterwijk@u <mailto:s.oosterwijk@neu.edu
        <mailto:s.oosterwijk@neu.edu>>va.nl <http://va.nl> <http://va.nl>

        https://sites.google.com/site/suzanneoosterwijk/


    --     Douglas N. Greve, Ph.D.
    MGH-NMR Center
    greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
    Phone Number: 617-724-2358 <tel:617-724-2358>
    Fax: 617-726-7422 <tel:617-726-7422>

    Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
    <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
    FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
    www.nmr.mgh.harvard.edu/facility/filedrop/index.html
    <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
    Outgoing:
    ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/




--

Suzanne Oosterwijk, Ph.D.

Postdoctoral Researcher

Department of Social Psychology

University of Amsterdam

s.oosterwijk@u <mailto:s.oosterwijk@neu.edu>va.nl <http://va.nl>

https://sites.google.com/site/suzanneoosterwijk/




--

Suzanne Oosterwijk, Ph.D.

Postdoctoral Researcher

Department of Social Psychology

University of Amsterdam

s.oosterwijk@uva.nl

 

https://sites.google.com/site/suzanneoosterwijk/