[Freesurfer] cannon open .mgh file using MRIread

2010-06-07 Thread corinna bauer
When I load the file directly to load_mgh I still get the error

ERROR: could not open
/home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.white.projfrac35.mgh
for reading
??? Attempt to reference field of non-structure array.

Error in == gwratiotest at 5
gray2=gray.vol;


here is my matlab file:

function gwratiotest


gray=load_mgh('/home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.white.projfrac35.mgh');


white=load_mgh('/home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.white.projdist.neg1.mgh');

gray2=gray.vol;
white2=white.vol;
gwratio.vol = gray2 / white2;
MRIwrite(gwratio,
'/home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.gwratio.mgh');

end



On Fri, Jun 4, 2010 at 12:20 PM, Bruce Fischl fis...@nmr.mgh.harvard.eduwrote:

 Hi Corinna,

 sorry, I'm not sure what's going wrong. Can you try loading that volume
 calling load_mgh directly? Make sure the filename is exactly right. It's
 hard to tell with all the carriage returns in your email.

 cheers
 Bruce



 On Fri, 4 Jun 2010, corinna bauer wrote:

  When I run mri_info I get:

 Volume information for

 /home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.white.projfrac.35.mgh
 type: MGH
   dimensions: 23334 x 1 x 5
  voxel sizes: 1., 1., 1.
 type: FLOAT (3)
  fov: 23334.000
  dof: 0
   xstart: -11667.0, xend: 11667.0
   ystart: -0.5, yend: 0.5
   zstart: -2.5, zend: 2.5
   TR: 3000.00 msec, TE: 3.61 msec, TI: 1000.00 msec, flip angle:
 8.00 degrees
  nframes: 1
 ras xform present
   xform info: x_r =  -1., y_r =   0., z_r =   0., c_r =
 5.5017
 : x_a =   0., y_a =   0., z_a =   1., c_a =
 11.5254
 : x_s =   0., y_s =  -1., z_s =   0., c_s =
 0.

 talairach xfm :

 /home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/transforms/talairach.xfm
 Orientation   : LIA
 Primary Slice Direction: coronal

 voxel to ras transform:
  -1.   0.   0. 11672.5020
   0.   0.   1. 9.0254
   0.  -1.   0. 0.5000
   0.   0.   0. 1.

 voxel-to-ras determinant -1

 ras to voxel transform:
  -1.   0.   0. 11672.5020
  -0.  -0.  -1. 0.5000
  -0.   1.  -0.-9.0254
   0.   0.   0. 1.



 On Fri, Jun 4, 2010 at 9:58 AM, Bruce Fischl fis...@nmr.mgh.harvard.edu
 wrote:

  if you run mri_info on the .mgh file does it return reasonable looking
 values?

 On Fri, 4 Jun 2010, corinna bauer wrote:

  Hi Bruce,

 I am having trouble getting my .mgh files to open in MRIread. I get the
 following error message.

 ERROR: could not open /home/freesurfer4.4.0/
 subjects/corinna/ADNI/003_S_1057/mri/lh.white.projfrac35.mgh for reading
 ERROR: loading


 /home/freesurfer4.4.0/subjects/corinna/ADNI/003_S_1057/mri/lh.white.projfrac35.mgh
 as MGH
 ??? Attempt to reference field of non-structure array.

 Error in == gwRatio at 24
  gwratio.vol = gray.vol / white.vol;


 here's my .m file

 function gwRatio

 rootdir = '/home/freesurfer4.4.0/subjects/corinna/ADNI';
 paths=dir([rootdir,'/*']);

 numel(paths)
 num = numel(paths);

 for ii = 1:num
  if(paths(ii).isdir  ~strcmp(paths(ii).name,'.') 
 ~strcmp(paths(ii).name,'..'))

  graypath=
 fullfile(rootdir,paths(ii).name,'mri/lh.white.projfrac35.mgh');
  whitepath =
 fullfile(rootdir,paths(ii).name,'mri/lh.white.projdist.neg1.mgh');
  outpath = fullfile(rootdir,paths(ii).name,'mri/lh.gwratio.mgh');

  fprintf('- Processing %i of %i -\n', ii, num);
  fprintf('gray: %s\n', graypath);
  fprintf('white: %s\n', whitepath);
  fprintf('out: %s\n', outpath);

  gray = MRIread(graypath);
  white = MRIread(whitepath);
  gwratio = gray;
  gwratio.vol = gray.vol / white.vol;
  MRIwrite(gwratio, outpath);
  end
 end

 corinna



 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


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 

[Freesurfer] standard deviation map

2010-06-07 Thread Michael Scheel
Dear FS experts,

I have a anatomical scan of a subject with a rare neurogenetical disorder. I'd 
like to compare this with a age matched control group.
How can I visualize a z-score transform map of the cortical thickness, i.e. how 
would I compute and vizualize 
the number/amount of standard deviations that my subjects differs from the mean 
of the control group at each vertex?

Thanks, Michael
___
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] Label files for the Cortical Ribbon

2010-06-07 Thread Tina Jeon
Hello all!

After creating some labeling files from aparc.a2005s.annot, I noticed that my 
sulci and gyri volumes generated from the .label files (i.e., after running 
mri_annotation2label and mri_label2vol) were only representing the outer layer 
of the white surface. Is there any way to generate .label files that include 
the entire cortical ribbon? 

Thanks, any help would be appreciated. 

Tina

___
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] Label files for the Cortical Ribbon

2010-06-07 Thread Tina Jeon
Hello freesurfers!

After creating some labeling files from aparc.a2005s.annot, I noticed that my 
sulci and gyri volumes generated from the .label files (i.e., after running 
mri_annotation2label and mri_label2vol) were only representing the outer layer 
of the white surface. Is there any way to generate .label files that include 
the entire cortical ribbon?

Thanks, any help would be appreciated.

Tina Jeon

___
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] tksurfer issue

2010-06-07 Thread Gad Klein
I am having a problem using tksurfer. It does not appear to be the same
issue that others have had in the past with NVIDIA drivers etc.
When I try to load a surface file the entire process freezes and eventually
if I let it run, I will get the following error:
gkl...@gklein-nspc:~$ tksurfer CL lh full.flat.patch.3d
surfer: current subjects dir: /home/gklein/fssubjects
surfer: not in scripts dir == using cwd for session root
surfer: session root data dir ($session) set to:
surfer: /home/gklein
surfer: Reading header info from /home/gklein/fssubjects/CL/mri/T1.mgz
/home/gklein/fssubjects/CL/surf/lh.full.flat.patch.3d: face[0].v[0] = 0, but
face 0 not in vertex 0 face list

Cannot allocate memory

As I am new to FS, any help would be appreciated. Thanks.

  -Gad
___
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] make_average_subject with large cohorts

2010-06-07 Thread Nick Schmansky
Marie,

I fixed the memory leak that was causing your out-of-memory error when
running mris_make_average_surface.  A new mris_make_average_surface for
Mac Intel Leopard is posted here:

ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/misc/macos-leopard-intel/

I'm still looking into the mri_average failure. I dont know what to say
about the license error, as the code that handles the license hasnt
changed since v2.0.

As an aside, I'm skeptical of the utility of a volume or surface
composed of 400+ subjects.  The volume will be too blurry to be of use,
and the surface will have lost any group-specific patterns that might
have existed.  If retaining the unique morphometric properties of your
subject set is important, you might want to consider using just 20 or so
randomly chosen subjects.  Perhaps Bruce or others can comment.

Nick


On Wed, 2010-06-02 at 18:53 +0200, Marie Schaer wrote:
 Hi Nick,
 
 Thank you for your response. I added the flag --debug, please find in  
 attachment the log. I am working on a Mac Intel Quad-Core Intel Xeon,  
 Processor 3 GHz, RAM 5GB. I also tried with another similar machine  
 which 9GB, but it exited with the same error exactly at the same  
 point. Even using the -no-aseg option it stops exactly at the same  
 point. I also provide you a screenshot with the top command running, a  
 few minutes before the error, and just after the error.
 
 As for the license error, I just had this problem using the Freesurfer  
 version 4.5, and you are right, it may be a connection problem because  
 our data are on a server (mounted with afp). It is however strange  
 that it exits always at exactly the same point... Anyway, no license  
 problem with version 4.4 or 4.3.
 
 Many thanks for your help,
 
 Marie
 
 On 1 juin 10, at 16:54, Nick Schmansky wrote:
 
  can you try adding the flag --debug to make_average_volume?  it will
  output a lot of stuff, but will pinpoint at which stage it is running
  out of memory.  also, try running 'top' in another terminal to monitor
  the amount of memory it's consuming while running.
 
  as for the license error, that is bizarre, i can't think of a reason  
  for
  that, unless your subjects are located on an NFS drive (a network).
  we've seen lots of problems with NFS and the Mac OS, where the
  connection drops for a couple seconds.
 
  n.
 
 
  On Mon, 2010-05-31 at 22:39 +0200, Marie Schaer wrote:
  Hi everyone,
 
  I did not find a solution to my problem yet: how to launch
  make_average_subject / make_average_volume / make_average_surface  
  on a
  large number of subjects on a Mac Intel? Did someone encounter this
  error before?
 
  Many thanks in advance for your help,
 
  Marie
 
  On 29 mai 10, at 20:07, Marie Schaer wrote:
 
 
  Hi Nick,
 
  Sorry for disturbing again. As advised, I tried to launch separately
  make_average_volume and make_average_surface. Even with the --no- 
  aseg
  option with make_average_volume I got the cannot allocate memory
  error. And with the make_average_surface I got the license error  
  in
  the middle of one subject processing... Any idea?
 
  Thank you very much,
 
  Marie
 
 
  On 28 mai 10, at 21:37, Nick Schmansky wrote:
 
  try adding --no-aseg to the command line.  that out-of-memory error
  seems to originate with creation of the average aseg.mgz file
  (hopefully
  you wont need it for your subject set, typically you dont need
  aseg.mgz
  since aseg stats are usually gathered from a set of aseg.stats  
  files,
  not from an average aseg.mgz).
 
  doug: maybe we should make --no-aseg the default?
 
  n.
 
 
  On Fri, 2010-05-28 at 21:31 +0200, Marie Schaer wrote:
  Hello everybody,
 
  I have a problem running make_average_subject for a large number  
  of
  subjects (400) on a Mac Intel. I tried with different Freesurfer
  versions (all the log outputs are attached). Using the freesurfer
  version 4.3 and 4.4 the make_average_subject script always stop at
  the
  297th subject with the error Cannot allocate memory. I already
  tried
  to uncomment the line limit descriptors unlimited or to set it  
  to
  various values, as proposed in the mailing list, but without  
  success
  (it always stop at the 297th subject). Then I tried with the
  Freesurfer version 4.5 (therefore I had to recompute the
  lh.inflated.H
  and lh.inflated.K which are not automatically produced in previous
  versions), but with the 4.5 version I got a strange license  
  error
  message in the middle of the script (and my licence is certainly
  fine
  as I can run any other script without problems).
 
  Does anyone have an idea? Many thanks in advance for your precious
  help,
 
  Marie
 
  ___
  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
  

Re: [Freesurfer] make_average_subject with large cohorts

2010-06-07 Thread Nick Schmansky
Marie,

The memory leak in mri_average has also been fixed.  The new version is
in the same ftp location as mris_make_average_surface.

N.

On Mon, 2010-06-07 at 14:43 -0400, Nick Schmansky wrote:
 Marie,
 
 I fixed the memory leak that was causing your out-of-memory error when
 running mris_make_average_surface.  A new mris_make_average_surface for
 Mac Intel Leopard is posted here:
 
 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/misc/macos-leopard-intel/
 
 I'm still looking into the mri_average failure. I dont know what to say
 about the license error, as the code that handles the license hasnt
 changed since v2.0.
 
 As an aside, I'm skeptical of the utility of a volume or surface
 composed of 400+ subjects.  The volume will be too blurry to be of use,
 and the surface will have lost any group-specific patterns that might
 have existed.  If retaining the unique morphometric properties of your
 subject set is important, you might want to consider using just 20 or so
 randomly chosen subjects.  Perhaps Bruce or others can comment.
 
 Nick
 
 
 On Wed, 2010-06-02 at 18:53 +0200, Marie Schaer wrote:
  Hi Nick,
  
  Thank you for your response. I added the flag --debug, please find in  
  attachment the log. I am working on a Mac Intel Quad-Core Intel Xeon,  
  Processor 3 GHz, RAM 5GB. I also tried with another similar machine  
  which 9GB, but it exited with the same error exactly at the same  
  point. Even using the -no-aseg option it stops exactly at the same  
  point. I also provide you a screenshot with the top command running, a  
  few minutes before the error, and just after the error.
  
  As for the license error, I just had this problem using the Freesurfer  
  version 4.5, and you are right, it may be a connection problem because  
  our data are on a server (mounted with afp). It is however strange  
  that it exits always at exactly the same point... Anyway, no license  
  problem with version 4.4 or 4.3.
  
  Many thanks for your help,
  
  Marie
  
  On 1 juin 10, at 16:54, Nick Schmansky wrote:
  
   can you try adding the flag --debug to make_average_volume?  it will
   output a lot of stuff, but will pinpoint at which stage it is running
   out of memory.  also, try running 'top' in another terminal to monitor
   the amount of memory it's consuming while running.
  
   as for the license error, that is bizarre, i can't think of a reason  
   for
   that, unless your subjects are located on an NFS drive (a network).
   we've seen lots of problems with NFS and the Mac OS, where the
   connection drops for a couple seconds.
  
   n.
  
  
   On Mon, 2010-05-31 at 22:39 +0200, Marie Schaer wrote:
   Hi everyone,
  
   I did not find a solution to my problem yet: how to launch
   make_average_subject / make_average_volume / make_average_surface  
   on a
   large number of subjects on a Mac Intel? Did someone encounter this
   error before?
  
   Many thanks in advance for your help,
  
   Marie
  
   On 29 mai 10, at 20:07, Marie Schaer wrote:
  
  
   Hi Nick,
  
   Sorry for disturbing again. As advised, I tried to launch separately
   make_average_volume and make_average_surface. Even with the --no- 
   aseg
   option with make_average_volume I got the cannot allocate memory
   error. And with the make_average_surface I got the license error  
   in
   the middle of one subject processing... Any idea?
  
   Thank you very much,
  
   Marie
  
  
   On 28 mai 10, at 21:37, Nick Schmansky wrote:
  
   try adding --no-aseg to the command line.  that out-of-memory error
   seems to originate with creation of the average aseg.mgz file
   (hopefully
   you wont need it for your subject set, typically you dont need
   aseg.mgz
   since aseg stats are usually gathered from a set of aseg.stats  
   files,
   not from an average aseg.mgz).
  
   doug: maybe we should make --no-aseg the default?
  
   n.
  
  
   On Fri, 2010-05-28 at 21:31 +0200, Marie Schaer wrote:
   Hello everybody,
  
   I have a problem running make_average_subject for a large number  
   of
   subjects (400) on a Mac Intel. I tried with different Freesurfer
   versions (all the log outputs are attached). Using the freesurfer
   version 4.3 and 4.4 the make_average_subject script always stop at
   the
   297th subject with the error Cannot allocate memory. I already
   tried
   to uncomment the line limit descriptors unlimited or to set it  
   to
   various values, as proposed in the mailing list, but without  
   success
   (it always stop at the 297th subject). Then I tried with the
   Freesurfer version 4.5 (therefore I had to recompute the
   lh.inflated.H
   and lh.inflated.K which are not automatically produced in previous
   versions), but with the 4.5 version I got a strange license  
   error
   message in the middle of the script (and my licence is certainly
   fine
   as I can run any other script without problems).
  
   Does anyone have an idea? Many thanks in advance for your precious
   help,
  
   

Re: [Freesurfer] make_average_subject with large cohorts

2010-06-07 Thread ythomas
I am a little out of the loop. Just to clarify, Marie is trying to  
create an average subject out of 400+ subjects that have been run  
through the freesurfer pipeline? I don't see a problem with that  
(except possibly memory issues). If the subjects are from a  
homogeneous population (whatever homogeneous means), I would even say  
the more subjects the better.

--Thomas

On Jun 7, 2010, at 2:43 PM, Nick Schmansky wrote:

 Marie,

 I fixed the memory leak that was causing your out-of-memory error when
 running mris_make_average_surface.  A new mris_make_average_surface  
 for
 Mac Intel Leopard is posted here:

 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/misc/macos-leopard-intel/

 I'm still looking into the mri_average failure. I dont know what to  
 say
 about the license error, as the code that handles the license hasnt
 changed since v2.0.

 As an aside, I'm skeptical of the utility of a volume or surface
 composed of 400+ subjects.  The volume will be too blurry to be of  
 use,
 and the surface will have lost any group-specific patterns that might
 have existed.  If retaining the unique morphometric properties of your
 subject set is important, you might want to consider using just 20  
 or so
 randomly chosen subjects.  Perhaps Bruce or others can comment.

 Nick


 On Wed, 2010-06-02 at 18:53 +0200, Marie Schaer wrote:
 Hi Nick,

 Thank you for your response. I added the flag --debug, please find in
 attachment the log. I am working on a Mac Intel Quad-Core Intel Xeon,
 Processor 3 GHz, RAM 5GB. I also tried with another similar machine
 which 9GB, but it exited with the same error exactly at the same
 point. Even using the -no-aseg option it stops exactly at the same
 point. I also provide you a screenshot with the top command  
 running, a
 few minutes before the error, and just after the error.

 As for the license error, I just had this problem using the  
 Freesurfer
 version 4.5, and you are right, it may be a connection problem  
 because
 our data are on a server (mounted with afp). It is however strange
 that it exits always at exactly the same point... Anyway, no license
 problem with version 4.4 or 4.3.

 Many thanks for your help,

 Marie

 On 1 juin 10, at 16:54, Nick Schmansky wrote:

 can you try adding the flag --debug to make_average_volume?  it will
 output a lot of stuff, but will pinpoint at which stage it is  
 running
 out of memory.  also, try running 'top' in another terminal to  
 monitor
 the amount of memory it's consuming while running.

 as for the license error, that is bizarre, i can't think of a reason
 for
 that, unless your subjects are located on an NFS drive (a network).
 we've seen lots of problems with NFS and the Mac OS, where the
 connection drops for a couple seconds.

 n.


 On Mon, 2010-05-31 at 22:39 +0200, Marie Schaer wrote:
 Hi everyone,

 I did not find a solution to my problem yet: how to launch
 make_average_subject / make_average_volume / make_average_surface
 on a
 large number of subjects on a Mac Intel? Did someone encounter this
 error before?

 Many thanks in advance for your help,

 Marie

 On 29 mai 10, at 20:07, Marie Schaer wrote:


 Hi Nick,

 Sorry for disturbing again. As advised, I tried to launch  
 separately
 make_average_volume and make_average_surface. Even with the --no-
 aseg
 option with make_average_volume I got the cannot allocate memory
 error. And with the make_average_surface I got the license error
 in
 the middle of one subject processing... Any idea?

 Thank you very much,

 Marie


 On 28 mai 10, at 21:37, Nick Schmansky wrote:

 try adding --no-aseg to the command line.  that out-of-memory  
 error
 seems to originate with creation of the average aseg.mgz file
 (hopefully
 you wont need it for your subject set, typically you dont need
 aseg.mgz
 since aseg stats are usually gathered from a set of aseg.stats
 files,
 not from an average aseg.mgz).

 doug: maybe we should make --no-aseg the default?

 n.


 On Fri, 2010-05-28 at 21:31 +0200, Marie Schaer wrote:
 Hello everybody,

 I have a problem running make_average_subject for a large number
 of
 subjects (400) on a Mac Intel. I tried with different  
 Freesurfer
 versions (all the log outputs are attached). Using the  
 freesurfer
 version 4.3 and 4.4 the make_average_subject script always  
 stop at
 the
 297th subject with the error Cannot allocate memory. I already
 tried
 to uncomment the line limit descriptors unlimited or to set it
 to
 various values, as proposed in the mailing list, but without
 success
 (it always stop at the 297th subject). Then I tried with the
 Freesurfer version 4.5 (therefore I had to recompute the
 lh.inflated.H
 and lh.inflated.K which are not automatically produced in  
 previous
 versions), but with the 4.5 version I got a strange license
 error
 message in the middle of the script (and my licence is certainly
 fine
 as I can run any other script without problems).

 Does anyone have an idea? Many thanks in advance