Re: [Freesurfer] Stats2table_bash.sh script

2018-08-13 Thread Hoopes, Andrew
asegstats2table is a python2 script, and you are likely running it with 
python3. Try running the script with “python2” prepended to the command:

python2 asegstats2table --subjects $list --meas volume --skip --statsfile 
wmparc.stats --all-segs --tablefile wmparc_stats.txt

best,
Andrew


From:  on behalf of Schumman Resonance 

Reply-To: FS Help 
Date: Sunday, August 12, 2018 at 12:33 PM
To: FS Help 
Subject: [Freesurfer] Stats2table_bash.sh script


External Email - Use Caution

Hi,

I'm trying to run the Stats2table_bash.sh script from Jamaan Alghamdi & Dr. 
Vanessa Sluming.

And I get This error:

  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
.
.
.



This is my set up:


_


 freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c 
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /Applications/freesurfer
FSFAST_HOME   /Applications/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR  /Users/schumman/data
MNI_DIR   /Applications/freesurfer/mni
FSL_DIR   /usr/local/fsl

_


This is the line from SetUpFreeSurfer.sh for my subjects directory


# Set this to your subjects/ dir, usually freesurfer/subjects/
if [ -z $SUBJECTS_DIR ]; then
export SUBJECTS_DIR=/Users/schumman/data


__

And I modified in their script to my FREESURFER_HOME as below


#!/bin/bash
path=`dirname $0`
sleep 1
cd $path
echo "This bash script will create table from ?.stats files"
echo "Written by Jamaan Alghamdi & Dr. Vanessa Sluming"
echo "University of Liverpool"
echo "jamaan.algha...@gmail.com"
echo "http://www.easyneuroimaging.com;
echo "20/12/2010

"


export FREESURFER_HOME=/Applications/freesurfer
sleep 1
source $FREESURFER_HOME/SetUpFreeSurfer.sh
sleep 1

export SUBJECTS_DIR=$PWD
list="`ls -d */`"
asegstats2table --subjects $list --meas volume --skip --statsfile wmparc.stats 
--all-segs --tablefile wmparc_stats.txt
.
.
.


I run the script from my_subject_directory.

I suspect this is something very obvious I'm not able to see and I apologize 
for such a basic question, any help would be much appreciated.

Thanks,
K



___
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] Stats2table_bash.sh script

2018-08-12 Thread Schumman Resonance
External Email - Use Caution

Thanks Robert, I guess my main issue is that I don't fully understand how
the script works:


[1] export SUBJECTS_DIR=*$PWD*
*[2] list="`ls -d */`"*
[3] asegstats2table --subjects *$list *--meas volume --skip --statsfile
wmparc.stats --all-segs --tablefile wmparc_stats.txt

I was assuming the variable $list would give SUBJECTS to --subjects based
on each directory where .stats files are.
I don't fully understand how lines [1] and [2] work.

Apologies if I'm not conveying my struggle with proper coding language :)



On Sun, Aug 12, 2018 at 2:03 PM, Dicamillo, Robert <
rdicami...@mgh.harvard.edu> wrote:

> Hello K,
>
> If you type
>
> $ asegstats2table --help
>
> you will see that you can specify subjects on the command line as, e.g.,
> for bert as
>
> —subjects bert
> or apparently
> -s bert
>
> It looks like the subjects option expects the name for at least one
> subjects (data),
> but the help output says you can list more than one subjects name as the
> argument to
> —subjects
>
> On Aug 12, 2018, at 12:31 PM, Schumman Resonance 
> wrote:
>
> External Email - Use Caution
>
>
> Hi,
>
> I'm trying to run the Stats2table_bash.sh script from Jamaan Alghamdi &
> Dr. Vanessa Sluming.
>
> And I get This error:
>
>   File "/Applications/freesurfer/bin/asegstats2table", line 195
> print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
>   ^
> SyntaxError: invalid syntax
>   File "/Applications/freesurfer/bin/asegstats2table", line 195
> print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
>   ^
> SyntaxError: invalid syntax
>   File "/Applications/freesurfer/bin/aparcstats2table", line 156
> print 'ERROR: atleast 1 subject must be provided'
> .
> .
> .
>
>
>
> This is my set up:
>
>
> _
>
>
>  freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c 
> Setting up environment for FreeSurfer/FS-FAST (and FSL)
> FREESURFER_HOME   /Applications/freesurfer
> FSFAST_HOME   /Applications/freesurfer/fsfast
> FSF_OUTPUT_FORMAT nii.gz
> SUBJECTS_DIR  /Users/schumman/data
> MNI_DIR   /Applications/freesurfer/mni
> FSL_DIR   /usr/local/fsl
>
> _
>
>
> This is the line from SetUpFreeSurfer.sh for my subjects directory
> 
>
> # Set this to your subjects/ dir, usually freesurfer/subjects/
> if [ -z $SUBJECTS_DIR ]; then
> export SUBJECTS_DIR=/Users/schumman/data
>
>
> __
>
> And I modified in their script to my FREESURFER_HOME as below
>
>
> #!/bin/bash
> path=`dirname $0`
> sleep 1
> cd $path
> echo "This bash script will create table from ?.stats files"
> echo "Written by Jamaan Alghamdi & Dr. Vanessa Sluming"
> echo "University of Liverpool"
> echo "jamaan.algha...@gmail.com"
> echo "http://www.easyneuroimaging.com;
> echo "20/12/2010
>
> "
>
>
> export FREESURFER_HOME=/Applications/freesurfer
> sleep 1
> source $FREESURFER_HOME/SetUpFreeSurfer.sh
> sleep 1
>
> export SUBJECTS_DIR=$PWD
> list="`ls -d */`"
> asegstats2table --subjects $list --meas volume --skip --statsfile
> wmparc.stats --all-segs --tablefile wmparc_stats.txt
> .
> .
> .
>
>
> I run the script from my_subject_directory.
>
> I suspect this is something very obvious I'm not able to see and I
> apologize for such a basic question, any help would be much appreciated.
>
> Thanks,
> K
>
>
>
> ___
> 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 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 

Re: [Freesurfer] Stats2table_bash.sh script

2018-08-12 Thread Dicamillo, Robert
Hello K,

If you type

$ asegstats2table --help

you will see that you can specify subjects on the command line as, e.g., for 
bert as

—subjects bert
or apparently
-s bert

It looks like the subjects option expects the name for at least one subjects 
(data),
but the help output says you can list more than one subjects name as the 
argument to
—subjects

On Aug 12, 2018, at 12:31 PM, Schumman Resonance 
mailto:schumm...@gmail.com>> wrote:


External Email - Use Caution


Hi,

I'm trying to run the Stats2table_bash.sh script from Jamaan Alghamdi & Dr. 
Vanessa Sluming.

And I get This error:

  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
.
.
.



This is my set up:


_


 freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c 
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /Applications/freesurfer
FSFAST_HOME   /Applications/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR  /Users/schumman/data
MNI_DIR   /Applications/freesurfer/mni
FSL_DIR   /usr/local/fsl

_


This is the line from SetUpFreeSurfer.sh for my subjects directory


# Set this to your subjects/ dir, usually freesurfer/subjects/
if [ -z $SUBJECTS_DIR ]; then
export SUBJECTS_DIR=/Users/schumman/data


__

And I modified in their script to my FREESURFER_HOME as below


#!/bin/bash
path=`dirname $0`
sleep 1
cd $path
echo "This bash script will create table from ?.stats files"
echo "Written by Jamaan Alghamdi & Dr. Vanessa Sluming"
echo "University of Liverpool"
echo "jamaan.algha...@gmail.com"
echo "http://www.easyneuroimaging.com"
echo "20/12/2010

"


export FREESURFER_HOME=/Applications/freesurfer
sleep 1
source $FREESURFER_HOME/SetUpFreeSurfer.sh
sleep 1

export SUBJECTS_DIR=$PWD
list="`ls -d */`"
asegstats2table --subjects $list --meas volume --skip --statsfile wmparc.stats 
--all-segs --tablefile wmparc_stats.txt
.
.
.


I run the script from my_subject_directory.

I suspect this is something very obvious I'm not able to see and I apologize 
for such a basic question, any help would be much appreciated.

Thanks,
K



___
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] Stats2table_bash.sh script

2018-08-12 Thread Dicamillo, Robert
Hello K,

If you type

$ asegstats2table --help

you will see that you can specify subjects on the command line as, e.g., for 
bert as

—subjects bert
or apparently
-s bert

It looks like the subjects option expects the name for at least one subjects 
(data),
but the help output says you can list more than one subjects name as the 
argument to
—subjects

On Aug 12, 2018, at 12:31 PM, Schumman Resonance 
mailto:schumm...@gmail.com>> wrote:


External Email - Use Caution


Hi,

I'm trying to run the Stats2table_bash.sh script from Jamaan Alghamdi & Dr. 
Vanessa Sluming.

And I get This error:

  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
  ^
SyntaxError: invalid syntax
  File "/Applications/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
.
.
.



This is my set up:


_


 freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c 
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /Applications/freesurfer
FSFAST_HOME   /Applications/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR  /Users/schumman/data
MNI_DIR   /Applications/freesurfer/mni
FSL_DIR   /usr/local/fsl

_


This is the line from SetUpFreeSurfer.sh for my subjects directory


# Set this to your subjects/ dir, usually freesurfer/subjects/
if [ -z $SUBJECTS_DIR ]; then
export SUBJECTS_DIR=/Users/schumman/data


__

And I modified in their script to my FREESURFER_HOME as below


#!/bin/bash
path=`dirname $0`
sleep 1
cd $path
echo "This bash script will create table from ?.stats files"
echo "Written by Jamaan Alghamdi & Dr. Vanessa Sluming"
echo "University of Liverpool"
echo "jamaan.algha...@gmail.com"
echo "http://www.easyneuroimaging.com"
echo "20/12/2010

"


export FREESURFER_HOME=/Applications/freesurfer
sleep 1
source $FREESURFER_HOME/SetUpFreeSurfer.sh
sleep 1

export SUBJECTS_DIR=$PWD
list="`ls -d */`"
asegstats2table --subjects $list --meas volume --skip --statsfile wmparc.stats 
--all-segs --tablefile wmparc_stats.txt
.
.
.


I run the script from my_subject_directory.

I suspect this is something very obvious I'm not able to see and I apologize 
for such a basic question, any help would be much appreciated.

Thanks,
K



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