[Freesurfer] A function to read mgh files into R

2011-05-04 Thread Heath Pardoe
Hi all,

I've written a function that reads *.fsaverage.mgh files into the free
statistical software environment "R" (http://www.r-project.org/) and thought
it might be useful for other users. Apologies if this has already been done,
searching for "R" is kind of non-specific. Any feedback is welcome.

Best wishes,
Heath

Example usage (if you save the function as a text file called load_mgh.R).
The output is a list with the thickness values stored in output.name$x

> source("load_mgh.R")
> lh.thickness <- load.mgh("lh.thickness.fwhm10.fsaverage.mgh")
> lh.thickness$x[1:10]
 [1] 3.0016668 2.9998362 2.4326897 2.2146511 3.3020024 2.2749729 2.6460392
 [8] 2.9406335 0.7304581 3.0975394

---
# load mgh file into R

load.mgh <- function(input.file) {
 to.read <- file(input.file,"rb")

v <- readBin(to.read,integer(), endian = "big")
 ndim1 <- readBin(to.read,integer(), endian = "big")
ndim2 <- readBin(to.read,integer(), endian = "big")
 ndim3 <- readBin(to.read,integer(), endian = "big")
nframes <- readBin(to.read,integer(), endian = "big")
 type <- readBin(to.read,integer(), endian = "big")
dof <- readBin(to.read,integer(), endian = "big")
 close(to.read)

to.read <- file(input.file,"rb")
 dump <- readBin(to.read,double(),size = 4,n = 71, endian = "big")
x <- readBin(to.read,double(),size = 4, n = ndim1, endian = "big")
 close(to.read)
 list(x = x,v = v,ndim1 = ndim1,ndim2 = ndim2,ndim3 = ndim3,nframes =
nframes,type = type,dof = dof)

}
--


-- 
Heath R. Pardoe, PhD
Brain Research Institute
Melbourne Brain Centre
245 Burgundy Street, Heidelberg 3084
Phone: (+61 3) 903 57053
Email: h.par...@brain.org.au
___
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.


Re: [Freesurfer] Interpreting results from Qdec

2011-05-04 Thread Douglas N Greve
You can edit the label by hand to only include one vertex. If you got 
the label from a call to mri_surfcluster, then surfcluster will output a 
summary file with the max vertex in each cluster.

doug

Gallen, Courtney (NIH/NIDA) [F] wrote:
> Thank you so much for your suggestion!
>
> Doug, is there a way to modify the mri_segstats command from before to 
> specify coordinates of a vertex (say the peak from the ROI in my contrast)?
>
> Thanks!
>
>
> -Original Message-
> From: Michael Harms [mailto:mha...@conte.wustl.edu]
> Sent: Wednesday, May 04, 2011 2:41 PM
> To: Gallen, Courtney (NIH/NIDA) [F]
> Cc: Doug Greve; Freesurfer Mailing List
> Subject: Re: [Freesurfer] Interpreting results from Qdec
>
>
> Hi Gallen,
> I suggest that you extract the values across subjects at a single vertex
> in fsaverage space, and then attempt to duplicate FS's uncorrected t-
> and p-values at that vertex with your SPSS model.  Those HAVE to be
> identical if you are truly using the same model (unless there is an
> unknown bug related to GLM statistics in FS, which I think it quite
> unlikely).  I vaguely recall myself doing something similar at some
> point (but using SAS instead of SPSS), and the results were indeed the
> same.  But you really need to understand the underlying model used by
> both FS and in your case SPSS.
>
> Best,
> -MH
>
> On Wed, 2011-05-04 at 13:57 -0400, Gallen, Courtney (NIH/NIDA) [F]
> wrote:
>   
>> Thanks for the reply!
>> I'm fairly certain that I'm using the same model. In Qdec: 2 discrete 
>> variables, 1 nuisance variable. In SPSS: a univariate ANOVA with 2 factors 
>> and 1 covariate.
>>
>> I understand the difference between Qdec and SPSS may be because Qdec looks 
>> at the entire cortex. Are there any realistic ways to work around this using 
>> something like SPSS?
>>
>> All I really want is to generate a figure with means for each of my groups, 
>> so I can understand what's driving the interaction. Any other suggestions 
>> about how to do so?
>>
>> -Original Message-
>> From: gr...@nmr.mgh.harvard.edu [mailto:gr...@nmr.mgh.harvard.edu]
>> Sent: Thursday, April 28, 2011 9:06 AM
>> To: Gallen, Courtney (NIH/NIDA) [F]
>> Subject: Re: [Freesurfer] Interpreting results from Qdec
>>
>> Hi Courtney,
>>
>> a couple of suggestions:
>>   1. make sure that QDEC and SPSS are using the identical model.
>>   2. make sure that the values that you are extracting the same as the
>> input to QDEC/glmfit (eg, don't use thickness for one and volume for
>> another).
>>
>> It is possible for the ROI analysis to give very different results, but it
>> usually requires that you select the voxels based on an unsigned statistic
>> (eg, an F-test). This opens the possibility that positives and negatives
>> in the ROI sum to 0.
>>
>> doug
>>
>>
>> 
>>> Thanks Jesse. This does sound very similar to my issue.
>>>
>>> How did you resolve the problem?
>>>
>>> Thanks again!
>>>
>>> From: jessebled...@gmail.com [mailto:jessebled...@gmail.com] On Behalf Of
>>> Jesse Bledsoe
>>> Sent: Wednesday, April 27, 2011 1:19 PM
>>> To: Gallen, Courtney (NIH/NIDA) [F]; Freesurfer Mailing List
>>> Subject: Re: [Freesurfer] Interpreting results from Qdec
>>>
>>> Hi Courtney,
>>>
>>> I'm no expert but I recalled a post similar to yours awhile ago with the
>>> same question you ask. Doug and Nick offered an answer that may be of
>>> help:
>>>
>>> http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg15586.html
>>>
>>> Jesse
>>> On Wed, Apr 27, 2011 at 1:12 PM, Gallen, Courtney (NIH/NIDA) [F]
>>> mailto:galle...@nida.nih.gov>> wrote:
>>> Hi Doug
>>>
>>> Have a follow up question regarding significance levels in Qdec related to
>>> extracting means from ROIs, etc. I'm posting to the entire mailing list in
>>> case anyone else has ideas.
>>>
>>> Basically, I extracted mean volumes (from my set of participants) of ROIs
>>> for which Qdec reports an interaction between two variables. I want to
>>> look at these mean volumes in something like SPSS to see what is driving
>>> the interaction/generate figures, etc.
>>>
>>> I'm having an issue with one such ROI, in that when I extract the mean
>>> volumes and look for this interaction in SPSS, it is not significant (p ~
>>> 0.5, so really not significant at all). Is there any way that an ROI could
>>> be significant in Qdec (p of 0.05, Monte Carlo sim), but not in SPSS when
>>> I extract means for each participant?
>>>
>>> Let me know if this isn't clear. Any thoughts would be appreciated!
>>> Courtney
>>>
>>>
>>> Courtney Gallen
>>> Post-baccalaureate IRTA
>>> Neuroimaging Research Branch
>>> National Institute on Drug Abuse (IRP)
>>> 251 Bayview Blvd
>>> Suite 200
>>> Baltimore, MD 21224
>>> Tel: (443) 740-2631
>>>
>>> -Original Message-
>>> From: Douglas Greve
>>> [mailto:gr...@nmr.mgh.harvard.edu]
>>> Sent: Tuesday, April 26, 2011 1:06 PM
>>> To: Gallen, Courtney (NIH/NIDA) [F]
>>> Subject: Re: [Freesurfer] Interpreting re

Re: [Freesurfer] Interpreting results from Qdec

2011-05-04 Thread Gallen, Courtney (NIH/NIDA) [F]
Thank you so much for your suggestion!

Doug, is there a way to modify the mri_segstats command from before to specify 
coordinates of a vertex (say the peak from the ROI in my contrast)?

Thanks!


-Original Message-
From: Michael Harms [mailto:mha...@conte.wustl.edu]
Sent: Wednesday, May 04, 2011 2:41 PM
To: Gallen, Courtney (NIH/NIDA) [F]
Cc: Doug Greve; Freesurfer Mailing List
Subject: Re: [Freesurfer] Interpreting results from Qdec


Hi Gallen,
I suggest that you extract the values across subjects at a single vertex
in fsaverage space, and then attempt to duplicate FS's uncorrected t-
and p-values at that vertex with your SPSS model.  Those HAVE to be
identical if you are truly using the same model (unless there is an
unknown bug related to GLM statistics in FS, which I think it quite
unlikely).  I vaguely recall myself doing something similar at some
point (but using SAS instead of SPSS), and the results were indeed the
same.  But you really need to understand the underlying model used by
both FS and in your case SPSS.

Best,
-MH

On Wed, 2011-05-04 at 13:57 -0400, Gallen, Courtney (NIH/NIDA) [F]
wrote:
> Thanks for the reply!
> I'm fairly certain that I'm using the same model. In Qdec: 2 discrete 
> variables, 1 nuisance variable. In SPSS: a univariate ANOVA with 2 factors 
> and 1 covariate.
>
> I understand the difference between Qdec and SPSS may be because Qdec looks 
> at the entire cortex. Are there any realistic ways to work around this using 
> something like SPSS?
>
> All I really want is to generate a figure with means for each of my groups, 
> so I can understand what's driving the interaction. Any other suggestions 
> about how to do so?
>
> -Original Message-
> From: gr...@nmr.mgh.harvard.edu [mailto:gr...@nmr.mgh.harvard.edu]
> Sent: Thursday, April 28, 2011 9:06 AM
> To: Gallen, Courtney (NIH/NIDA) [F]
> Subject: Re: [Freesurfer] Interpreting results from Qdec
>
> Hi Courtney,
>
> a couple of suggestions:
>   1. make sure that QDEC and SPSS are using the identical model.
>   2. make sure that the values that you are extracting the same as the
> input to QDEC/glmfit (eg, don't use thickness for one and volume for
> another).
>
> It is possible for the ROI analysis to give very different results, but it
> usually requires that you select the voxels based on an unsigned statistic
> (eg, an F-test). This opens the possibility that positives and negatives
> in the ROI sum to 0.
>
> doug
>
>
> > Thanks Jesse. This does sound very similar to my issue.
> >
> > How did you resolve the problem?
> >
> > Thanks again!
> >
> > From: jessebled...@gmail.com [mailto:jessebled...@gmail.com] On Behalf Of
> > Jesse Bledsoe
> > Sent: Wednesday, April 27, 2011 1:19 PM
> > To: Gallen, Courtney (NIH/NIDA) [F]; Freesurfer Mailing List
> > Subject: Re: [Freesurfer] Interpreting results from Qdec
> >
> > Hi Courtney,
> >
> > I'm no expert but I recalled a post similar to yours awhile ago with the
> > same question you ask. Doug and Nick offered an answer that may be of
> > help:
> >
> > http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg15586.html
> >
> > Jesse
> > On Wed, Apr 27, 2011 at 1:12 PM, Gallen, Courtney (NIH/NIDA) [F]
> > mailto:galle...@nida.nih.gov>> wrote:
> > Hi Doug
> >
> > Have a follow up question regarding significance levels in Qdec related to
> > extracting means from ROIs, etc. I'm posting to the entire mailing list in
> > case anyone else has ideas.
> >
> > Basically, I extracted mean volumes (from my set of participants) of ROIs
> > for which Qdec reports an interaction between two variables. I want to
> > look at these mean volumes in something like SPSS to see what is driving
> > the interaction/generate figures, etc.
> >
> > I'm having an issue with one such ROI, in that when I extract the mean
> > volumes and look for this interaction in SPSS, it is not significant (p ~
> > 0.5, so really not significant at all). Is there any way that an ROI could
> > be significant in Qdec (p of 0.05, Monte Carlo sim), but not in SPSS when
> > I extract means for each participant?
> >
> > Let me know if this isn't clear. Any thoughts would be appreciated!
> > Courtney
> >
> >
> > Courtney Gallen
> > Post-baccalaureate IRTA
> > Neuroimaging Research Branch
> > National Institute on Drug Abuse (IRP)
> > 251 Bayview Blvd
> > Suite 200
> > Baltimore, MD 21224
> > Tel: (443) 740-2631
> >
> > -Original Message-
> > From: Douglas Greve
> > [mailto:gr...@nmr.mgh.harvard.edu]
> > Sent: Tuesday, April 26, 2011 1:06 PM
> > To: Gallen, Courtney (NIH/NIDA) [F]
> > Subject: Re: [Freesurfer] Interpreting results from Qdec
> >
> > Those are the values outside (first column) and inside (2nd col) the
> > ROI. You can add "--id 1" to only report the values inside the ROI.
> >
> > doug
> >
> > On 4/26/11 1:02 PM, Gallen, Courtney (NIH/NIDA) [F] wrote:
> >> It worked!
> >> Now, last question. The txt file has two separate values (?averages).
> >> What

Re: [Freesurfer] unable to use cuda 4.0.13 and cuda 3.2.16 with nvidia 270.41.03, fedora 14

2011-05-04 Thread Knut J Bjuland
Hi

I have tried with driver 260.19.36 with a similiar result. The complain 
in this case is that MRISallocCudaVertices: cannot allocate device 
memory !: all CUDA-capable devices are busy or unavailable.

Knut J

On 05/03/2011 06:11 PM, Richard G. Edgar wrote:
> On Tue, 2011-05-03 at 18:05 +0200, Knut J Bjuland wrote:
>> I have also installed cuda 3.2 with the same results. There might be an
>> error in CUDA Error in file 'devicemanagement.cu' on line 46 : invalid
>> argument. which I got when I used the latest nvidia driver with cuda 3.2
>> Could anybody on this list try freesurfer with cuda and the latest
>> nvidia driver.
> Are you able to try with the 3.2 driver? You might have uncovered a
> place where NVIDA isn't getting its backwards compatibility right.
>
> Richard
>
> ___
> 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.
>
>
>

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Re: [Freesurfer] Interpreting results from Qdec

2011-05-04 Thread Michael Harms

Hi Gallen,
I suggest that you extract the values across subjects at a single vertex
in fsaverage space, and then attempt to duplicate FS's uncorrected t-
and p-values at that vertex with your SPSS model.  Those HAVE to be
identical if you are truly using the same model (unless there is an
unknown bug related to GLM statistics in FS, which I think it quite
unlikely).  I vaguely recall myself doing something similar at some
point (but using SAS instead of SPSS), and the results were indeed the
same.  But you really need to understand the underlying model used by
both FS and in your case SPSS.

Best,
-MH

On Wed, 2011-05-04 at 13:57 -0400, Gallen, Courtney (NIH/NIDA) [F]
wrote:
> Thanks for the reply!
> I'm fairly certain that I'm using the same model. In Qdec: 2 discrete 
> variables, 1 nuisance variable. In SPSS: a univariate ANOVA with 2 factors 
> and 1 covariate.
> 
> I understand the difference between Qdec and SPSS may be because Qdec looks 
> at the entire cortex. Are there any realistic ways to work around this using 
> something like SPSS?
> 
> All I really want is to generate a figure with means for each of my groups, 
> so I can understand what's driving the interaction. Any other suggestions 
> about how to do so?
> 
> -Original Message-
> From: gr...@nmr.mgh.harvard.edu [mailto:gr...@nmr.mgh.harvard.edu]
> Sent: Thursday, April 28, 2011 9:06 AM
> To: Gallen, Courtney (NIH/NIDA) [F]
> Subject: Re: [Freesurfer] Interpreting results from Qdec
> 
> Hi Courtney,
> 
> a couple of suggestions:
>   1. make sure that QDEC and SPSS are using the identical model.
>   2. make sure that the values that you are extracting the same as the
> input to QDEC/glmfit (eg, don't use thickness for one and volume for
> another).
> 
> It is possible for the ROI analysis to give very different results, but it
> usually requires that you select the voxels based on an unsigned statistic
> (eg, an F-test). This opens the possibility that positives and negatives
> in the ROI sum to 0.
> 
> doug
> 
> 
> > Thanks Jesse. This does sound very similar to my issue.
> >
> > How did you resolve the problem?
> >
> > Thanks again!
> >
> > From: jessebled...@gmail.com [mailto:jessebled...@gmail.com] On Behalf Of
> > Jesse Bledsoe
> > Sent: Wednesday, April 27, 2011 1:19 PM
> > To: Gallen, Courtney (NIH/NIDA) [F]; Freesurfer Mailing List
> > Subject: Re: [Freesurfer] Interpreting results from Qdec
> >
> > Hi Courtney,
> >
> > I'm no expert but I recalled a post similar to yours awhile ago with the
> > same question you ask. Doug and Nick offered an answer that may be of
> > help:
> >
> > http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg15586.html
> >
> > Jesse
> > On Wed, Apr 27, 2011 at 1:12 PM, Gallen, Courtney (NIH/NIDA) [F]
> > mailto:galle...@nida.nih.gov>> wrote:
> > Hi Doug
> >
> > Have a follow up question regarding significance levels in Qdec related to
> > extracting means from ROIs, etc. I'm posting to the entire mailing list in
> > case anyone else has ideas.
> >
> > Basically, I extracted mean volumes (from my set of participants) of ROIs
> > for which Qdec reports an interaction between two variables. I want to
> > look at these mean volumes in something like SPSS to see what is driving
> > the interaction/generate figures, etc.
> >
> > I'm having an issue with one such ROI, in that when I extract the mean
> > volumes and look for this interaction in SPSS, it is not significant (p ~
> > 0.5, so really not significant at all). Is there any way that an ROI could
> > be significant in Qdec (p of 0.05, Monte Carlo sim), but not in SPSS when
> > I extract means for each participant?
> >
> > Let me know if this isn't clear. Any thoughts would be appreciated!
> > Courtney
> >
> >
> > Courtney Gallen
> > Post-baccalaureate IRTA
> > Neuroimaging Research Branch
> > National Institute on Drug Abuse (IRP)
> > 251 Bayview Blvd
> > Suite 200
> > Baltimore, MD 21224
> > Tel: (443) 740-2631
> >
> > -Original Message-
> > From: Douglas Greve
> > [mailto:gr...@nmr.mgh.harvard.edu]
> > Sent: Tuesday, April 26, 2011 1:06 PM
> > To: Gallen, Courtney (NIH/NIDA) [F]
> > Subject: Re: [Freesurfer] Interpreting results from Qdec
> >
> > Those are the values outside (first column) and inside (2nd col) the
> > ROI. You can add "--id 1" to only report the values inside the ROI.
> >
> > doug
> >
> > On 4/26/11 1:02 PM, Gallen, Courtney (NIH/NIDA) [F] wrote:
> >> It worked!
> >> Now, last question. The txt file has two separate values (?averages).
> >> What do they each represent?
> >>
> >> -Original Message-
> >> From: Douglas Greve
> >> [mailto:gr...@nmr.mgh.harvard.edu]
> >> Sent: Tuesday, April 26, 2011 12:53 PM
> >> To: Gallen, Courtney (NIH/NIDA) [F]
> >> Subject: Re: [Freesurfer] Interpreting results from Qdec
> >>
> >> try "--slabel fsaverage lh ROI-drawn-on-QDEC-brain.label"
> >>
> >>
> >> On 4/26/11 12:52 PM, Gallen, Courtney (NIH/NIDA) [

Re: [Freesurfer] Interpreting results from Qdec

2011-05-04 Thread Gallen, Courtney (NIH/NIDA) [F]
Thanks for the reply!
I'm fairly certain that I'm using the same model. In Qdec: 2 discrete 
variables, 1 nuisance variable. In SPSS: a univariate ANOVA with 2 factors and 
1 covariate.

I understand the difference between Qdec and SPSS may be because Qdec looks at 
the entire cortex. Are there any realistic ways to work around this using 
something like SPSS?

All I really want is to generate a figure with means for each of my groups, so 
I can understand what's driving the interaction. Any other suggestions about 
how to do so?

-Original Message-
From: gr...@nmr.mgh.harvard.edu [mailto:gr...@nmr.mgh.harvard.edu]
Sent: Thursday, April 28, 2011 9:06 AM
To: Gallen, Courtney (NIH/NIDA) [F]
Subject: Re: [Freesurfer] Interpreting results from Qdec

Hi Courtney,

a couple of suggestions:
  1. make sure that QDEC and SPSS are using the identical model.
  2. make sure that the values that you are extracting the same as the
input to QDEC/glmfit (eg, don't use thickness for one and volume for
another).

It is possible for the ROI analysis to give very different results, but it
usually requires that you select the voxels based on an unsigned statistic
(eg, an F-test). This opens the possibility that positives and negatives
in the ROI sum to 0.

doug


> Thanks Jesse. This does sound very similar to my issue.
>
> How did you resolve the problem?
>
> Thanks again!
>
> From: jessebled...@gmail.com [mailto:jessebled...@gmail.com] On Behalf Of
> Jesse Bledsoe
> Sent: Wednesday, April 27, 2011 1:19 PM
> To: Gallen, Courtney (NIH/NIDA) [F]; Freesurfer Mailing List
> Subject: Re: [Freesurfer] Interpreting results from Qdec
>
> Hi Courtney,
>
> I'm no expert but I recalled a post similar to yours awhile ago with the
> same question you ask. Doug and Nick offered an answer that may be of
> help:
>
> http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg15586.html
>
> Jesse
> On Wed, Apr 27, 2011 at 1:12 PM, Gallen, Courtney (NIH/NIDA) [F]
> mailto:galle...@nida.nih.gov>> wrote:
> Hi Doug
>
> Have a follow up question regarding significance levels in Qdec related to
> extracting means from ROIs, etc. I'm posting to the entire mailing list in
> case anyone else has ideas.
>
> Basically, I extracted mean volumes (from my set of participants) of ROIs
> for which Qdec reports an interaction between two variables. I want to
> look at these mean volumes in something like SPSS to see what is driving
> the interaction/generate figures, etc.
>
> I'm having an issue with one such ROI, in that when I extract the mean
> volumes and look for this interaction in SPSS, it is not significant (p ~
> 0.5, so really not significant at all). Is there any way that an ROI could
> be significant in Qdec (p of 0.05, Monte Carlo sim), but not in SPSS when
> I extract means for each participant?
>
> Let me know if this isn't clear. Any thoughts would be appreciated!
> Courtney
>
>
> Courtney Gallen
> Post-baccalaureate IRTA
> Neuroimaging Research Branch
> National Institute on Drug Abuse (IRP)
> 251 Bayview Blvd
> Suite 200
> Baltimore, MD 21224
> Tel: (443) 740-2631
>
> -Original Message-
> From: Douglas Greve
> [mailto:gr...@nmr.mgh.harvard.edu]
> Sent: Tuesday, April 26, 2011 1:06 PM
> To: Gallen, Courtney (NIH/NIDA) [F]
> Subject: Re: [Freesurfer] Interpreting results from Qdec
>
> Those are the values outside (first column) and inside (2nd col) the
> ROI. You can add "--id 1" to only report the values inside the ROI.
>
> doug
>
> On 4/26/11 1:02 PM, Gallen, Courtney (NIH/NIDA) [F] wrote:
>> It worked!
>> Now, last question. The txt file has two separate values (?averages).
>> What do they each represent?
>>
>> -Original Message-
>> From: Douglas Greve
>> [mailto:gr...@nmr.mgh.harvard.edu]
>> Sent: Tuesday, April 26, 2011 12:53 PM
>> To: Gallen, Courtney (NIH/NIDA) [F]
>> Subject: Re: [Freesurfer] Interpreting results from Qdec
>>
>> try "--slabel fsaverage lh ROI-drawn-on-QDEC-brain.label"
>>
>>
>> On 4/26/11 12:52 PM, Gallen, Courtney (NIH/NIDA) [F] wrote:
>>> Actually, I hope I'm wrong about what I thought below. If I specify
>>> individual subject's label and run:
>>>
>>> mri_segstats --in
>>> /prot/Mprot/CTQ/freesurferDone/8579/surf/lh.volume.fwhm10.fsaverage.mgh
>>> --slabel 8579 lh
>>> /prot/Mprot/CTQ/freesurferDone/8579/label/lh.SupTemp_CTQxBDNFctrls.label
>>> --avgwf lhSupTempctrls.txt
>>>
>>> I still get the same error about dimension mismatch
>>>
>>>
>>> -Original Message-
>>> From: Gallen, Courtney (NIH/NIDA) [F]
>>> Sent: Tuesday, April 26, 2011 12:43 PM
>>> To: 'Douglas Greve'
>>> Subject: RE: [Freesurfer] Interpreting results from Qdec
>>>
>>> Ah I think I see the problem now.
>>>
>>> The label I originally specified is the general label created from the
>>> ROI drawing in Qdec. Instead, I should use the individual subject's
>>> label (from 'Map Label to Subjects') instead, right?
>>>
>>> Thank you!
>>>
>>> -Original Mess

Re: [Freesurfer] ICV smaller than the brain

2011-05-04 Thread Martin Reuter

Hi Jeff, 

it is the talairach.xfm file you need to check. The wiki says
http://surfer.nmr.mgh.harvard.edu/fswiki/eTIV

To check the quality of the registration file talairach.xfm file: 

cd $SUBJECTS_DIR/subject/mri/transforms
tkregister2 --xfm talairach.xfm \
  --targ $FREESURFER_HOME/average/RB_all_withskull_2008-03-26.gca \
  --mov ../nu_noneck.mgz --reg junk

Best, Martin

On Wed, 2011-05-04 at 08:20 -0400, Martin Reuter wrote:
> Hi jeff.
> Probably your Talairach registrations fail. There are several different maps. 
> I don't remember which one is the one used for the eTIV but it is documented 
> on the wiki. You probably looked at the wrong transforms.
> 
> Best Martin
> 
> Send from my phone
> 
> On May 4, 2011, at 2:47 AM, Jeff Sadino  wrote:
> 
> > Hello,
> > 
> > I asked a question similar to this last year when working with FS 4.3.1, 
> > and I'm hoping that there is something new in FS 5 that can help.
> > 
> > I am having a problem where a lot of my subjects' brains are larger than 
> > the eICV.  In FS 4.3.1, it is happening in about 70/140 subjects, and in FS 
> > 5, it is happening in about 30/140 subjects.  I checked them in 
> > tkregister2, and they look ok.  I can use the --old-etiv-only command, but 
> > then the problem is that my ICV shoots up to 1.7L, and my brain/ICV ratio 
> > drops to .65, way to low to be reasonable.  What could the reason for this 
> > be, and are there any other tricks that I could use?
> > 
> > Thank you,
> > Jeff Sadino
> > ___
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 

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



Re: [Freesurfer] RAS to MNI coordinates of a label

2011-05-04 Thread Douglas N Greve

There's something strange going on. Did your label come from the right 
hemisphere? The first coordinate of all the points is negative, 
indicating that it is on the left side. Which MNI atlas are you using?

doug

7705  -36.725  5.727  20.658 0.00


Yolanda Vives wrote:
> I am using the coordinates obtained with the matlab 
> function "read_label()". I send you one of my labels.
>  
> Thanks a lot,
> Yolanda
>
> 2011/5/3 Douglas N Greve  >
>
> Which coordinates are you using? Can you send me the label?
> doug
>
> Yolanda Vives wrote:
>
> Hi Doug,
>
> The problem is that when I put the coordinates in a MNI altas,
> it says that they correspond to the caudate and not to the
> cingulate and I would like to know if the procedure that I am
> following is correct.
>
> Regards,
> Yolanda
>
> 2011/5/3 Douglas N Greve  
>  >>
>
>
>Hi Yolanda, they should already be in mni305 coordinates,
> so the
>identity matrix is correct. Did you find a potential problem?
>doug
>
>Yolanda Vives wrote:
>
>Hi all,
> I am interested in obtaining the MNI or talairach
> coordinates
>of a label. The procedure that I have performed is the
> following:
> First of all I have performed a QDEC analysis. From the
>results, I have drawn a label of a significant area of the
>brain, that corresponds to the cingulate. Afterwards, I
> have
>used the matlab function read_label to obtain the RAS
>coordinates of this label. To transform these
> coordinates into
>mni coordinates, I have read that  if v = [R A S 1]' and X
>matrix is the matrix from talairach.xfm, then vMNI = X*v
> Taking this into account, I have used the X matrix
> from the
>talairach.xfm of "fsaverage" (where the results of qdec are
>mapped). This matrix is
> 1.0 0.0 0.0 0.0
>0.0 1.0 0.0 0.0
>0.0 0.0 1.0 0.0
>so vMNI is the same as v. When I introduce v (or vMNI)
>coordinates into a MNI atlas, I don't obtain the cingulate.
>
>Could you please help me with this procedure?
> Thank you in advance,
>Yolanda
>
>  
> 
>
>___
>Freesurfer mailing list
>Freesurfer@nmr.mgh.harvard.edu
> 
> >
>
>  
>  https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
>-- Douglas N. Greve, Ph.D.
>MGH-NMR Center
>gr...@nmr.mgh.harvard.edu
> 
>  >
>
>Phone Number: 617-724-2358 Fax: 617-726-7422
>
>Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
> 
>
>
>FileDrop:
> www.nmr.mgh.harvard.edu/facility/filedrop/index.html
> 
>
>
>
>
>
>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.
>
>
>
>
> -- 
> Yolanda Vives
> PIC (Port d'Informació Científica)
> Campus UAB, Edificio D
> E-08193 Bellaterra, Barcelona
> Telf. +34 93 586 8232
> http://www.pic.es 
> Avis - Aviso - Legal Notice: http://www.ifae.es/legal.html
>
>
> -- 
> Douglas N. Greve, Ph.D.
> MGH-NMR Center
> gr...@nmr.mgh.harvard.edu 
> Phone Number: 617-724-2358 Fax: 617-726-7422

[Freesurfer] ROI illustration

2011-05-04 Thread Liukarl

Hello. Freesurfer experts:
 
After autorecon3, Freesurfer generates the thickness measure of pre-defined 
ROIs from Desikan’s parcellation. Now I want to make a picture illustration of 
thickness but only with rostral middle frontal ROI. My questions are:
1 which surface would be fit for the illustration purpose, the pial surface?
2 how can I only color label the rostral middle frontal ROI without any other 
regions? And any way to export high resolution of picture from Freesurfer?
 
Thanks in advance!
 
Karl  ___
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.


Re: [Freesurfer] subcortical volume and qdec

2011-05-04 Thread Nick Schmansky
wang,

qdec doesnt yet support analysis of subcortical structures in the way i
think you were expecting.  that is, currently only surface measures (by
default thickness), is selectable as the independent variable.  a
subcort volume is not yet selectable (its output results would be bar
charts, not a surface display).  you can do a subcortical volume
analysis by working with the aseg.stats file directly in some stats
program (or mri_glmfit).

so if a particular volume measure is selected via the stats import
option, and it is selected as a possible factor, and that factor is
selected as a regressor in the Design window, then when an analysis is
run, it is entirely possible (and very likely) that there is no change
in thickness value given a particular subcortical volume.  the one
exception i have seen for this is hippocampal volume, which does have an
effect on cortical thickness between controls and AD patients.

n.


On Wed, 2011-05-04 at 11:18 +0800, 汪贵宏 wrote:
> Dear freesurfer experts:
> 
>  I had processed my data with recon-all, and also ,I had compared
> the cortical thickness difference between the con and pat with
> qdec .however,when i I try to compare the sub-cortical volume
> difference between con and pat ,the results were the same as the
> thickness,even in Analysis Results window,the option is not changed,as
> the "Does the average thickness differ between con and pat?" So, I
> have no idea about it,because I chose the ASEG.VOLUME in the "Stats
> Data Import" window.
> 
>In addition ,I wander whether the volume differ comparison is
> processed based on ROI or vertex?
> 
>Did anyone can help me with any suggestion.
> 
>   thank you
>   wang
> 
> 
> 
> 
> __
> 体验网易邮箱2G超大附件,轻松发优质大电影、大照片,提速3倍!
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

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


[Freesurfer] [New release] - iSurf Brainview 2.1.1

2011-05-04 Thread Pedro Paulo de Magalhães Oliveira Junior
Today it was released a new upgrade of iSurf Brainview. (2.1.1)

*New features:
* Phone / IPod Touch
- IPhone now show webpage with structure description when you tap the name
of the structure

All iOS
- More structures with webpage description
- Cache webpages for speedup
As usual suggestions are welcome.

Upcoming features should include 3D visualization.

The link for download is:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=381072423&mt=8

Cheers

Pedro Paulo Jr.
___
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.


Re: [Freesurfer] ICV smaller than the brain

2011-05-04 Thread Martin Reuter
Hi jeff.
Probably your Talairach registrations fail. There are several different maps. I 
don't remember which one is the one used for the eTIV but it is documented on 
the wiki. You probably looked at the wrong transforms.

Best Martin

Send from my phone

On May 4, 2011, at 2:47 AM, Jeff Sadino  wrote:

> Hello,
> 
> I asked a question similar to this last year when working with FS 4.3.1, and 
> I'm hoping that there is something new in FS 5 that can help.
> 
> I am having a problem where a lot of my subjects' brains are larger than the 
> eICV.  In FS 4.3.1, it is happening in about 70/140 subjects, and in FS 5, it 
> is happening in about 30/140 subjects.  I checked them in tkregister2, and 
> they look ok.  I can use the --old-etiv-only command, but then the problem is 
> that my ICV shoots up to 1.7L, and my brain/ICV ratio drops to .65, way to 
> low to be reasonable.  What could the reason for this be, and are there any 
> other tricks that I could use?
> 
> Thank you,
> Jeff Sadino
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

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



Re: [Freesurfer] A problem about mri_glmfit result

2011-05-04 Thread Douglas Greve
It's a numerical issue having to due with adding very large numbers with 
very small ones. You don't get exactly the right number out, so there is 
a small error. Over many operations, these errors accumulate.


doug

On 5/4/11 7:17 AM, soft.join Huang wrote:

Oh, sorry, Greve. I misunderstood your suggestion.
Now I get the same resulte in both mri_glmfit and matlab. Thanks a lot!
But there is still a question about how it happened. Why I have to do 
so to get the correct result? There is nothing relevant between the 
number scale of one variable and the beta values of other variables 
theoretically. Is it any relevance to the data size of data structure 
in mri_glmfit?

Best Regards,
Lijie Huang
On Tue, May 3, 2011 at 10:55 PM, Douglas N Greve 
mailto:gr...@nmr.mgh.harvard.edu>> wrote:


sorry, I mean to do it for both the FSGD file and the matlab
script. I just tried it with your data and it works.

doug

soft.join Huang wrote:

Hi, doug.
 Thanks for your suggestion, but it does not seem to work.
After having divided the ICV by 1e6, I reculated the betas,
and got the similar results as before in Matlab, just the
beta4 -- correspondent to ICV -- multiplied a 10^6.
And then I computed the rank of matrix X that the value is 4,
indicating that each 2 variables in design matrix do not
highly correlated.
Also I have finished an regress analysis including one class
variable and one continuous variable using mri_glmfit, got the
same result in Matlab.
A wired situation...
Is it any additional constrains in mri_glmfit when doing
regression analysis?
 Lijie Huang

 On Mon, May 2, 2011 at 9:09 PM, Douglas N Greve
mailto:gr...@nmr.mgh.harvard.edu>
>> wrote:

   I think the problem may be that your data are "badly scaled"
   meaning that one column is much greater than another
column. Try
   dividing the ICV by 1e6 and see if you get more similar
results.

   doug

   soft.join Huang wrote:

   Doug,
Thanks for your reply.
   I recalculated the beta value and got the same results
as the
   Matlab does, but be different from the mri_glmfit's. I
can not
   figure out where the problem is.
   Details following:
   I use the command
mri_glmfit --table lh.volume.txt --fsgd
   volume.gender.fsgd doss --C gender.diff.mtx --glmdir
lh.vol.glmdir
   to finish regression analysis. and got the beta value (
   beta1 = 1.9781e+03, beta2 = 2.0639e+03, beta3 = 110.9220,
   beta4 = 5.1964e-04 ) from beta.mgh file.
   Using X.mat file and the same dependent variable
Y.mat as
   mri_glmfit's, I got totally different results in
Matlab( beta1
   = 5.19e+02, beta2 = 4.44e+02, beta3 = 90.32, beta4 =
0.0015 ).
   I don't know how it happened...
Hope for your reply.
   The data I used are all in the attachment.
Best Regrads,
Lijie Huang
   On Fri, Apr 29, 2011 at 9:45 PM,
mailto:gr...@nmr.mgh.harvard.edu>
>

 Hi all,
>
> I'm working on a group analysis using mri_glmfit.
>  In analysis directory, I got a X.mat file which
   containing the
  matrix X (
> size 50x4 ) used to regress analysis, also the beta value
   from
  beta.mgh
> file.
> Strangely, I loaded the X.mat in Matlab and recalculated the
  beta using
> function regress in matlab, but got a different result
   from that of
> mri_glmfit.
> I don't know where the problem is, is there any difference in
  algorithm
> between mri_glmfit and matlab function regress(
   regress(Y,X) )?
  or I made
> some mistakes during the procedure.
> The X.mat file and the dependent variable Y.mat are in the

Re: [Freesurfer] A problem about mri_glmfit result

2011-05-04 Thread soft.join Huang
Oh, sorry, Greve. I misunderstood your suggestion.
Now I get the same resulte in both mri_glmfit and matlab. Thanks a lot!
But there is still a question about how it happened. Why I have to do so to
get the correct result? There is nothing relevant between the number scale
of one variable and the beta values of other variables theoretically. Is it
any relevance to the data size of data structure in mri_glmfit?

Best Regards,
Lijie Huang

On Tue, May 3, 2011 at 10:55 PM, Douglas N Greve
wrote:

> sorry, I mean to do it for both the FSGD file and the matlab script. I just
> tried it with your data and it works.
>
> doug
>
> soft.join Huang wrote:
>
>> Hi, doug.
>>  Thanks for your suggestion, but it does not seem to work.
>> After having divided the ICV by 1e6, I reculated the betas, and got the
>> similar results as before in Matlab, just the beta4 -- correspondent to ICV
>> -- multiplied a 10^6.
>> And then I computed the rank of matrix X that the value is 4, indicating
>> that each 2 variables in design matrix do not highly correlated.
>> Also I have finished an regress analysis including one class variable and
>> one continuous variable using mri_glmfit, got the same result in Matlab.
>> A wired situation...
>> Is it any additional constrains in mri_glmfit when doing regression
>> analysis?
>>  Lijie Huang
>>
>>   On Mon, May 2, 2011 at 9:09 PM, Douglas N Greve <
>> gr...@nmr.mgh.harvard.edu > wrote:
>>
>>I think the problem may be that your data are "badly scaled"
>>meaning that one column is much greater than another column. Try
>>dividing the ICV by 1e6 and see if you get more similar results.
>>
>>doug
>>
>>soft.join Huang wrote:
>>
>>Doug,
>> Thanks for your reply.
>>I recalculated the beta value and got the same results as the
>>Matlab does, but be different from the mri_glmfit's. I can not
>>figure out where the problem is.
>>Details following:
>>I use the command
>> mri_glmfit --table lh.volume.txt --fsgd
>>volume.gender.fsgd doss --C gender.diff.mtx --glmdir lh.vol.glmdir
>>to finish regression analysis. and got the beta value (
>>beta1 = 1.9781e+03, beta2 = 2.0639e+03, beta3 = 110.9220,
>>beta4 = 5.1964e-04 ) from beta.mgh file.
>>Using X.mat file and the same dependent variable Y.mat as
>>mri_glmfit's, I got totally different results in Matlab( beta1
>>= 5.19e+02, beta2 = 4.44e+02, beta3 = 90.32, beta4 = 0.0015 ).
>>I don't know how it happened...
>> Hope for your reply.
>>The data I used are all in the attachment.
>> Best Regrads,
>> Lijie Huang
>>On Fri, Apr 29, 2011 at 9:45 PM, >
>>>>> wrote:
>>
>>   Lijie,
>>
>>   I don't know what the matlab regress() function does.
>>mri_glmfit
>>   is just
>>   solving the GLM equation, which you can do easily in matlab:
>>
>>   beta = inv(X'*X)*X'*y;
>>
>>   try that and see if you get the same as mri_glmfit.
>>
>>   doug
>>
>>
>>   > Hi all,
>>   >
>>   > I'm working on a group analysis using mri_glmfit.
>>   >  In analysis directory, I got a X.mat file which
>>containing the
>>   matrix X (
>>   > size 50x4 ) used to regress analysis, also the beta value
>>from
>>   beta.mgh
>>   > file.
>>   > Strangely, I loaded the X.mat in Matlab and recalculated the
>>   beta using
>>   > function regress in matlab, but got a different result
>>from that of
>>   > mri_glmfit.
>>   > I don't know where the problem is, is there any difference in
>>   algorithm
>>   > between mri_glmfit and matlab function regress(
>>regress(Y,X) )?
>>   or I made
>>   > some mistakes during the procedure.
>>   > The X.mat file and the dependent variable Y.mat are in the
>>   attachment.
>>   >
>>   > Thanks in advance
>>   >
>>   > Lijie Huang
>>   > ___
>>   > 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 Hel