[Freesurfer] CVS registration questions

2013-10-26 Thread raij

Hi Lilla et al,

I am preparing to CVS register 30+ subjects to improve FSL probabilistic
tractography alignment across subjects. First, thanks for a really cool
tool! Then, I have some questions:

1. mri_cvs_register step1 is spherical registration. However, I have
already run FS5.3 recon-all -all for all subjects, which includes
spherical registration. Are the recon-all and mri_cvs_register spherical
registrations identical? If so, will mri_cvs_register be able to use the
previously computed spherical registration (with flags --step2 --step3),
or will it need to compute a new spherical registration? Will
mri_cvs_register overwrite any of my earlier recon-all results?

2. What are the pros and cons for using one of the following as templates,
and which one would you recommend:
-Randomly selected individual subject
-CVS35
-CVS35_inMNI152

3. When using MNI152_1mm as template, I guess this is a 1 mm resolution
image (as $FREESURFER_HOME/subjects/cvs_avg35_inMNI152/mri/T1.mgz seems to
be in 1 mm resolution)? Technically, is this the cvs_avg35 image that has
been CVS-registered with the MNI152_1mm image? Or is this a FLIRT-type 3D
registration from cvs_avg35 to MNI152_1mm without surface information (I
guess extracting the surface from MNI152 would be difficult)?

4. I run into the following error in FS stable 5.3 (source
/usr/local/freesurfer/nmr-stable53-env):

mri_cvs_check --mov $SUBJECT
Using the CVS template as registration target.
The following files are missing:
/usr/local/freesurfer/stable5_3_0/bin/mri_cvs_register.settings.txt
You need to find these files or run reconall on the data in order to run
mri_cvs_register.

Is this file required, or is this a bogus error?

5. Are there parallel processing versions that could be run on the cluster?

Thanks!

Tommi

---
Tommi Raij, MD, PhD
TM Core Director
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] CVS registration questions

2013-10-28 Thread raij

Thanks Lilla!

Which MNI152 version was used as template when doing nonlinear
CVS-registering from cvs_avg35 into MNI152 space? For example, was this
MNI152 ICBM 2009a 1mm Nonlinear Asymmetric?

Bests, Tommi

>
> Hi Tommi,
>
>
>> I am preparing to CVS register 30+ subjects to improve FSL probabilistic
>> tractography alignment across subjects. First, thanks for a really cool
>> tool! Then, I have some questions:
>>
>> 1. mri_cvs_register step1 is spherical registration. However, I have
>> already run FS5.3 recon-all -all for all subjects, which includes
>> spherical registration. Are the recon-all and mri_cvs_register spherical
>> registrations identical? If so, will mri_cvs_register be able to use the
>> previously computed spherical registration (with flags --step2 --step3),
>> or will it need to compute a new spherical registration? Will
>> mri_cvs_register overwrite any of my earlier recon-all results?
>
> The two calls are similar but not identical. In the recon call your
> registration target is different and the call uses a different set of
> parameters. So you should still call step1 in your processing and no
> worries, CVS does not overwrite your previous solutions.
>
>> 2. What are the pros and cons for using one of the following as
>> templates,
>> and which one would you recommend:
>> -Randomly selected individual subject
>> -CVS35
>> -CVS35_inMNI152
>
> That is your call and the decision will probably depend on your
> application or intended use of the results. Using an individual subject
> as a template can bias further population comparison, for example, as the
> subject might not be the most representative one for your population.
> Using the CVS35 atlas diminishes this bias and the CVS35_inMNI152 would
> provide you with results in the MNI152 space, so if you need to report
> results in that space that could be useful.
>
>> 3. When using MNI152_1mm as template, I guess this is a 1 mm resolution
>> image (as $FREESURFER_HOME/subjects/cvs_avg35_inMNI152/mri/T1.mgz seems
>> to
>> be in 1 mm resolution)? Technically, is this the cvs_avg35 image that
>> has
>> been CVS-registered with the MNI152_1mm image? Or is this a FLIRT-type
>> 3D
>> registration from cvs_avg35 to MNI152_1mm without surface information (I
>> guess extracting the surface from MNI152 would be difficult)?
>
> It is the CVS35 average transformed and reconned in the MNI152 space. It
> definitely has surface information, otherwise CVS would not run.
>
>> 4. I run into the following error in FS stable 5.3 (source
>> /usr/local/freesurfer/nmr-stable53-env):
>>
>> mri_cvs_check --mov $SUBJECT
>> Using the CVS template as registration target.
>> The following files are missing:
>> /usr/local/freesurfer/stable5_3_0/bin/mri_cvs_register.settings.txt
>> You need to find these files or run reconall on the data in order to run
>> mri_cvs_register.
>>
>> Is this file required, or is this a bogus error?
>
> That file is required. I will double-check why that is not in the
> distribution.
>
>> 5. Are there parallel processing versions that could be run on the
>> cluster?
>
> Yes. You can use --openmp to take adventage of it. The default is 1.
>
> Let me know if you have any other questions. Lilla
>
>
>

___
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 partial overlays?

2013-04-09 Thread raij

Hi,

We need to display surface data (.w file). However, our algorithm failed
to assign values for some vertices (and were therefore given the value of
exactly zero), and to clearly differentiate those from vertices where we
successfully computed values, we would like the vertices where we could
not compute a value to be blank (=only the underlying anatomical surface
shows).

Normally I would just threshold the values to get rid of the "blank"
vertices. However, we want to use tksurfer "offset 0.5" to shift the
distribution such that all values smaller than 0.5 are shown as blue and
all values larger than 0.5 in red/yellow. The offset also has the effect
that the vertices where we were unable to compute a value will now have a
value of exactly -0.5.

Then, the question becomes how to make tksurfer paint only the vertices
where we have a successfully computed value. After the shift, thresholding
will no longer work because it only operates on values around zero.

We have tried editing the .w file by both (i) removing the values from the
vertices that we do not want painted, and (ii) removing the vertices (the
entire line, vertex index plus value) from the file, but the tksurfer
brain surface window still shows an overlay with a value of 0 in these
vertices.

Thanks!

Tommi




---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] Averaging overlays/labels across subjects

2012-08-12 Thread raij

Dear Surfers,

I have (non-fMRI) .w format surface overlays/labels, computed at the
smoothwm surface in each individual subject, in 25 subjects. FS5.1
recon-all has been run for all T1 images.

I already managed to convert all individual surface overlays into the
surface space of one of the subjects (or fsaverage) using mri_surf2surf,
and in the process also converted the format from .w to .mgh (as I
understand .w is pretty much legacy).

Now, I would just need to compute an average across these overlays. I
would greatly appreciate any suggestions which FS tools to use for this.
Thank you in advance!

(In case it matters, the overlays are E-field estimates, with a numerical
value given for each vertex point. Also each overlay has only one time
point.)

Bests,

Tommi


---
Tommi Raij, MD, PhD
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] mni152reg error (file permission denied)

2013-01-23 Thread raij

Dear Surfers,

mni152reg --$SUBJECT exits with the error:

mkdir: cannot create directory
`/usr/pubsw/packages/fsl/current/data/standard/tmp.fslregister.18402':
Permission denied

Thereafter, a couple consequential errors follow
...
niiWrite(): error opening file
/usr/pubsw/packages/fsl/current/data/standard/tmp.fslregister.18402/refvol.fslregister.nii
...
ERROR: failure writing
/usr/pubsw/packages/fsl/current/data/standard/tmp.fslregister.18402/refvol.fslregister.nii

This is on FS 5.1.0 stable. The error seems linux box independent. Please
let me know if you need further info. Thanks!

Bests,

Tommi


---
Tommi Raij, MD, PhD
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] FS 5.1 MNI305 aparc+aseg registration with FSL MNI152

2013-03-13 Thread raij

Dear fellow Surfers,

I am trying to overlay

FreeSurfer 5.1 MNI305 (=fsaverage) aparc+aseg.mgz 3D volumes (caudate,
putamen, pallidum, etc)

onto

FSL MNI152 2mm resolution volume.

I first extract the nuclei from MNI305 aparc+aseg.mgz, for example:

mri_extract_label $FREESURFER_HOME/subjects/fsaverage/mri/aparc+aseg.mgz
11 MNI305_3D_masks/mask_lh_caudate.nii

I then try to resample the extracted volume into FSL MNI152 2mm space,
using the registration that comes with FS 5.1 (.dat format):

mri_vol2vol --mov MNI305_3D_masks/mask_lh_caudate.nii --targ
$FSLDIR/data/standard/MNI152_T1_2mm_brain.nii.gz --reg
$FREESURFER_HOME/average/mni152.register.dat --o
MNI152_3D_masks/mask_lh_caudate.nii

Unfortunately, caudate appears in a clearly incorrect location, both when
checking the result with tkmedit2, and when viewing the volumes with
freeview. Adding --inv does not fix this either.

However, if I simply overlay the volume extracted from MNI305 aparc+aseg
on the FSL MNI152 2 mm volume, the location looks just fine. It therefore
appears that MNI305 and MNI152 are in the same space, and mri_vol2vol is
not needed. Is this correct? Or am I just using an incorrect register.dat
file?

Thanks!

Tommi

Details:

On machine ernie
nmr-std-env (5.1.0 stable)
$FSLDIR = /usr/pubsw/packages/fsl/current/
$FREESURFER_HOME = /usr/local/freesurfer/stable5_1_0/

---
Tommi Raij, MD, PhD
TMS Core Director
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] dmri_trk2trk issue

2014-07-25 Thread raij
Hi,

I am attempting to morph deterministic tractography results (.trk file)
from the individual diffusion space into the average brain
cvs_avg35_inMNI152. However, something goes wrong, as the output trk file
is greatly misplaced / strongly distorted / wrongly sized.

The input file (dsi60.trk, a TrackVis trk file with an angle threshold of
60 degrees) loads fine in Trackvis, as do the inref and outref volumes (in
.nii format). The rigid body (.mat) and nonlinear (.m3z) registrations
also appear ok. The mat file (or more precisely, the corresponding
register.dat file) looked fine with tkregister2 and the latter was
successfully used to morph the corresponding probabilistic tractography
results from the individual diffusion space to cvs_avg35_inMNI152 (= the
same transformation I am trying to do here).

Any suggestions what I am doing wrong? For example, could this be related
to inref/outref voxel sizes or coordinate systems?

Just in case, I already tried using the inverse rigid registration
(anat2diff.mat) and the FDT-generated files inside DSI.bedpostX/xfms
(diff2str.mat and its inverse) but the results were in all cases very much
wrong, just in different ways.

FS 5.3 (nmr-std-env)
on machine avml
cd $SUBJECTS_DIR

dmri_trk2trk \
--in $SUBJECT/DSI/dsi60.trk \
--out TMSDSIGA_19Jul14/${SUBJECT}inCVS35MNI152_dsi60.trk \
--inref $SUBJECT/mri/norm.mgz \
--outref $FREESURFER_HOME/subjects/cvs_avg35_inMNI152/mri/norm.mgz \
--reg $SUBJECT/DSI/${SUBJECT}_diff2anat.mat \
--regnl $SUBJECT/cvs_CVS35MNI152/final_CVSmorph_tocvs_avg35_inMNI152.m3z \

reg (.mat) was computed as follows:
bbregister --mov dsi_b0.nii --frame 0 --bold --s $SUBJECT --init-fsl --reg
DSIregister.dat --fslmat ${SUBJECT}_anat2diff.mat

I would be happy to copy the data to a location of your choosing if you
would like to replicate the error. Thanks!

Tommi

---
Tommi Raij, MD, PhD
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] FreeSurfer NVIDIA card drivers with CentOS 6.5

2014-08-22 Thread raij

Hi,

Is there a FreeSurfer/MNE (maybe even FSL, TrackVis) recommendation to use
the "noveau" drivers that come with CentOS 6.5 or would it be better to go
with the proprietary drivers from NVIDIA?

I would imagine that since FS 5.3 does not use GPU for analysis, this is
mainly relevant for visualization (freeview etc) requiring 3D rendering of
volumes, surfaces, and tractography results simultaneously.

In case it matters, Dell Precision T7500 + NVIDIA Quadra FX 5800 here.

Thanks!

Tommi

---
Tommi Raij, MD, PhD


___
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] FreeSurfer NVIDIA card drivers with CentOS 6.5

2014-09-04 Thread raij

Hi Dan,

Thanks. While I agree that all kinds of GPUs might be sufficient as far as
the hardware and FS computations go, the drivers in fact make a major
difference for visualizations. For my card the proprietary NVIDIA drivers
turned out to be 10-20 times faster than the CentOS 6.5 Noveau drivers.
For example freeview with a couple of layers and little bit of 3D
rendering is unusable with the Noeveau drivers and works like a charm with
the NVIDIA drivers - the difference is really like day and night.

Cheers,

Tommi

> Just to add. If you are not using the CUDA options (which in my
> understanding aren't being updated anyway), I find that the gpu
> included in modern Intel cpus is more than sufficient for my
> FreeSurfer and MNE uses.
>
>
> HTH
> D
>
> On Fri, Aug 22, 2014 at 4:15 PM, Z K  wrote:
>> Tommi,
>>
>> Here at the Martinos Center we use the proprietary drivers from NVIDIA.
>> We have no reasons to believe the Nouveau drivers would work better, but
>> that isnt to say one doesnt exist.
>>
>> -Zeke
>>
>> On 08/22/2014 03:23 PM, r...@nmr.mgh.harvard.edu wrote:
>>>
>>> Hi,
>>>
>>> Is there a FreeSurfer/MNE (maybe even FSL, TrackVis) recommendation to
>>> use
>>> the "noveau" drivers that come with CentOS 6.5 or would it be better to
>>> go
>>> with the proprietary drivers from NVIDIA?
>>>
>>> I would imagine that since FS 5.3 does not use GPU for analysis, this
>>> is
>>> mainly relevant for visualization (freeview etc) requiring 3D rendering
>>> of
>>> volumes, surfaces, and tractography results simultaneously.
>>>
>>> In case it matters, Dell Precision T7500 + NVIDIA Quadra FX 5800 here.
>>>
>>> Thanks!
>>>
>>> Tommi
>>>
>>> ---
>>> Tommi Raij, MD, PhD
>>>
>>>
>>> ___
>>> 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
>
>
>

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


[Freesurfer] preproc-sess registration problem

2011-08-14 Thread raij

Hi Doug,

We have an old EPI data set where automatic (preproc-sess) or bbregister
with any init type give a bad result. Hence, we are attempting to use a
manual register.dat file instead. However, we must be doing something
wrong, because changing preproc-sess to use our manual register.dat (done
a couple of years ago) seems to have no effect. I suspect our preproc-sess
options as not set up correctly. Our goal is to present the results on
fsaverage surface.

Our preproc-sess command line is as follows:

preproc-sess -s avml07 -fwhm 5 -surface fsaverage lhrh -per-session
-sliceorder siemens -force -fsd bold -noreg -regfile bold/register.dat

The whole analysis script is at

/space/adapt/1/users/tapsya/project_AVISI_avml07/avml07/Analysis_avml07_fsaverage.csh

FS version = 5.1
machine = adapt (analysis running on cluster)
setenv SUBJECTS_DIR /space/adapt/1/users/tapsya/subject_MRIs/
individual subject = avml07
surface analysis lhrh, results to be presented on fsaverage surface
Total of 3 runs per analysis (each with different number of TRs)
Total of categories in mkanalysis-sess = 18 (9 main plus 9 rare target)
FIR analysis

Thank you for the advice in advance!

Bests,

Tommi


---
Tommi Raij, MD, PhD
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] preproc-sess registration problem

2011-08-16 Thread raij
Hi Doug,

You are absolutely right - I should have noticed the T1 warning in the
bbregister logs. I guess funny things can happen when scanning with a
short (1.15 sec) TR without fat suppression (also this was Trio before the
Tim upgrade and multichannel arrays).

We tried bbregister with t1 weighting and indeed it works much better.
However, to change only parameter at a time, we would prefer to run the
version 5.1 analysis using the old manual register.dat. The next question
is how do we do that exactly. As you suggest, we will (inside the bold
directory, not inside the individual run directories)

cp register.dat register.dof6.dat

... but then how should our preproc-sess command look like in order to
avoid re-registering the data and overwriting our registration file? Would
this simply be a matter of adding -noreg, such as:

preproc-sess -s avml07 -fwhm 5 -surface fsaverage lhrh -per-session
-sliceorder siemens -force -fsd bold -noreg

-Tommi

> wow, that's interesting. Your data is actually T1 weighted! There are a
> couple of things you can do. First, you can copy your register.dat over
> the register.dof6.dat. An alternative is to run register-sess
> (bbregister) with t1 weighting. You can do this by creating a file with
> the line "--t1" in it (no quotes) and passing that file to register-sess
> with "-bbr-xopts yourfile".
>
> doug
>
> r...@nmr.mgh.harvard.edu wrote:
>> Hi Doug,
>>
>> We have an old EPI data set where automatic (preproc-sess) or bbregister
>> with any init type give a bad result. Hence, we are attempting to use a
>> manual register.dat file instead. However, we must be doing something
>> wrong, because changing preproc-sess to use our manual register.dat
>> (done
>> a couple of years ago) seems to have no effect. I suspect our
>> preproc-sess
>> options as not set up correctly. Our goal is to present the results on
>> fsaverage surface.
>>
>> Our preproc-sess command line is as follows:
>>
>> preproc-sess -s avml07 -fwhm 5 -surface fsaverage lhrh -per-session
>> -sliceorder siemens -force -fsd bold -noreg -regfile bold/register.dat
>>
>> The whole analysis script is at
>>
>> /space/adapt/1/users/tapsya/project_AVISI_avml07/avml07/Analysis_avml07_fsaverage.csh
>>
>> FS version = 5.1
>> machine = adapt (analysis running on cluster)
>> setenv SUBJECTS_DIR /space/adapt/1/users/tapsya/subject_MRIs/
>> individual subject = avml07
>> surface analysis lhrh, results to be presented on fsaverage surface
>> Total of 3 runs per analysis (each with different number of TRs)
>> Total of categories in mkanalysis-sess = 18 (9 main plus 9 rare target)
>> FIR analysis
>>
>> Thank you for the advice in advance!
>>
>> Bests,
>>
>> Tommi
>>
>>
>> ---
>> Tommi Raij, MD, PhD
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>> Bldg 149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>> ___
>> 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
>
>
___
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] Coordinate transformations from orig/001.mgz to T1.mgz

2011-08-18 Thread raij

Hi,

We (Aapo Nummenmaa and I) are developing cross-platform software that
would allow translating third-party coordinates back and forth with
Freesurfer segmentations.

Our example structural image is MEMPRAGE_4e_p2_1mm_iso (1 mm isotropic,
192 sagittal slices, T1 weighting).

Our third-party system (TMS-navigator Nexstim NBS) uses DICOM/nifti with
origin (0,0,0) at right posterior inferior corner of the stack with x=R-L
y=I-S z=P-A.

Our goal is to relate the Nexstim NBS coordinates to these two images:
1. $SUBJECTS_DIR/$SUBJECT/mri/orig/001.mgz (not altered by recon-all)
2. $SUBJECTS_DIR/$SUBJECT/mri/T1.mgz (altered by recon-all)

For (1) above, "Volume Index" in tkmedit looks like this: origin (0,0,0)
is at right anterior superior corner of the stack with x=A-P y=S-I z=R-L.
Max values in tkmedit display were (255,243,191). The acquisition had 192
sagittal slices so the last number makes sense - not sure why the second
figure is not 255 (perhaps just a display thing). The orig/001.mgz stack
should be exactly the same stack as in the Nexstim NBS image (which is
just the plain DICOM), without any resampling or other processing, just
the axes have been reshuffled a bit.

For (2) above, "Volume Index" in tkmedit looks like this: origin (0,0,0)
is at right posterior superior corner of the stack with x=R-L y=S-I z=P-A.
Max values in tkmedit display were (255,255,255). This makes things
difficult, as we do not know what exactly recon-all did to orig/001.mgz
when it converted it into T1.mgz.

Our question is this: Is there a deterministic way to go from orig/001.mgz
to T1.mgz Volume Index coordinates? It seems that recon-all has at least
added sagittal slices to make the T1.mgz stack into a cube (looking at
lateral shift between 001.mgz and T1.mgz, I would guess that 32 1-mm
slices on both sides (2*32+192=256) were added)... Further, it is not
clear if the orig/001.mgz volume has been shifted, rotated, or resampled
by recon-all when turning it into T1.mgz.

Thank you for the advice!

Bests,

Tommi & Aapo

___
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] mri_surfcluster .w input from MEG/EEG data

2011-10-29 Thread raij

Hi Doug and Matti,

I am using mri_surfcluster to threshold and extract ROIs from MEG/EEG
source analysis data. The same code used to work fine in Jan 2009, but now
I am running into unexpected errors. I wonder if something happened along
the way of FreeSurfer and/or MNE stream upgrades and now mne_analyze .w
files and mri_surfcluster no longer talk to each other.

I first run the usual MEG/EEG analysis using the MNE stream and then save
the resulting dSPM map on the surface of the subject as a .w file (using
the mne_analyze GUI). For sanity check, I download the overlay in tksurfer
and observe that it looks fine (which makes me think that the problem
originates at the mri_surfcluster side rather than at mne_analyze;
however, see below for evidence suggesting the opposite).

on machine adapt
nmr-std-env (=FreeSurfer 5.1)
mne_setup
cd /cluster/scratch/monday/raij/MEEG
setenv SUBJECTS_DIR /cluster/scratch/monday/raij/MRIs/
setenv SUBJECT Wyss_000

mri_surfcluster \
--subject Wyss_000 \
--hemi lh \
--in AVL_GA_List1-00150.0-lh.w \
--frame 0 \
--thmin 2 \
--thsign abs \
--minarea 100 \
--olab test01 \

thsign = abs, id = 0
version $Id: mri_surfcluster.c,v 1.51.2.1 2011/03/28 15:32:36 greve Exp $
hemi   = lh
srcid  = AVL_GA_List1-00150.0-lh.w
srcsubjid  = Wyss_000
srcsurf= white
srcframe   = 0
thsign = abs
thmin  = 2
thmax  = -1
fdr= -1
minarea= 100
xfmfile= talairach.xfm
nth = -1
subjectsdir= /cluster/scratch/monday/raij/MRIs/
FixMNI = 1
- XFM matrix (RAS2RAS) ---
/cluster/scratch/monday/raij/MRIs//Wyss_000/mri/transforms/talairach.xfm
 0.973  -0.031  -0.031   0.033;
 0.001   0.989   0.327  -34.515;
 0.008  -0.285   1.073  -30.192;
 0.000   0.000   0.000   1.000;

Reading source surface
/cluster/scratch/monday/raij/MRIs//Wyss_000/surf/lh.white
Done reading source surface
Computing metric properties
Loading source values
mri_read(): couldn't determine type of file
/autofs/cluster/scratch/monday/raij/MEEG/AVL_GA_List1-00150.0-lh.w
ERROR: could not read AVL_GA_List1-00150.0-lh.w as type

If I try to convert .w to .mgz I get the error

mri_convert AVL_GA_List1-00150.0-lh.w AVL_GA_List1-00150.0-lh.mgz

file not found or unknown file type for file AVL_GA_List1-00150.0-lh.w

(which makes me think that perhaps the .w file from mne_analyze is
incompatible with much of FreeSurfer 5.1 code)

Any suggestions? As always, thank you for the advice in advance!

Best regards,

Tommi

---
Tommi Raij, MD, PhD
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] mri_surfcluster .w input from MEG/EEG data

2011-10-31 Thread raij
Hi Doug,

I am  still receiving a similar error. mri_surf2surf inputes the w file
and writes out a mgz file and exits apparently ok. However, mri_volcluster
still exits with
"could not read test-lh.mgz as type"

Details:

mri_surf2surf \
--srcsubject Wyss_000 \
--trgsubject Wyss_000 \
--hemi lh \
--srcsurfval AVL_GA_List1-00150.0-lh.w \
--trgsurfval test.lh.mgz \
--sfmt w \
--tfmt mgz \

srcsubject = Wyss_000
srcval = AVL_GA_List1-00150.0-lh.w
srctype= w
trgsubject = Wyss_000
trgval = test.lh.mgz
trgtype= mgz
srcsurfreg = sphere.reg
trgsurfreg = sphere.reg
srchemi= lh
trghemi= lh
frame  = 0
fwhm-in= 0
fwhm-out   = 0
label-src  = (null)
label-trg  = (null)
OKToRevFaceOrder  = 1
Reading source surface reg
/cluster/scratch/monday/raij/MRIs/Wyss_000/surf/lh.sphere.reg
Loading source data
INFO: trgsubject = srcsubject
Saving target data
Saving to test.lh.mgz


mri_surfcluster --subject Wyss_000 --hemi lh --in test-lh.mgz --frame 0
--thmin 2 --thsign abs --minarea 100 --olab test01
thsign = abs, id = 0
version $Id: mri_surfcluster.c,v 1.51.2.1 2011/03/28 15:32:36 greve Exp $
hemi   = lh
srcid  = test-lh.mgz
srcsubjid  = Wyss_000
srcsurf= white
srcframe   = 0
thsign = abs
thmin  = 2
thmax  = -1
fdr= -1
minarea= 100
xfmfile= talairach.xfm
nth = -1
subjectsdir= /cluster/scratch/monday/raij/MRIs
FixMNI = 1
- XFM matrix (RAS2RAS) ---
/cluster/scratch/monday/raij/MRIs/Wyss_000/mri/transforms/talairach.xfm
 0.973  -0.031  -0.031   0.033;
 0.001   0.989   0.327  -34.515;
 0.008  -0.285   1.073  -30.192;
 0.000   0.000   0.000   1.000;

Reading source surface
/cluster/scratch/monday/raij/MRIs/Wyss_000/surf/lh.white
Done reading source surface
Computing metric properties
Loading source values
mghRead(/autofs/cluster/scratch/monday/raij/MEEG/test-lh.mgz, -1): could
not open file
ERROR: could not read test-lh.mgz as type

-Tommi


> Hi Tommi, convert the w file to an mgz with mri_surf2surf. Specify the
> source format with --sfmt w
> doug
>
> r...@nmr.mgh.harvard.edu wrote:
>> Hi Doug and Matti,
>>
>> I am using mri_surfcluster to threshold and extract ROIs from MEG/EEG
>> source analysis data. The same code used to work fine in Jan 2009, but
>> now
>> I am running into unexpected errors. I wonder if something happened
>> along
>> the way of FreeSurfer and/or MNE stream upgrades and now mne_analyze .w
>> files and mri_surfcluster no longer talk to each other.
>>
>> I first run the usual MEG/EEG analysis using the MNE stream and then
>> save
>> the resulting dSPM map on the surface of the subject as a .w file (using
>> the mne_analyze GUI). For sanity check, I download the overlay in
>> tksurfer
>> and observe that it looks fine (which makes me think that the problem
>> originates at the mri_surfcluster side rather than at mne_analyze;
>> however, see below for evidence suggesting the opposite).
>>
>> on machine adapt
>> nmr-std-env (=FreeSurfer 5.1)
>> mne_setup
>> cd /cluster/scratch/monday/raij/MEEG
>> setenv SUBJECTS_DIR /cluster/scratch/monday/raij/MRIs/
>> setenv SUBJECT Wyss_000
>>
>> mri_surfcluster \
>> --subject Wyss_000 \
>> --hemi lh \
>> --in AVL_GA_List1-00150.0-lh.w \
>> --frame 0 \
>> --thmin 2 \
>> --thsign abs \
>> --minarea 100 \
>> --olab test01 \
>>
>> thsign = abs, id = 0
>> version $Id: mri_surfcluster.c,v 1.51.2.1 2011/03/28 15:32:36 greve Exp
>> $
>> hemi   = lh
>> srcid  = AVL_GA_List1-00150.0-lh.w
>> srcsubjid  = Wyss_000
>> srcsurf= white
>> srcframe   = 0
>> thsign = abs
>> thmin  = 2
>> thmax  = -1
>> fdr= -1
>> minarea= 100
>> xfmfile= talairach.xfm
>> nth = -1
>> subjectsdir= /cluster/scratch/monday/raij/MRIs/
>> FixMNI = 1
>> - XFM matrix (RAS2RAS) ---
>> /cluster/scratch/monday/raij/MRIs//Wyss_000/mri/transforms/talairach.xfm
>>  0.973  -0.031  -0.031   0.033;
>>  0.001   0.989   0.327  -34.515;
>>  0.008  -0.285   1.073  -30.192;
>>  0.000   0.000   0.000   1.000;
>> 
>> Reading source surface
>> /cluster/scratch/monday/raij/MRIs//Wyss_000/surf/lh.white
>> Done reading source surface
>> Computing metric properties
>> Loading source values
>> mri_read(): couldn't determine type of file
>> /autofs/cluster/scratch/monday/raij/MEEG/AVL_GA_List1-00150.0-lh.w
>> ERROR: could not read AVL_GA_Lis

Re: [Freesurfer] mri_surfcluster .w input from MEG/EEG data

2011-10-31 Thread raij

Oops - my bad, on this last round I mixed one filename dash with a dot.
Works now - so (just to remind myself) the new feature is to use
mri_surf2surf to convert from w to mgz before running mri_surfcluster.
Thanks Doug! :) -Tommi

> It looks like that file does not exist:
> ls /autofs/cluster/scratch/monday/raij/MEEG/test-lh.mgz
> ls: /autofs/cluster/scratch/monday/raij/MEEG/test-lh.mgz: No such file
> or directory
>
>
> r...@nmr.mgh.harvard.edu wrote:
>> Hi Doug,
>>
>> I am  still receiving a similar error. mri_surf2surf inputes the w file
>> and writes out a mgz file and exits apparently ok. However,
>> mri_volcluster
>> still exits with
>> "could not read test-lh.mgz as type"
>>
>> Details:
>>
>> mri_surf2surf \
>> --srcsubject Wyss_000 \
>> --trgsubject Wyss_000 \
>> --hemi lh \
>> --srcsurfval AVL_GA_List1-00150.0-lh.w \
>> --trgsurfval test.lh.mgz \
>> --sfmt w \
>> --tfmt mgz \
>>
>> srcsubject = Wyss_000
>> srcval = AVL_GA_List1-00150.0-lh.w
>> srctype= w
>> trgsubject = Wyss_000
>> trgval = test.lh.mgz
>> trgtype= mgz
>> srcsurfreg = sphere.reg
>> trgsurfreg = sphere.reg
>> srchemi= lh
>> trghemi= lh
>> frame  = 0
>> fwhm-in= 0
>> fwhm-out   = 0
>> label-src  = (null)
>> label-trg  = (null)
>> OKToRevFaceOrder  = 1
>> Reading source surface reg
>> /cluster/scratch/monday/raij/MRIs/Wyss_000/surf/lh.sphere.reg
>> Loading source data
>> INFO: trgsubject = srcsubject
>> Saving target data
>> Saving to test.lh.mgz
>>
>>
>> mri_surfcluster --subject Wyss_000 --hemi lh --in test-lh.mgz --frame 0
>> --thmin 2 --thsign abs --minarea 100 --olab test01
>> thsign = abs, id = 0
>> version $Id: mri_surfcluster.c,v 1.51.2.1 2011/03/28 15:32:36 greve Exp
>> $
>> hemi   = lh
>> srcid  = test-lh.mgz
>> srcsubjid  = Wyss_000
>> srcsurf= white
>> srcframe   = 0
>> thsign = abs
>> thmin  = 2
>> thmax  = -1
>> fdr= -1
>> minarea= 100
>> xfmfile= talairach.xfm
>> nth = -1
>> subjectsdir= /cluster/scratch/monday/raij/MRIs
>> FixMNI = 1
>> - XFM matrix (RAS2RAS) ---
>> /cluster/scratch/monday/raij/MRIs/Wyss_000/mri/transforms/talairach.xfm
>>  0.973  -0.031  -0.031   0.033;
>>  0.001   0.989   0.327  -34.515;
>>  0.008  -0.285   1.073  -30.192;
>>  0.000   0.000   0.000   1.000;
>> 
>> Reading source surface
>> /cluster/scratch/monday/raij/MRIs/Wyss_000/surf/lh.white
>> Done reading source surface
>> Computing metric properties
>> Loading source values
>> mghRead(/autofs/cluster/scratch/monday/raij/MEEG/test-lh.mgz, -1): could
>> not open file
>> ERROR: could not read test-lh.mgz as type
>>
>> -Tommi
>>
>>
>>
>>> Hi Tommi, convert the w file to an mgz with mri_surf2surf. Specify the
>>> source format with --sfmt w
>>> doug
>>>
>>> r...@nmr.mgh.harvard.edu wrote:
>>>
>>>> Hi Doug and Matti,
>>>>
>>>> I am using mri_surfcluster to threshold and extract ROIs from MEG/EEG
>>>> source analysis data. The same code used to work fine in Jan 2009, but
>>>> now
>>>> I am running into unexpected errors. I wonder if something happened
>>>> along
>>>> the way of FreeSurfer and/or MNE stream upgrades and now mne_analyze
>>>> .w
>>>> files and mri_surfcluster no longer talk to each other.
>>>>
>>>> I first run the usual MEG/EEG analysis using the MNE stream and then
>>>> save
>>>> the resulting dSPM map on the surface of the subject as a .w file
>>>> (using
>>>> the mne_analyze GUI). For sanity check, I download the overlay in
>>>> tksurfer
>>>> and observe that it looks fine (which makes me think that the problem
>>>> originates at the mri_surfcluster side rather than at mne_analyze;
>>>> however, see below for evidence suggesting the opposite).
>>>>
>>>> on machine adapt
>>>> nmr-std-env (=FreeSurfer 5.1)
>>>> mne_setup
>>>> cd /cluster/scratch/monday/raij/MEEG
>>>> setenv SUBJECTS_DIR /cluster/scratch/monday/raij/MRIs/
>>>> setenv SUBJECT Wyss_000
>>>>
>>>> mri_surfcluster \
>>>> --subject Wyss_000 \
>&

[Freesurfer] RA position at the Martinos Center

2009-05-12 Thread raij

We are seeking an RA for a data analysis oriented position. Previous
experience with FreeSurfer FS-FAST and MEG/EEG MNE analysis stream is
highly valued. Ability to use MATLAB for mathematical modeling of fMRI and
MEG/EEG data is required. For details, please see

http://www.nmr.mgh.harvard.edu/martinos/opportunities/employment.php#rs032609


Tommi Raij
r...@nmr.mgh.harvard.edu

---
Tommi Raij, M.D., Ph.D.
TMS Core Director
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] opseq2 efficiency vs VRF

2010-04-22 Thread raij

Hi Doug and other Freesurfers,

We are trying to balance the power of different event-related fMRI runs
(each consisting of a different experimental condition with different
interstimulus intervals) using the optseq2 definition for efficiency. Our
outcome metric is the BOLD % signal change amplitude - we expect different
runs to show different amplitudes. We use a FIR model. Because of the
variable under investigation (interstimulus interval) we must have
different number of stimuli in each run.

We are uncertain as to which optseq2 efficiency measure more accurately
suits this situation. I know you typically prefer "VRF" over "Efficiency".
However, is VRF better suited for reflecting the power of statistical
contrast (for example for t-test and F-values) as opposed to "raw" BOLD %
signal change? In other words, would "Efficiency" more accurately reflect
the balance for just the BOLD % signal change?

The ultimate goal is to make sure that changes in BOLD % signal change
amplitude are not due to the different number of stimuli across runs.

Thanks!

Best regards,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] FS-FAST seq.info with multiple ntrs

2006-05-12 Thread raij
Hi Doug,

I have 3 functional runs that have a different number of TRs (from all
subjects). The design is rapid event-related and the different runs are
matched for statistical power despite that the number of trs is different
for each run.

I would like to contrast the runs with different ntrs as a first level
analysis (within subjects to begin with). However there is only one
seq.info file (that contains the ntrs value). Hence selxavg-sess fails if
I try to analyze the runs at the same time. The Freesurfer wiki says that
runs should have the same ntrs, but this is not possible in this case.

Is there a way around this problem? For example, if selxavg-sess is the
only step that reads the ntrs value, can I just change the contents of the
seq.info file and do the selxavg-sess step for the runs separately? Or do
other analysis steps also need a correct ntrs value?

Also can I tell selxavg-sess to look for a custom filename instead of
seq.info? This might make things more flexible.

Thanks!

-Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

[EMAIL PROTECTED]

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


[Freesurfer] func2sph-sess target brain setting

2006-06-07 Thread raij
Hi,

Backround: I am running a fixed effects group analysis with fsaverage
(mne305) as the target brain, and merging the activations across subjects
on the spherical surface. The individual functional sessions have been
co-registered to the individuals' structural brain reconstruction (i.e.
the register.dat file inside the bold directory links the functional and
structural data within subjects only).

Problem: I am not sure how to set the group analysis func2sph-sess and
paint-sess "target brain" parameters correctly.

Version and environment: I am using the current Martinos Center FreeSurfer
standard installation (vs. >3) under nmr-std-env and all the structural
reconstructions are new as well.

Outline of the analysis (list of commands):

preprocessing
mkanalysis-sess.new
selxavg-sess
mkcontrast-sess
stxgrinder-sess
func2sph-sess  <-
sphsmooth-sess
isxavg-fe-sess
stxgrinder-sess
paint-sess <-

Specific question (with possible answers):

*** 1 *** Should I set the target brain already at func2sph-sess:
func2sph-sess -analysis XXX -sf sessid -df sesspar -trgsubject
fsaverage
(if the -trgsubject setting is omitted, then the target appears be the
default = ico order 7)


*** 2 *** Or is it sufficient (if I ignore the -trgsubject parameter
above) to set:
paint-sess -analysis XXX -contrast YYY -subject fsaverage -space sph
-isxavg fixed -s fegroup -df group.sesspar
(here fegroup = the folder where the fixed effects analysis is stored, set
at isxavg-fe-sess -s fegroup)


*** 3 *** Or must/should I do both 1 and 2 of the above.


I am using surf-sess/tksurfer to view the results and set -subject
fsaverage even there.

I get results that look reasonable either way. I just wonder what is the
difference between the methods, and if either method is unambiguously
correct.

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.


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


[Freesurfer] tksurfer hemodynamic waveforms for group analysis

2006-06-07 Thread raij
Dear Fellow Freesurfers,

I am trying to display HDR waveforms (time courses) for group level FIR
analyses in tksurfer.

When opening the group analysis data with tkmedit and a functional
overlay, obviously some sort of time course data is loaded, because I can
scroll back and forth between the different time points/frames of the
functional overlay (for the specific contrast that I loaded).

However the load timecourse function does not seem to be working.

When attempting to load a hemodynamic waveform, I receive either an error
(func_load_timecourse: error in FunD_New) without opening the HDR window,
or then the time course volume is "interpreted as encoded scalar volume"
and only one time point, of only one contrast, is shown in the HDR window.

I have tried downloading all possible and impossible files related to the
group analysis (.hdr/.bhdr/.bfloat/.dat/.mat/.w) from both within the
specific contrast directory or the one higher level, but they all fail in
either of the two ways above. The wiki, in this case, was not very helpful
in trying to discover which file to load:
https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial_2fVisualization
https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial_2fVisualization


Is this function currently functional? If so, which file should I load?

Details:
group brain = fsaverage
STUDY_DIR = /space/cognito/21/users/raij/avml_fmri_mctogether/
SUBJECTS_DIR = /space/cognito/5/users/raij/subjects_mri/
environment = nmr-std-env on machine ai (FreeSurfer vs >3)
group analysis name = fegroup,
analysis = ISI1TR_BERT_ERFIRsm5pf5tpefsub
example contrast: AV-REST

Thanks for your help!

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.





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


Re: [Freesurfer] func2sph-sess target brain setting

2006-06-07 Thread raij
Thanks Doug, just a quick check that I understood correctly:

>
> There are two issues here:
>
> 1. Make sure that all of your subjects have been reconstructed with
> the same version of freesurfer (it looks like you have done this).

Correct

> 2. If you've used an "older" version of freesurfer for the recon, then
> render (ie, paint) your results on average7 (the default). If
> you've used a "newer" version (which you have), then render them on
> fsaverage.

Does this mean that setting "func2sph-sess -trgsubject fsaverage" makes no
difference in this case (as long as fsaverage is defined in paint-sess)?

-T

> doug
>
>
>
>
> On Wed, 7 Jun 2006 [EMAIL PROTECTED] wrote:
>
>> Hi,
>>
>> Backround: I am running a fixed effects group analysis with fsaverage
>> (mne305) as the target brain, and merging the activations across
>> subjects
>> on the spherical surface. The individual functional sessions have been
>> co-registered to the individuals' structural brain reconstruction (i.e.
>> the register.dat file inside the bold directory links the functional and
>> structural data within subjects only).
>>
>> Problem: I am not sure how to set the group analysis func2sph-sess and
>> paint-sess "target brain" parameters correctly.
>>
>> Version and environment: I am using the current Martinos Center
>> FreeSurfer
>> standard installation (vs. >3) under nmr-std-env and all the structural
>> reconstructions are new as well.
>>
>> Outline of the analysis (list of commands):
>>
>> preprocessing
>> mkanalysis-sess.new
>> selxavg-sess
>> mkcontrast-sess
>> stxgrinder-sess
>> func2sph-sess  <-
>> sphsmooth-sess
>> isxavg-fe-sess
>> stxgrinder-sess
>> paint-sess <-
>>
>> Specific question (with possible answers):
>>
>> *** 1 *** Should I set the target brain already at func2sph-sess:
>> func2sph-sess -analysis XXX -sf sessid -df sesspar -trgsubject
>> fsaverage
>> (if the -trgsubject setting is omitted, then the target appears be the
>> default = ico order 7)
>>
>>
>> *** 2 *** Or is it sufficient (if I ignore the -trgsubject parameter
>> above) to set:
>> paint-sess -analysis XXX -contrast YYY -subject fsaverage -space sph
>> -isxavg fixed -s fegroup -df group.sesspar
>> (here fegroup = the folder where the fixed effects analysis is stored,
>> set
>> at isxavg-fe-sess -s fegroup)
>>
>>
>> *** 3 *** Or must/should I do both 1 and 2 of the above.
>>
>>
>> I am using surf-sess/tksurfer to view the results and set -subject
>> fsaverage even there.
>>
>> I get results that look reasonable either way. I just wonder what is the
>> difference between the methods, and if either method is unambiguously
>> correct.
>>
>> Thanks,
>>
>> Tommi
>>
>> ---
>> Tommi Raij, M.D., Ph.D.
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>> Bldg 149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>>
>>
>> ___
>> 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
> [EMAIL PROTECTED]
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
>

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


[Freesurfer] FS-FAST: mkcontrast-sess -setwdelay

2006-06-21 Thread raij
Hi,

I have a large (~100) number of FIR analyses where I need to set the
weights for each post-stimulus delay (and then collapse them with
-sumdelays). The weights are the same for all analyses.

However the -setwdelay weights can only be entered manually upon prompt.
This means that I would have to sit by the computer for a few days just to
copy-paste a short series of numbers every 25 min. This makes no sense of
course.

Is there a way to make feeding the -setwdelay numbers part of the analysis
script so I could just let it run without human intervention? I would be
very happy if I could just set in the analysis script, for example,

mkcontrast-sess -analysis XXX -setwdelay 0 0 0 0 1 1 1 0 0 0 0 0
-sumdelays -contrast A-REST -a 1 -c 0

Thanks!

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] viewing group analysis results in tkmedit (3D) while using spherical space intersubject morphing

2006-06-21 Thread raij
Hi FreeSurfers,

A small group analysis question of fMRI data (fixed effects). The target
brain is "fsaverage".

I have resampled and averaged the stat maps across subjects in _spherical_
space using func2sph-sess / sphsmooth-sess / isxavg-fe-sess /
stxgrinder-sess. Viewing the results on a "fsaverage" surface with
tksurfer works fine, thanks.

Now I would like to also view the mean functional maps in 3D space
(tkmedit) on the "fsaverage" brain. This does not seem to work - obviously
because the results were calculated in spherical space and were never
resampled back to 3D space.

Is there a way to resample the group average from sperical space to 3D
space so that it could be viewed in tkmedit? Or is the only way to achieve
something like this to recalculate the analyses entirely in Talairach
space without using the spherical space?

To make the results actually comparable between 3D (tkmedit) and
surface-based (tksurfer) viewing, I think I should use the same type of
space for intersubject averaging - preferably spherical in both cases.

Hence, if a tool such as sph2func-sess exists (could not find it in the
wiki), or there is a workaround, any suggestions would be very much
welcome.

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.


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


[Freesurfer] FS-FAST group analysis paint question

2006-09-07 Thread raij
Hi,

I would like to paint group analysis results to the surface of the
fsaverage brain to produce .w files.

With individual subject analyses (that were calculated in individual
space, i.e. not morphed), I have been able to use mri_vol2surf in this
manner:

mri_vol2surf --src V-REST/sig --src_type bfloat -srcreg ../register.dat
--hemi lh --o ./V-REST-lh.w --out_type paint

In the group analysis, the individual subjects' volumes were morphed into
sperical space where the spatial alignment across subjects was done. I
used the average brain "fsaverage" as the target brain. Here the above
mri_vol2surf will not work.

I am unsure how to do the corresponding paint job for the morphed group
analysis data. Would the following command do what needs to be done?

mri_surf2surf --srcsubject fsaverage --trgsubject fsaverage --srcsurfval
V-REST/sig-lh --src_type bfloat --hemi lh --trgsurfval ./V-REST-lh.w
--trg_type paint

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

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


Re: [Freesurfer] FS-FAST group analysis paint question

2006-09-11 Thread raij
... but if I need to create the .w files as output, then using the
mri_surf2surf is the way to go, right?

-Tommi

>
> You actually should not need to do any transformation, just render the
> sig map directly in tksurfer, ie,
>
> tksurfer fsaverage lh inflated -overlay sig-lh.bhdr
>
> fsaverage is the sphere (7th order icosahedron).
>
>
>
> [EMAIL PROTECTED] wrote:
>
>>Hi,
>>
>>I would like to paint group analysis results to the surface of the
>>fsaverage brain to produce .w files.
>>
>>With individual subject analyses (that were calculated in individual
>>space, i.e. not morphed), I have been able to use mri_vol2surf in this
>>manner:
>>
>>mri_vol2surf --src V-REST/sig --src_type bfloat -srcreg ../register.dat
>>--hemi lh --o ./V-REST-lh.w --out_type paint
>>
>>In the group analysis, the individual subjects' volumes were morphed into
>>sperical space where the spatial alignment across subjects was done. I
>>used the average brain "fsaverage" as the target brain. Here the above
>>mri_vol2surf will not work.
>>
>>I am unsure how to do the corresponding paint job for the morphed group
>>analysis data. Would the following command do what needs to be done?
>>
>>mri_surf2surf --srcsubject fsaverage --trgsubject fsaverage --srcsurfval
>>V-REST/sig-lh --src_type bfloat --hemi lh --trgsurfval ./V-REST-lh.w
>>--trg_type paint
>>
>>Thanks,
>>
>>Tommi
>>
>>---
>>Tommi Raij, M.D., Ph.D.
>>MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>>Bldg 149, 13th St
>>Charlestown, MA 02129
>>U.S.A.
>>
>>[EMAIL PROTECTED]
>>___
>>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
> [EMAIL PROTECTED]
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
>
>

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


[Freesurfer] tksurfer time course script help

2006-09-22 Thread raij
Dear Freesurfers,

We are trying to write a tksurfer tcl script that would save FIR analysis
hemodynamic waveform time course windows in postscript format (rgb or tiff
are not sufficient as we need to do a lot of editing on the figures with
Adobe Illustrator to get publishable figures. No, not THAT kind of editing
:)). The script loads a label, loads a hemodynamic waveform, calculates
the mean value across the label, and plots the curves. Most of the stuff
is working already, thanks to Kevin Teich, but a few pieces are missing.
The functions we are looking for exist in the GUI, but we could not find
the corresponding script commands in the wiki or archive. Could you tell
us the tcl script commands for:

1. Save the time course window in //.ps

2. Select only some of the contrasts for display (e.g., we have contrasts
0-7 and only want to display 1, 2, and 3)

3. Setting "subtract pre-stim average" on, i.e. forcing the pre-stimulus
time window mean values to zero on the y-axis ("baseline correction").

I will add the script to the wiki when we have it working. Very convenient
when you have multiple contrasts in multiple experimental conditions and
many ROIs in many subjects - just edit the list of ROIs/labels and time
courses to be loaded, and let the computer do the rest!

Thanks!

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

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


[Freesurfer] Rendering results of custom fMRI analyses on FreeSurfer surface

2006-10-17 Thread raij
Dear FreeSurfers,

We are running a FS-FAST group analysis where the individual subjects are
morphed to an average brain via spherical surface. The output of that
analysis (sig statistical maps, left hemisphere) is saved in
$STUDY_DIR//boldsig-lh_XXX.bfloat,

Question 1:
In the above, XXX is usually the slice number. However we have 25 slices
in the input data, and our  folder contains only bfloat
numbers 000-006. I guess morphing the individual data to a sperical
surface for group analysis changes the original slice structure, and hence
the numbering. I guess we have seven "slices" because in the command
func2sph-sess we defined -icoorder 7 (icosahedron order). Correct?

Question 2:
We use the above sig-lh_XXX.bfloat files as input to a custom matlab
analysis. Remember we have XXX=000-006. What should the output of the
matlab analysis look like so that rendering it onto a FreeSurfer surface
will work? Is there any documentation related to this?

Thanks!

-Tommi

---
Tommi Raij, M.D., Ph.D.
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

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


[Freesurfer] Percent signal change: what stats to read

2006-10-22 Thread raij
Hi,

We have calculated a FIR group analysis with FS-FAST and have the
corresponding ces, cesvar, f, fsig, iminsig, minsig, sig, and t maps in
the contrast folders.

Which one of these should I use for presenting % signal change? We want to
do some further analyses of the group analysis results with matlab and
would need to use % signal change as the input values for those analyses.

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.


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


[Freesurfer] tksurfer BOLD time course display: show multiple overlays?

2006-11-13 Thread raij
Hi Surfers,

To facilitate comparison of ROI BOLD waveforms across different
experiments we are trying to find a way to plot time courses of ***
multiple overlays *** simultaneously in the tksurfer time course window.

Is there a way to do this using the tcl script? Usually the time course
window shows the multiple contrasts for a single overlay, but as soon as I
change the overlay, the old time courses are erased and the time courses
change to the new overlay. I guess what I am saying is that we would like
to avoid erasing the old stuff in the time course window and just keep
adding more waveforms from new overlays (with the possibility of still
selecting which waveforms will be visible).

We are trying to do this within tksurfer.

Any suggestions are much appreciated!

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
USA
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Re: [Freesurfer] tksurfer BOLD time course display: show multiple overlays?

2006-11-13 Thread raij
Ok Doug, I guess I should have talked about time courses instead of
overlays. Let me clarify:

on machine stim (via remote VNC):
nmr-dev-env
cd /space/cuzco/7/user/raij/avml_fmri_mctogether
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT fsaverage

Launch tksurfer:
tksurfer fsaverage lh inflated

Load first set of time courses from the first experiment ("ISI1TR") using
the tcl shell:
func_load_timecourse
fegroup/bold/group_ISI1TR_BERT_ERFIRsm5pf5tpefsub/sphsm10-ffx/h-lh.bhdr 3

Now, as expected, when I click on the brain, I will see 6 waveforms, one
for each contrast ("Condition") for the vertex point I selected. (Actually
I load a ROI from the tcl shell and set the waveform display to show the
mean value within the ROI, but this should not make any difference to the
current question.)

Now for the interesting part. I want to overlay more waveforms from
another experiment ("ISI2TR") usingthe tcl shell for the same vertex point
(or ROI):
func_load_timecourse
fegroup/bold/group_ISI2TR_BERT_ERFIRsm5pf5tpefsub/sphsm10-ffx/h-lh.bhdr 3

However, instead of getting 6 more waveforms to add to a total of 12
waveforms, the earlier 6 waveforms disappear and I get only the new 6
waveforms.

The question is, how do I get to keep all 12 waveforms on the display?

(Eventually I will even want to load a third experiment to get 6 more
waveforms, and finally, switch off all other waveforms except Condition 3
in each of the three experiments, but once the above problem is sorted out
then I think I can manage the rest - we already have working tcl scripts
for the rest of this).

Thanks,

Tommi


> Not sure what you mean. tksurfer/tkmedit do not plot overlays, per se.
> Rather, you pass a timecourse file to it, and is plots the values in the
> time course file.
>
> [EMAIL PROTECTED] wrote:
>
>>Hi Surfers,
>>
>>To facilitate comparison of ROI BOLD waveforms across different
>>experiments we are trying to find a way to plot time courses of ***
>>multiple overlays *** simultaneously in the tksurfer time course window.
>>
>>Is there a way to do this using the tcl script? Usually the time course
>>window shows the multiple contrasts for a single overlay, but as soon as
>> I
>>change the overlay, the old time courses are erased and the time courses
>>change to the new overlay. I guess what I am saying is that we would like
>>to avoid erasing the old stuff in the time course window and just keep
>>adding more waveforms from new overlays (with the possibility of still
>>selecting which waveforms will be visible).
>>
>>We are trying to do this within tksurfer.
>>
>>Any suggestions are much appreciated!
>>
>>Thanks,
>>
>>Tommi
>>
>>---
>>Tommi Raij, M.D., Ph.D.
>>MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>>Bldg 149, 13th St
>>Charlestown, MA 02129
>>USA
>>___
>>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
> [EMAIL PROTECTED]
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
>
>

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


[Freesurfer] func2sph-sess registration question - where should individual subject's register.dat files be?

2006-11-17 Thread raij
Hi,

I did not see this documented anywhere so I figured it would be best to
double check.

Any group analysis relies on that the individual functional and structural
data have first been aligned, and there is therefore a register.dat file
in the individual subject's directory. This is usually saved at
$STUDY_DIR/$SESSION_DIR/bold/register.dat

Now, when I run a group analysis, the functional (or structural) space of
each individual subject is re-mapped onto the structural space of the
target brain. This process must have access to the correct
subject-specific register.dat files for each individual subject.

In the case of a spherical surface group analysis, I would do this
re-mapping by func2sph-sess that I run inside the $STUDY_DIR. The command
would have the format

func2sph-sess -analysis  -sf sessid -df sesspar -trgsubject
fsaverage -projfrac 0.3

where the contents of the "sessid" file would list all my $SESSION_DIRs
(i.e., different subjects).

Question:

Where does func2sph-sess look for the individual level register.dat files?
I assume it will automatically find them at
$STUDY_DIR/$SESSION_DIR/bold/register.dat

Thanks,

Tommi


---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] FS-FAST: FIR analysis baseline corrected BOLD % signal change values?

2006-11-26 Thread raij
Hi,

We are measuring BOLD % signal change levels (from cespct maps) across
separate analyses and the issue of whether the cespct values are
pre-stimulus baseline corrected - or not - obviously would be expected to
effect the results.

We use a FIR group analysis of a rapid event-related design with a
- mkanalysis-sess -prestim = 2 TRs
- mkcontrast-sess -rmprestim

We then use a tcl script to plot the numerical values in a table - here we
use
set gbPreStimOffset 1
func_print_timecourse_selection $lpath/.txt

Visually, when we use tksurfer to view the time course results from the
bold//h-lh.bhdr file, then all contrasts included in the
analysis are showed at the same time (nice) and the two prestimulus values
are included in the display. So far so good. However there is no option to
view the results as BOLD % signal change (cespct). A minor annoyance is
that the time courses are not baseline corrected despite that we used the
-rmprestim option as explained above (they change to be baseline corrected
only after we push the View/Configure/Time Course putton Remove prestim).

The only way we have found to visually view (or plot with the tcl script)
the cespct values is to look at the time course results inside the folders
for specific contrasts (e.g., bold//A-REST/cespct-lh.bhdr).
However here we never see any prestimulus values (otherwise the same full
analysis time window as above is shown), so we do not know if the mean of
the two prestim points has been subtracted from the amplitudes (= baseline
correction).

Below please find the detailed commands for looking at the h-lh.bhdr and
cespct curves.

We would appreciate any advice how to get the pre-stim values visible even
for cespct and/or double check that the cespct values (when plotted using
the tcl script) are baseline corrected.

Thanks!!!

-Tommi

Details:

On machine cuzco
nmr-dev-env (or nmr-std-env, does not seem to make a difference in this case)
cd /space/cuzco/7/users/raij/avml_fmri_mctogether
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT fsaverage

Load the h-lh.bhdr curves (prestim baseline are visible, no cespct option):
tksurfer fsaverage lh inflated -timecourse
fegroup/bold/group_ISI1TR_BERT_ERFIRsm5pf5tpefsub/sphsm10-ffx/h-lh.bhdr

Load the cespct-lh.bhdr curves, no prestim baseline data points visible:
tksurfer fsaverage lh inflated -timecourse
fegroup/bold/group_ISI1TR_BERT_ERFIRsm5pf5tpefsub/sphsm10-ffx/A-REST/cespct-lh.bhdr

---
Tommi Raij, MD., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.


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


[Freesurfer] FS-FAST: problem with extracting BOLD time courses with a tksurfer tcl script

2007-01-05 Thread raij
Hi,

I am trying to extract numerical values for BOLD time courses of (a large
number of) ROIs. For this purpose I use a tksurfer tcl script. Everything
works fine when I only have a small number (~6) of contrasts/stimulus
categories (as defined in the paradigm files), but if I increase the
number of stimulus categories to 14-18, the script dies without producing
anything.

I am able to produce the numerical tables semi-manually with the GUI/tcl
shell even for the large number of stimulus categories so I do not quite
figure what gives. However, doing this manually for all our data would be
impossible. Any suggestions how I could circumvent this problem?

(The visualization part in the script below, that draws the actual time
course display, is not necessary for producing the numerical tables, but
removing that part of the script does not help - it still dies.)

Any suggestions much appreciated! Also if anyone needs the full script I
am happy to send you a copy - however notice that currently one of the
command lines only works in the developmental environment (nmr-dev-env).

Cheers,

Tommi





Specs:

on machine ai
nmr-dev-env
cd /space/cuzco/12/users/raij/avml_fmri_mctogether/
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT fsaverage

#Here is the part of the subroutine that does the extraction (to run the
whole thing from the master script that sets the variable values, launch
run-label-FIR-h.csh in the same directory):

# Set curvature for lh
set curv lh.curv
read_binary_curv
set curvflag 1

# Clear earlier labels
labl_remove_all
# Clear earlier timecourses
func_clear_selection

# Load new label (use actual path to label file instead of $lname if
running the script by itself)
labl_load $lpath/$lname.label

# Load new timecourse. 3 = No registration needed.
# (use actual path to time course file [e.g.,
bold//h-lh.bhdr] instead of $timecourse if running the
script by itself)
func_load_timecourse $timecourse 3

# Set timecourse to show average value across all vertices included in the
label
set gaLinkedVars(func_graph_avg_mode) 2

# Some draw command, dunno what it does really
SendLinkedVarGroup graph

# Select only some of the contrasts for display. Specifically, here turn
off contrasts 4-6
# General format: set gGraphSetting(,visible) <0|1>
# where  is:
Red/Green/Blue/Purple/Brown/Pink/Gray/LightBlue/Yellow/Orange
# "Red" is condition zero (NULL), "Green" is condition one, etc.
set gGraphSetting(Brown,visible) 0
set gGraphSetting(Pink,visible) 0
set gGraphSetting(Gray,visible) 0

# Adjust amplitude (y-axis, % BOLD signal change) scale from -1 to +2
.wwGraph.gwGraph.gwGraph axis config y -min -1 -max 2

# Pre-stimulus baseline correction (to turn OFF, use 0)
set gbPreStimOffset 1

# Draw time course display (this command works only in nmr-DEV-env version!)
Graph_SelectVerticesFromMode

# Save text file listing the numerical time course values for all categories
func_print_timecourse_selection $lpath/$lname-$aname-h.xls

# Save time course display as postscript
Graph_SaveToPS $lpath/$lname-$aname-h.ps

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


Re: [Freesurfer] Color threshold in freesurfer

2007-04-13 Thread raij

What is the corresponding tcl variable called (i.e. the one that selects
between the three options Linear/Linear Opaque/Piecewise)?

Thanks,

Tommi


> Kevin has now implemented this in tkmedit in dev.
>
> doug
>
> Doug Greve wrote:
>
>>
>> Kevin has just made a change to the default way that the DEV version
>> of tksurfer displays colors in overlays. The change has to do with the
>> way the color is displayed near the threshold (fthresh). Previously,
>> as a superthreshold value approached the threshold, its color and
>> opacity would change. The result was that voxels at or just above
>> threshold would be transparent, making them look like they were not
>> active. The default now is to make them opaque regardless of value (as
>> long as they are above threshold).
>>
>> When you look at the overlay configuation GUI, you will now see three
>> items under "Threshold":
>>
>> Linear
>> Linear Opaque
>> Piecewise
>>
>> By default, "Linear Opaque" will be checked. To use the old behavior,
>> check "Linear".
>>
>> Note that you can still control the overall opacity with the slider at
>> the top of the GUI.
>>
>> Kevin is working on changing tkmedit. I'll let you know when that is
>> ready.
>>
>> doug
>>
>>
>>
>>
>>
>>
>
> --
> Douglas N. Greve, Ph.D.
> MGH-NMR Center
> [EMAIL PROTECTED]
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
> ___
> Freesurfer mailing list
> [EMAIL PROTECTED]
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
>

___
Freesurfer mailing list
[EMAIL PROTECTED]
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] tksurfer - list overlay values inside a label

2007-04-18 Thread raij
Hi Doug & Kevin,

I am trying to save a text list from tksurfer that contains all the
overlay values (one value per each vertex point) inside in a functionally
defined label. The labels were originally defined from a different data
set than the overlays where I need the values.

The overlay where I want the values picked from is in the format of a
series of spherical surface files (ico7):

*_time005-tau-lh_000.bfloat
*_time005-tau-lh_001.bfloat
*_time005-tau-lh_002.bfloat
*_time005-tau-lh_003.bfloat
*_time005-tau-lh_004.bfloat
*_time005-tau-lh_005.bfloat
*_time005-tau-lh_006.bfloat

Notice that our overlay does not have the usual h-lh.bhdr files that would
collect all the time frames and contrast conditions (this is after some
custom post-processing) so we have to access the *000.bfloat ->
*006.bfloat files directly. Not sure that matters though.

Any suggestions how to come about this? I tried to look at the tcl
scripting reference but did not quite see what I needed there (or then I
just did not understand what I read :).

Thanks!!!

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


Re: [Freesurfer] tksurfer - list overlay values inside a label

2007-04-18 Thread raij

Ahh - that sounds exactly like what I need!

So a script like this would do the trick (Kevin could you please have a
quick look):

tksurfer fsaverage lh inflated

# tcl script sharts here

# Load curvature
set curv lh.curv
read_binary_curv
set curvflag 1

# Load my overlay (referring to the first file 000 loads all files 000-006?)
sclv_read_from_volume 0 _000.bfloat 3

# Load my label
labl_load .label

# Output the overlay values for the vertices inside the label
write_labeled_vertices .txt

Thanks Kevin!


-Tommi

> If you have an overlay loaded, and you save a label, the label file that
> is created will have the current overlay values in the last column. Does
> this do what you want?
>
>
> On Wed, 2007-04-18 at 17:01 -0400, [EMAIL PROTECTED] wrote:
>> Hi Doug & Kevin,
>>
>> I am trying to save a text list from tksurfer that contains all the
>> overlay values (one value per each vertex point) inside in a
>> functionally
>> defined label. The labels were originally defined from a different data
>> set than the overlays where I need the values.
>>
>> The overlay where I want the values picked from is in the format of a
>> series of spherical surface files (ico7):
>>
>> *_time005-tau-lh_000.bfloat
>> *_time005-tau-lh_001.bfloat
>> *_time005-tau-lh_002.bfloat
>> *_time005-tau-lh_003.bfloat
>> *_time005-tau-lh_004.bfloat
>> *_time005-tau-lh_005.bfloat
>> *_time005-tau-lh_006.bfloat
>>
>> Notice that our overlay does not have the usual h-lh.bhdr files that
>> would
>> collect all the time frames and contrast conditions (this is after some
>> custom post-processing) so we have to access the *000.bfloat ->
>> *006.bfloat files directly. Not sure that matters though.
>>
>> Any suggestions how to come about this? I tried to look at the tcl
>> scripting reference but did not quite see what I needed there (or then I
>> just did not understand what I read :).
>>
>> Thanks!!!
>>
>> -Tommi
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
> --
> Kevin Teich
>
>
>

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


Re: [Freesurfer] tksurfer time course window

2007-05-30 Thread raij
Hi Elaine,

Try this:

# Adjust amplitude (y-axis) scale from -1 to +2
.wwGraph.gwGraph.gwGraph axis config y -min -1 -max 2

Either type it in the command window or use it as part of a tcl script.

Bests,

Tommi

> Hello Freesurfer,
>
> Is there a way to adjust or set the y-axis of the time course window in
> tksurfer?
>
> Thanks in advance,
> Elaine
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] Q: masking statistical overlays

2007-06-19 Thread raij
Dear Fellow Surfers,

Is there a FreeSurfer way to mask a stat map overlay, on the inflated
cortical surface, in a way that the masked vertex points

(a) are transparent in the overlay display (just the underlying dark
gray/light gray curvature is showing)?

(b) do not effect label-specific HDR time courses (i.e., only unmasked
vertex points are taken into account when calculating the HDR curve)?

We can edit the stats map with our custom script to generate the mask
(e.g., mark all masked vertex points as 0 in the overlay), but it seems
that in a stats map every vertex point needs to have an overlay value
(i.e., we cannot just skip the vertex points we want to omit - right?).

Thanks!

-Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.


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


Re: [Freesurfer] Q: masking statistical overlays

2007-06-20 Thread raij
Hi Bruce & Surfers,

OK, we created a .w file and it looks at is should so part (a) below is
solved. However we cannot seem to extract a list of functional overlay
values of vertex points included in a label, which was why we needed to do
this in the first place.

Our goal is to get rid of some bad vertex points points in our functional
overlay by creating a mask that excluded them, then load a label, and use
labl_save to create a list of overlay values contained within the label
(that does not include the vertex points that were masked away).

Bruce, Kevin, Doug, any suggestions?

Bests,

Tommi


> Hi Tommi,
>
> the w-file format is sparse and doesn't have to cover the surface, but
> the .mgz does.
>
> Bruce
>
> On Tue, 19 Jun 2007 [EMAIL PROTECTED] wrote:
>
>> Dear Fellow Surfers,
>>
>> Is there a FreeSurfer way to mask a stat map overlay, on the inflated
>> cortical surface, in a way that the masked vertex points
>>
>> (a) are transparent in the overlay display (just the underlying dark
>> gray/light gray curvature is showing)?
>>
>> (b) do not effect label-specific HDR time courses (i.e., only unmasked
>> vertex points are taken into account when calculating the HDR curve)?
>>
>> We can edit the stats map with our custom script to generate the mask
>> (e.g., mark all masked vertex points as 0 in the overlay), but it seems
>> that in a stats map every vertex point needs to have an overlay value
>> (i.e., we cannot just skip the vertex points we want to omit - right?).
>>
>> Thanks!
>>
>> -Tommi
>>
>> ---
>> Tommi Raij, M.D., Ph.D.
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>> Bldg 149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>>
>>
>> ___
>> 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


Correction: Re: [Freesurfer] Q: masking statistical overlays

2007-06-20 Thread raij

Correction:

We want to use func_print_timecourse_selection (not labl_save) to output
the tables that contain the means across the label (with the bad vertex
points excluded by previously done masking). However I think the time
course functions are not compatible with the .w file format? Right, Doug?

Then, I guess the question is, how do we mask the bad vertex points out of
the time course volumes?

-Tommi
---

Hi Bruce & Surfers,

OK, we created a .w file and it looks at is should so part (a) below is
solved. However we cannot seem to extract a list of functional overlay
values of vertex points included in a label, which was why we needed to do
this in the first place.

Our goal is to get rid of some bad vertex points points in our functional
overlay by creating a mask that excluded them, then load a label, and use
labl_save to create a list of overlay values contained within the label
(that does not include the vertex points that were masked away).

Bruce, Kevin, Doug, any suggestions?

Bests,

Tommi


> Hi Tommi,
>
> the w-file format is sparse and doesn't have to cover the surface, but
the .mgz does.
>
> Bruce
>
> On Tue, 19 Jun 2007 [EMAIL PROTECTED] wrote:
>
>> Dear Fellow Surfers,
>>
>> Is there a FreeSurfer way to mask a stat map overlay, on the inflated
cortical surface, in a way that the masked vertex points
>>
>> (a) are transparent in the overlay display (just the underlying dark
gray/light gray curvature is showing)?
>>
>> (b) do not effect label-specific HDR time courses (i.e., only unmasked
vertex points are taken into account when calculating the HDR curve)?
>>
>> We can edit the stats map with our custom script to generate the mask
(e.g., mark all masked vertex points as 0 in the overlay), but it seems
that in a stats map every vertex point needs to have an overlay value
(i.e., we cannot just skip the vertex points we want to omit - right?).
>>
>> Thanks!
>>
>> -Tommi
>>
>> ---
>> Tommi Raij, M.D., Ph.D.
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging Bldg
149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>>
>>
>> ___
>> 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] FS-FAST: missing time frame & time labeling of FIR analyses

2007-06-25 Thread raij
Hi,

I have done a FIR analysis of event-related data where my time window is
16 TR:s long, consisting of 2 pre-stimulus time frames plus 14
post-stimulus time frames. I view the results with tksurfer.

If I load the results from the h-lh.bhdr file, I have all 16 time frames
(0-15) which is as it should be.

However, if I load one of the contrast stat maps (e.g., cespct-lh.bhdr) I
only have 13 time frames (0-12). I should expect 14 time frames (as the
two pre-stimulus time frames are not supposed to show up). I therefore
have one time frame missing, and I do not know if my time scale is off by
one frame or if the last frame is missing.

So, which time frame is it that the cepct-lh.bhdr is missing - the 3rd or
the 16th?

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] Number of voxels that intersect with inflated brain surface

2007-08-07 Thread raij
Dear FreeSurfers,

Is there a way to estimate the number of fMRI voxels that intersect with
the FreeSurfer anatomical inflated surface space? -"- for a given surface
label?

We need this as N for calculations of statistical significances (to
correct for the oversampling of the orginal 3D voxel space by very densely
spaced vertex points on the surface).

For this purpose, the voxel size was 3.125 x 3.125 x 4.4 mm, the FOV
covered the entire brain, and the anatomical brain is "fsaverage".


Thanks!

-Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] Freesurfer error: Load Time Course causes abort

2007-09-05 Thread raij
Hi guys,

On machine inv (more or less the same error on machine ai)
nmr-dev-env (same error on nmr-std-env)

cd /space/cuzco/2/users/raij/avml_fmri_mctogether/

setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
setenv SUBJECT fsaverage

tksurfer fsaverage lh inflated -overlay
avml07_session_BRISI08/bold/group_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/sphsm10/h-lh.bhdr
-timecourse
avml07_session_BRISI08/bold/group_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/sphsm10/h-lh.bhdr


Output:

surfer: current subjects dir: /space/cognito/5/users/raij/subjects_mri/
surfer: not in "scripts" dir ==> using cwd for session root
surfer: session root data dir ($session) set to:
surfer: /autofs/space/cuzco_002/users/raij/avml_fmri_mctogether
surfer: Reading header info from
/space/cognito/5/users/raij/subjects_mri//fsaverage/mri/T1.mgz
reading group avg surface area 822 cm^2 from file
surfer: vertices=163842, faces=327680
INFO: bvolumeRead: min = 0, max = 0
*** glibc detected *** corrupted double-linked list: 0x060b7db0 ***
Abort

Oddly enough, on machine ai, if I leave out the -timecourse part of the
command line, the FreeSurfer window opens with the correct overlay and I
can scroll through conditions and time points. Further, if I then manually
load the timecourse from File/Load Time Course... menu, this works giving
the time course display just as it should

Even more oddly, on machine inv (which is spanking new and has lots of RAM
etc) even the above basic command line with only loading the overlay gives
the above glibc error.

I have 8 subjects * 66 labels  = timecourses of 528 labels to extract,
which makes this clearly a script job - the only practical solution would
be to find a way to make the command line work.

Suggestions? For example, could it be that this has something to do with
nvidia drivers?

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

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


Re: [Freesurfer] Freesurfer error: Load Time Course causes abort

2007-09-13 Thread raij

Nick,

Thanks for looking into this - we are stalled in our analysis until we
find a way around this!

The answer to your question is no - I have tried the command in cuzco (via
ssh), ai (directly), and inv (directly), and I receive the glibc error on
all of them. If you think it would be a good idea to try it on more linux
boxes, just let me know.

Bests,

Tommi

> Tommi,
>
> Do you have a machine on which this script can run without the glibc
> error?  I have been able to recreate the error you see in a debugger on
> inv, but can't figure out what is going wrong. (Doug, the glibc error
> occurs when fclose is called on line 565 of mriFunctionalDataAccess.c).
> Doug or I will need to look into this further.
>
> Nick
>
> On Wed, 2007-09-05 at 19:02 -0400, [EMAIL PROTECTED] wrote:
>> Hi guys,
>>
>> On machine inv (more or less the same error on machine ai)
>> nmr-dev-env (same error on nmr-std-env)
>>
>> cd /space/cuzco/2/users/raij/avml_fmri_mctogether/
>>
>> setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
>> setenv SUBJECT fsaverage
>>
>> tksurfer fsaverage lh inflated -overlay
>> avml07_session_BRISI08/bold/group_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/sphsm10/h-lh.bhdr
>> -timecourse
>> avml07_session_BRISI08/bold/group_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/sphsm10/h-lh.bhdr
>>
>>
>> Output:
>>
>> surfer: current subjects dir: /space/cognito/5/users/raij/subjects_mri/
>> surfer: not in "scripts" dir ==> using cwd for session root
>> surfer: session root data dir ($session) set to:
>> surfer: /autofs/space/cuzco_002/users/raij/avml_fmri_mctogether
>> surfer: Reading header info from
>> /space/cognito/5/users/raij/subjects_mri//fsaverage/mri/T1.mgz
>> reading group avg surface area 822 cm^2 from file
>> surfer: vertices=163842, faces=327680
>> INFO: bvolumeRead: min = 0, max = 0
>> *** glibc detected *** corrupted double-linked list: 0x060b7db0
>> ***
>> Abort
>>
>> Oddly enough, on machine ai, if I leave out the -timecourse part of the
>> command line, the FreeSurfer window opens with the correct overlay and I
>> can scroll through conditions and time points. Further, if I then
>> manually
>> load the timecourse from File/Load Time Course... menu, this works
>> giving
>> the time course display just as it should
>>
>> Even more oddly, on machine inv (which is spanking new and has lots of
>> RAM
>> etc) even the above basic command line with only loading the overlay
>> gives
>> the above glibc error.
>>
>> I have 8 subjects * 66 labels  = timecourses of 528 labels to extract,
>> which makes this clearly a script job - the only practical solution
>> would
>> be to find a way to make the command line work.
>>
>> Suggestions? For example, could it be that this has something to do with
>> nvidia drivers?
>>
>> Thanks,
>>
>> Tommi
>>
>> ---
>> Tommi Raij, M.D., Ph.D.
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>> Bldg 149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>>
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
>
>
>



---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] selxavg-sess error

2007-10-05 Thread raij


Hi Doug,

selxavg-sess -analysis group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat -sf
sessid7 -df sesspar -noomnibus

exits with the error:

...
  Saving offset to
group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h-offset_000.bfloat
Slice 1, 77.2438 --
??? Error using ==> minus
Matrix dimensions must agree.

Error in ==> fast_selxavg at 439
extreg = extreg - repmat(mean(extreg), [ntrs 1]);

>> ??? Undefined function or variable 'r'.

>> quiting matlab
--
ERROR: fast_selxavg() failed\n
ERROR
(/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/avml10_session_BRISI04):
selxavg failed

I suspect this may have to do that, for each of the seven subjects, there
are three runs with an unequal number of TRs.

Oddly enough, the same analysis worked in March 07. Is there a way to make
this analysis work again? I am only interested in BOLD% signal change (FIR
waveforms) so comparing runs with different numbers of TRs should be
legal. What I would like to do is to calculate a single fixed effects
group analysis where each of the three run types is output as its own
category (the paradigm files are coded to allow that). Only runs that have
the same number of TRs are collapsed across subjects.

(Running three separate analyses, one for each run type, would not help,
as we need the output to be in a single block with multiple categories,
just as in our earlier analysis)

Or maybe the error has to do with something else... my matlab setup.m
should be fine to my knowledge.

machine: cuzco
nmr-dev-env (same error with the standard edition)
cd /space/cuzco/14/users/raij/avml_fmri_mctogether
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT fsaverage

Thanks!!!


-Tommi


---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Re: [Freesurfer] selxavg-sess error

2007-10-07 Thread raij

Improving... now selxavg-sess finishes without error, and even
mkcontrast-sess and stxgrinder-sess seem to work (see below for command
lines). The output seems to be in .nii format though, which is something
of a problem for the rest of our custom analysis stream (our matlab
routines can only read and write the previous .bhdr/.bfloat). However, as
a more fundamental problem, now the analysis crashes at func2sph-sess
(again, the same commands worked in April):

mkcontrast-sess -analysis group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat
-rmprestim -contrast A1-REST -a 1 -c 0 (etc. - more contrasts)

stxgrinder-sess -analysis group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat -all
-sf sessid7 -df sesspar

ERROR:

[cuzco:avml_fmri_mctogether] (nmr-dev-env) func2sph-sess -analysis
group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat -sf sessid7 -df sesspar
-trgsubject fsaverage -projfrac 0.3
--
func2sph-sess logfile is
/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/log/func2sph-sess.log
--
-
-
Session: avml10_session_BRISI04 1/7
Mon Oct 8 02:00:29 EDT 2007
Mon Oct  8 02:00:29 EDT 2007
Filesystem   1K-blocks  Used Available Use% Mounted on
/local_mount/space/cuzco/14
 100115936  63345920  36770016  64%
/autofs/space/cuzco_014
Using Float2Int = round

/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/avml10_session_BRISI04/bold
mri_vol2surf --srcvol group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h
--src_type bfloat --srcreg register.dat --trgsubject fsaverage --mapmethod
nnfr --hemi lh --surf white --surfreg sphere.reg --out
/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/avml10_session_BRISI04/bold/group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/sph/h-lh
--out_type bfloat --float2int round --interp nearest --projfrac 0.3

can't find file group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h_000.hdr
(last resort);bailing out on read
srcvol = group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h
srctype = bfloat
srcreg = register.dat
srcregold = 0
srcwarp unspecified
surf = white
hemi = lh
trgsubject = fsaverage
surfreg = sphere.reg
ProjFrac = 0.3
thickness = thickness
reshape = 0
interp = nearest
float2int = round
GetProjMax = 0
INFO: float2int code = 0
ERROR: could not read group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h as type 9
ERROR
(/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/avml10_session_BRISI04):
vol2surf failed
[cuzco:avml_fmri_mctogether] (nmr-dev-env)


Thanks for your help in adavance, Doug!

-Tommi

> This should be fixed in both dev and stable on the next update
>
> [EMAIL PROTECTED] wrote:
>
>>Hi Doug,
>>
>>selxavg-sess -analysis group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat -sf
>>sessid7 -df sesspar -noomnibus
>>
>>exits with the error:
>>
>>...
>>  Saving offset to
>>group7_ISIXTR_BERT_ERFIRsm5pf5tpefsub_18cat/h-offset_000.bfloat
>>Slice 1, 77.2438 --
>>??? Error using ==> minus
>>Matrix dimensions must agree.
>>
>>Error in ==> fast_selxavg at 439
>>extreg = extreg - repmat(mean(extreg), [ntrs 1]);
>>
>>
>>
>>>>??? Undefined function or variable 'r'.
>>>>
>>>>
>>
>>
>>
>>>>quiting matlab
>>>>
>>>>
>>--
>>ERROR: fast_selxavg() failed\n
>>ERROR
>>(/autofs/space/cuzco_014/users/raij/avml_fmri_mctogether/avml10_session_BRISI04):
>>selxavg failed
>>
>>I suspect this may have to do that, for each of the seven subjects, there
>>are three runs with an unequal number of TRs.
>>
>>Oddly enough, the same analysis worked in March 07. Is there a way to
>> make
>>this analysis work again? I am only interested in BOLD% signal change
>> (FIR
>>waveforms) so comparing runs with different numbers of TRs should be
>>legal. What I would like to do is to calculate a single fixed effects
>>group analysis where each of the three run types is output as its own
>>category (the paradigm files are coded to allow that). Only runs that
>> have
>>the same number of TRs are collapsed across subjects.
>>
>>(Running three separate analyses, one for each run type, would not help,
>>as we need the output to be in a single block with multiple categories,
>>just as in our earlier analysis)
>>
>>Or maybe the error has to do with something else... my matlab setup.m
>>should be fine to my knowledge.
>>

[Freesurfer] fMRI raw data time course

2007-11-09 Thread raij

Hi Doug,

I am troubleshooting an fMRI measurement and would need to see the raw
data time course. I have previously used sliceview-sess for this purpose,
but for some reason I can no longer make it work. Well, sliceview-sess
itself opens fine if I define the analysis and contrast names, but pushing
"r" has no effect (should evoke raw data display), and the command line
raw data request gives a vague error. I already analysed the data in both
bhdr and nii formats, without improvement (a time point exclusion file was
used during analysis). -v1 or -v2 makes no difference. Any suggestions
would be much appreciated!

Bests,

Tommi


on machine cuzco
nmr-std-env (same problem with nmr-dev-env)

cd /space/cuzco/1/users/raij/avml_fmri_mctogether/avml14_session_BRISI12/
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
setenv SUBJECT avml14

[cuzco:avml14_session_BRISI12] (nmr-std-env) sliceview-sess -sf sessid -df
sesspar -raw 011 -motioncor
--
sliceview-sess logfile is
/autofs/space/cuzco_001/users/raij/avml_fmri_mctogether/avml14_session_BRISI12/log/sliceview-sess.log
--
INFO: no slice specified, assuming mosaic
grep:
/autofs/space/cuzco_001/users/raij/avml_fmri_mctogether/avml14_session_BRISI12/session.info:
No such file or directory
avml14_session_BRISI12
--
/autofs/space/cuzco_001/users/raij/avml_fmri_mctogether/avml14_session_BRISI12
yakview -i
/autofs/space/cuzco_001/users/raij/avml_fmri_mctogether/avml14_session_BRISI12/bold/011/fmc
-r
/autofs/space/cuzco_001/users/raij/avml_fmri_mctogether/avml14_session_BRISI12/bold/011/fmc
-sn mos -thmin 2 -thmax 7 -title avml14_session_BRISI12 -v1 -mgh
--
  yakview: \$Id: yakview,v 1.11.2.1 2007/10/05 20:42:55 greve Exp $
ERROR: cannot find
[cuzco:avml14_session_BRISI12] (nmr-std-env)




---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Re: [Freesurfer] EEG source localization?

2010-08-31 Thread raij

Hi Andrea,

There is a FreeSurfer compatible MEG/EEG analysis package that can
constrain the source space to the cortical mantle. Please see
http://www.nmr.mgh.harvard.edu/martinos/userInfo/data/sofMNE.php

Bests,

Tommi


> I have used freesurfer in the past for functional imaging data.  Can
> source
> localization also be completed for EEG data utilizing the available
> anatomic
> MR images?
>
> Thanks,
>
> Andrea
>
> --
> Andrea R. Seisler
> Laboratory Manager
> Human Electrophysiology Facility
> Social, Life, & Engineering Sciences Imaging Center
> 120 Chandlee Laboratory
> The Pennsylvania State University
> University Park, PA USA 16802
> Phone: 814-865-6774
> Email: ar...@psu.edu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



---
Tommi Raij, M.D., Ph.D.
TMS Core Director
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

___
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] Version conflict in FS-FAST or unpacksdcmdir?

2010-09-15 Thread raij

Dear Free Surfers,

I wonder if something went wrong with transitioning FS-FAST and/or
unpacksdcmdir from 4.5 to 5.0. Our functional analysis stream is set to
work in 4.5 and it was working fine. However, since the default version
was changed to 5.0, our analyses have stopped working despite that we
source /space/freesurfer/nmr-stable4-env

We receive multiple errors (see ERROR 1 and ERROR 2 below) that start
already at preprocessing (ERROR 1 below). For example, functional data
from Bay 4 that was unpacked with unpacksdcmdir before the version shift
goes through preprocessing just fine (even today), whereas if I re-unpack
the exact same raw data the preprocessing fails.

Details:

cd /space/avml/3/users/bletham/ADA_fMRI/AD003/
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
setenv SUBJECT AD003_FSvs4.5

nmr-std-env # this takes us to version 5.0 of course so we also give

source /space/freesurfer/nmr-stable4-env

**
 ERROR 1: 
**

preproc-sess -sf subjectname -df sessdir -fwhm 6 -sliceorder siemens
-inorm -force

... some messages ...

>> >> >> >> >> >> >> >> >> >> >> >> >> INFO: northog = 6, pct = 100
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ??? Error using ==>
fmri_svbfile
Too many output arguments.

Error in ==> fast_svbslice at 71
err = fmri_svbfile(yslice,fname);

Error in ==> MRIwrite at 83
  err = fast_svbslice(mri.vol,fstem,[],outbext,bmri);

>> >> --
ERROR: output not created
ERROR: mc-sess failed



**
 ERROR 2: 
**

For data that was unpacked before the version change, now when we try to
run analyses under vs 4.5 we also receive another type of error at
selxavg3-sess that seems to be related to version numbers:

...
Computing CES Magnitude
AV8VT-REST J=13 -
Computing CES Magnitude
Saving h.dat to
/autofs/space/avml_003/users/bletham/ADA_fMRI/AD003/bold/FIRsm6pf2_taumax20/h.dat
??? Reference to non-existent field 'Version'.

Error in ==> fmri_svdat3 at 35
if(hd.Version == 2)

Error in ==> fast_selxavg3 at 1039
  fmri_svdat3(fname,hd);

>> --
ERROR: fast_selxavg3() failed\n



Any suggestions? Anything and everything of course most welcome!

Best regards,

Tommi


---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] changing f.nii nframes

2010-09-21 Thread raij

Dear Free Surfers,

I am analyzing fMRI time series that were reconstructed offline (GRAPPA
data that needed some artifact corrections, long story). Unfortunately,
the offline reconstructed f.nii do not include proper header info. I think
I was able to set the orientations correctly using mri_convert, but now
FSFAST preprocessing (specifically, mc-sess) fails because the headers say
that the number of TRs (number of full volume acquisitions) in the
measurement is 1, whereas in fact the correct value is 316.

I could not find a tool that could change the "nframes" value (mri_convert
can adjust many other things but not this one it seems). Any suggestions?


Bests,

Tommi


---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

___
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] CSF masks

2010-12-08 Thread raij

Hi,

We are trying to create a CSF volume mask from structural MEMPRAGE T1 data
(we also have ME FLASH 5/30 ->PD if needed). We are interested in two CSF
compartments:

- "superficial" CSF outside grey matter and inside inner skull
- "deep" CSF inside ventricles

Is there a way to simply extract these from aseg.mgz or how should we go
about this?

Thanks!

-Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
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] CSF masks

2010-12-08 Thread raij

Thanks Bruce!

However, as you suspected this does not seem to work: mri_extract_label
mri/aseg.mgz 24 mri/mask_code24.mgz gives a tiny volume of a couple of
hundred voxels in the middle of the brain (part of 3rd ventricle). I
assume here that code 24 is the correct code for all CSF in aseg.mgz.

I guess an alternative would be to take the volume of inner skull minus
the volume of everything including and below pial surface. How would one
go about doing that? Or would you suggest other ways?

Bests,

Tommi

> Hi Tommi
>
> you can use mri_extract_label to pull out the labels you want, but the
> sulcal CSF labels may not be great since the manual labeling that is the
> basis of the aseg was done on only T1 images.
>
> cheers
> Bruce
>
> On Wed, 8 Dec 2010
> r...@nmr.mgh.harvard.edu wrote:
>
>>
>> Hi,
>>
>> We are trying to create a CSF volume mask from structural MEMPRAGE T1
>> data
>> (we also have ME FLASH 5/30 ->PD if needed). We are interested in two
>> CSF
>> compartments:
>>
>> - "superficial" CSF outside grey matter and inside inner skull
>> - "deep" CSF inside ventricles
>>
>> Is there a way to simply extract these from aseg.mgz or how should we go
>> about this?
>>
>> Thanks!
>>
>> -Tommi
>>
>> ---
>> Tommi Raij, M.D., Ph.D.
>> MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>> Bldg 149, 13th St
>> Charlestown, MA 02129
>> U.S.A.
>> ___
>> 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] Question: FS-FAST mc-sess -perrun

2006-02-28 Thread raij
Hi Doug,

The issue is motion correction in FS-FAST. The environment is nmr-dev-env.

mc-sess flag -perrun is documented like this:
"MC each run separately (targ=mid)".

1. Does "targ=mid" implicate that the target, within each run, is the
image half way through the run?

2. Does this equal to using the mc-sess -rlf runlistfile flag, and
changing the contents of the runlistfile to match each of the run numbers,
one at a time?

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

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


Re: [Freesurfer] Question: FS-FAST mc-sess -perrun

2006-02-28 Thread raij
mc-sess with -perrun failed with the output:
targstem: Undefined variable.

*** Bug report: ***

on machine ai

source /usr/local/freesurfer/nmr-dev-env
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri

cd
/space/cognito/5/users/raij/avml_fmri_mcseparately/avml19_session_BRISI13_ISI1TR_BERT

which mc-sess
/usr/local/freesurfer/dev/fsfast/bin/mc-sess

mc-sess -sf sessid -df sesspar -perrun

Logfile is
/autofs/space/cognito_005/users/raij/avml_fmri_mcseparately/avml19_session_BRISI13_ISI1TR_BERT/log/mc-avml19_session_BRISI13_ISI1TR_BERT-bold.log
---
/autofs/space/cognito_005/users/raij/avml_fmri_mcseparately/avml19_session_BRISI13_ISI1TR_BERT
RunList: 004 005 006
targstem: Undefined variable.

Notice that I am using the building 120 "cognito" installation where:
/usr/local/feeesurfer = /space/cognito/24/opt/freesurfer/centos4.0

Bests,

Tommi

>
> [EMAIL PROTECTED] wrote:
>
>>Hi Doug,
>>
>>The issue is motion correction in FS-FAST. The environment is
>> nmr-dev-env.
>>
>>mc-sess flag -perrun is documented like this:
>>"MC each run separately (targ=mid)".
>>
>>1. Does "targ=mid" implicate that the target, within each run, is the
>>image half way through the run?
>>
>>
> Yes
>
>>2. Does this equal to using the mc-sess -rlf runlistfile flag, and
>>changing the contents of the runlistfile to match each of the run
>> numbers,
>>one at a time?
>>
>>
> Almost. Method #2 will use the first image instead of the middle image.
>
> doug
>
>>Thanks,
>>
>>Tommi
>>
>>---
>>Tommi Raij, M.D., Ph.D.
>>MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
>>Bldg 149, 13th St
>>Charlestown, MA 02129
>>U.S.A.
>>
>>[EMAIL PROTECTED]
>>___
>>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
> [EMAIL PROTECTED]
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
>
>

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


[Freesurfer] FS-FAST spatialsmooth-sess error

2006-02-28 Thread raij

Hi Doug,

spatialsmooth-sess failed on the second run (out of 6 runs) with the
output: ...
ERROR: failure writing /tmp/ipfsl_19705/fmc.img as volume type 16
/autofs/space/cognito_021/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT/bold
mri_convert 005/fmc.bhdr /tmp/ipfsl_19705/fmc.img --out_type analyze4d
ERROR: mri_convert failed
ERROR: ipfsl failed


Two explanations come to mind:
A. Each number has a different number of TRs. Does the ntrs value in the
seq.info (inside bold dir) have to match the actual number of TRs in each
run? I here tried to smooth all runs in one step... obviously this is not
going to work if the ntrs value has to be correct. Should I process the
runs one at a time with -fsd NNN and adjust the seq.info ntrs value
between?

B. The number of images was big = 666 / 1095 / 1741 per run (2 runs each
size). Did the scratch disk or mri_convert run out of memory?

*** Detailed problem report: ***

on machine ai

source /usr/local/freesurfer/nmr-dev-env
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri

cd
/space/cognito/21/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT

which mc-sess
/usr/local/freesurfer/dev/fsfast/bin/spatialsmooth-sess

spatialsmooth-sess -sf sessid -df sesspar -fwhm 6 -i fmc -o ifmcsm6


/autofs/space/cognito_021/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT
Tue Feb 28 18:50:28 EST 2006
/autofs/space/cognito_021/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT/bold
/space/cognito/21/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT
RunList 004 005 006 009 010 011
--
/autofs/space/cognito_021/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT/bold
...

Notice that I am using the building 120 "cognito" installation where:
/usr/local/feeesurfer = /space/cognito/24/opt/freesurfer/centos4.0

Thanks,

Tommi




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


Re: [Freesurfer] FS-FAST registration across sessions

2006-03-07 Thread raij
Hi Doug,

I tried the technique you suggested for re-sampling functional volumes
from different sessions but from the same subject (and scanner) into the
same space, using mc-sess.

To clarify, here we have a situation where the same brain is scanned in
the same scanner on more than one occasion (in this particular example,
the subjects were taken out of the scanner half way through the lengthy
functional recordings for 20 minutes to rest). Obviously the head position
and rotation are almost always quite different in session 1 than session
2. It would make building contrasts and combining results across sessions
(but within subjects) much more straigthforward if the functional volumes
from the two "sessions" could be re-sampled into the same space.

I put all my runs (2 sessions, 3 runs each = total of 6 runs) from the
same subject and scanner in one bold directory, ran mc-sess, and got
confusing results.

When I check the alignment with tkregister2, the result looks very bad -
the volumes from different sessions are clearly not in the same space (1-3
cm difference).

However if I ignore the fact that the runs do not appear to be aligned,
and run spmregister-sess just once for all runs (hence there is only one
register.dat file) and then check the registration with tkregister-sess,
runs from both sessions seem to be similarly and well aligned with the
hires anatomicals. Obviously the mis-alignment from mc-sess should be
inherited to all following steps, so I must be doing something wrong. I
wonder where the mistake is? Am I misusing the tkregister 2 command (see
below)? Or is this a bug?

*** Here are the specifics: ***

Session 1 = runs 004, 005, 006
Session 2 = runs 009, 010, 011

on machine ai

source /usr/local/freesurfer/nmr-dev-env
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT avml19

cd
/space/cognito/21/users/raij/avml_fmri_mctogether/avml19_session_BRISI13_ISI1TR_BERT

# MOTION CORRECT
mc-sess -sf sessid -df sesspar

# SPATIAL SMOOTHING AND INORM, OUTSTEM = ifmcsm6
spatialsmooth-sess -sf sessid -df sesspar -fwhm 6 -i fmc -o ifmcsm6

# CHECK ALIGNMENT OF RUN 004 VS. 009 WITH TKREGISTER2 - LOOKS BAD
tkregister2 --targ bold/004/fmc.bhdr --mov bold/009/fmc.bhdr --regheader
--reg /tmp/junk.reg

# RUN SPMREGISTER ONCE FOR ALL RUNS TOGETHER DESPITE THAT ALIGMENT APPEARS
BAD
spmregister-sess -sf sessid -df sesspar -funcstem fmc

# CHECK REGISTRATIONS (ONLY ONE bold/register.dat FILE) - LOOKS OK FOR
BOTH, AND VERY SIMILAR FOR RUNS 004 AND 009???
tkregister-sess -sf sessid -df sesspar -funcstem fmc -run 004 &
tkregister-sess -sf sessid -df sesspar -funcstem fmc -run 009 &

---
Also, the defaults for spmregister-sess and tkregister-sess funcstems are
"f". I hope, because my setup does not overwrite the mc-sess output with
the output of spatialsmooth-sess, that I am correct in using the "fmc"
stem instead of "f"? If I have understood corectly, this has the advantage
that I can register motion corrected but not spatially smoothed functional
data, which might(?) at least theoretically give better results than
registering functionals without motion correction... though the advantage
might be too small to be relevant compared to less than perfect
registration accuracy. Any thoughts regarding this? I tried the
registration with the stem "f" as well, and the problems remained the
same, so at least this does not seem to be the cause.

Thanks,

Tommi



> hi doug
>
> i think i have actually already done what you suggest as my bold directory
> consists of all the retinotopy runs (in subdirs 001-010). this is the 'ls'
> of
> the bold directory:
>
> 001/  003/  005/  007/  009/  register.dat  same-sess-reg.dat  seq.info
> 002/  004/  006/  008/  010/  rtopy/scripts/
>
> i ran the motion correction from the study directory as:
>>mc-sess -sf sessid -df sesspar
> and it completed successfully.
>
> -so will that have aligned all the runs together? if so, what can explain
> the
> fact that the field sign map is not continuous when overlaid on the cortex
> and
> shows gaps in the blue/yellow colouring?
>
> thanks!
>
> jane
>
>
> In message <[EMAIL PROTECTED]> Doug Greve
> <[EMAIL PROTECTED]> writes:
>>
>> You can try putting all the runs into a single bold directory. The
>> motion correction will (do it's best to) align them.
>>
>> doug
>>
>>
>>
>>
>>
>>
>> Jane Aspell wrote:
>>
>> >Hi
>> >
>> >My question was asked last year by Tommi Raij (see email pasted below)
>> but I
>> >couldn't find a reply to it in the archives. I am analysing retinotopy
>> data
>> >that was collected over several sessions but I cannot see how to
>> register
>> >scans from multiple session

[Freesurfer] Q: tkregister2 coronal/sagittal/horizontal discrepancy

2006-04-07 Thread raij
Dear Fellow Surfers,

After doing a reconstruction with the 3.0 Freesurfer stable version, I
checked the Talairach auto-registration with tkregister2. The registration
seemed fair enough. However I noticed a strange thing that has not caught
my attention before - maybe this a property of the program and/or was
there already earlier, maybe it is new, maybe it is a bug, or perhaps my
volume is corrupt. The problem/property is observed within the original
(target) volume.

After launching tkregister2, if I click inside the target volume, the red
cursor moves to that location and other orientations
(coronal/sagittal/horizontal) slices also change accordingly (the sliders
move). If I have understood correctly, the idea would be that the cursor
shows the crossing in all 3 orientations.

However if I look at the brain structure in the three different
orientations  where my cursor is, it is clearly different in all three
images. For example, if I pick a mid-sagittal view and place the red
cursor in the thalamus between AC and PC, and then click the "sagittal"
button, the cursor is clearly higher (towards top of the head) in the
interhemispheric fissure.  If I click the "coronal" button, the cursor is
in the frontal lobe between the hemispheres (ie much more anterior than
the other views).

Is this the way the program is supposed to work, or is this a bug, or is
my volume plain corrupted?

*** Here are the specifics: ***

on machine ai

source /usr/local/freesurfer/nmr-std-env
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri
setenv SUBJECT avml07

cd
/space/cognito/5/users/raij/subjects_mri

tkregister2 --mgz --s avml07 --fstal

... and there you go, click away...

Thanks for your advice in advance,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.

[EMAIL PROTECTED]


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


[Freesurfer] Mean & SD over ROI in a FIR analysis (several timepoints)

2005-06-09 Thread Tommi Raij
We are trying to calculate mean and SD over all the spatial (vertex) 
points included in a single functionally defined ROI/label.


Bottom line, the biggest problem is that we do not know which tool to 
use to read all timepoints/frames of the hemodynamic waveforms (of all 
the vertex points included in the label, one at a time) into matlab.


For details, please see below.


Problem 1: We tried to use mri_label_vals but this gives only one value 
per vertex point. However this is a FS-FAST FIR analysis with a time 
window of 16 frames/TRs (of which two are prestimulus) so we should get 
16 values for each vertex point in order to draw a BOLD time course. So 
we need a reader that will produce the functional stat values for all 
the time points, separately for all vertices included in the ROI.


Problem 2: We would need to subtract the mean prestimulus baseline 
values from all 16 time points in order to set a (mean) zero baseline. 
This is necessary to decrease the voxel-to-next-voxel variability that 
is large in fMRI data. This of course has to be done before calculating 
the mean and SD values over the ROI. We did use mkcontrast-sess 
-rmprestim - does this result in that the baseline is already subtracted 
in the values (for each vertex point separately)?


There are typically about 600 single vertex points in a label so saving 
them manually one by one as ASCII and then combining them is not feasible.


As a separate but complicating issue, we have 6 simple contrasts 
(condition N minus REST, with names such as A-REST, V-REST, etc) and 2 
slightly more complicated contrasts (condition 1 plus condition 2 minus 
condition 3). Loading and overlaying the ROI mean +- SD curves for each 
contrast separately increases the work load 6-fold. We have multiple 
subjects in six different conditions, each with multiple ROIs, and 6 
simple contrasts, leading to thousands of BOLD waveforms - any practical 
application should automatically load all 6 contrast HDR waveforms  and 
overlay them in a single window (exactly as sliceview-sess, tkmedit, and 
tksurfer do when you load time course - except that in these programs 
the time courses are displayed for only a single voxel at a time).


Any suggestions how this could be achieved?



Example data/analysis can be found in

/space/cognito/5/users/raij/avml_fmri/avml12_session_BRISI07_ISI1TR_BERT

There are two analyses here - here we are interested in the FIR analysis:
ISI1TR_BERT_ERFIRsm6pf5tpefsub

... and the variables are
setenv SUBJECT avml12
setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/

Any advice would be greatly appreciated!

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129

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


[Freesurfer] Problem with tkmedit Tools/fMRI/Select Contiguous Voxels by Threshold

2005-06-14 Thread Tommi Raij

Hi guys,

I use tkmedit (current MGH beta release) to manually select my ROIs. I 
overlay the functional contrast, move the cursor inside the cluster of 
interest, and then go Tools/fMRI/Select contiguous voxels by threshold 
(after setting the threshold for a proper value of course). Works great, 
the volume turns green, and can be saved as a label.


But only for positive contrast values.

When I point the cursor inside a negative cluster and Select Contiguous 
Voxels by Threshold, nothing will turn green. Saving the label will 
result in a file with contents zero.


Reversing values in "Configure functional overlay" does not help.

Same problem with the alpha release.

However, selecting with "Select contiguous voxels by Func Value" can 
pick also negative clusters. But then it is more difficult to control 
the threshold of course - I would prefer to use the Threshold.


Any suggested ways around this? Or am I just doing something plain wrong?

Thanks,

Tommi

---
Tommi Raij, M.D., Ph.D.
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129

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


[Freesurfer] FS-FAST Registration Question: registration across sessions within subjects

2005-10-20 Thread Tommi Raij


Hi Doug/All,

This is a question about registering several functional scans from the 
same subject in the same space. The functional scans are from different 
sessions, so even if the slice recording parameters are identical, the head
will inavoidably be in different locations and with different rotation. The 
data have already been collected, so we cannot use any on-line 
corrections.


Four different techniques come to mind that could be used to achieve 
this, but I would expect that the accuracy of the methods varies a lot. 
Optimally IMHO one should register the different functional runs with 
respect to each other directly, simply because the EPI images are very 
similar with respect to each other (or at least their T1 contrast is). The 
high-resolution structural image is very different compared to the EPI 
images so functional-to-structural registration is expected to be much 
more inaccurate.


Here are the four different techniques (please tell me if you can think 
of more):


1. One possibility would be to use mc-sess for all runs from the same 
subject (place all the runs from the different sessions in a single 
"bold" directory and just run mc-sess). Possible problem: If I have 
understood correctly, mc-sess only corrects for motion within slices.
Therefore the different head rotations would make this technique very 
inaccurate. Or does there exist an updated version of mc-sess that could

handle even large displacements and rotations?

2. A second possibility would be to use one of the automatic 
functional-to-structural registration programs and register each 
functional run to the same hires structural image. However, based on the 
discussion above, there are expected to be inaccuracies in the functional-to-

structural registration that could be large enough to make comparisons
across the functional sessions meaningless (i.e., the differences would
mainly be driven by inaccuracies in the registration).

3. A third possibility would be to use the same technique as for 
registration across subjects, i.e., resampling the different runs from the
same subject into a spherical space calculated from this specific subject. 
Again this is just as variety of registration from functional to 
structural, and would be expected to provide suboptimal results.


4. A fourth possibility would be to find a method for registering all the 
functional images in a single space with respect to each other, 
e.g. by picking one of the functional sessions as the target space and 
resampling all other functional sessions from this subject into 
this space (without using the hires structurals at all). I guess this 
would be kind of motion correction but capable of handling rotations.

If such a tool exists, it might be more accurate than any of the methods
above, simply because the functional images are more similar compared to
each other than compared to the subject's hires structural image.

Any ideas/suggestions which method would give the most accurate result? 
And what kind of tools currently exist?


Thanks,

Tommi

---
Tommi Raij
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th St
Charlestown, MA 02129
U.S.A.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] mris_pmake version issue

2019-01-08 Thread Raij, Tommi A.
Dear FreeSurfers,


I am trying to update an mris_pmake command line that works with the pub v5.3.0 
version with a new command line that works with pub v6.0.0 version. The purpose 
is to compute the distance between two vertex points on the pial surface using 
the cvs_avg35_inMNI152 brain. We are using CentOS (6.6 on the workstation 
running FS v5.3.0 and 7.4 on the workstation running FS v6.6.0) outside 
Martinos Center.


nmr-std-env

setenv SUBJECTS_DIR /usr/pubsw/packages/freesurfer/subjects

setenv SUBJECT cvs_avg35_inMNI152


Old command line (gives a reasonable result on v5.3.0):


mris_pmake --subject cvs_avg35_inMNI152_temp --hemi  lh --surface0 pial --curv0 
sulc --curv1 sulc --mpmOverlay euclidean --mpmProg pathFind --mpmArgs 
startVertex:121981,endVertex:132633
Start->End vertices [ 121981->132633 ]
Total path cost  [ 29.668283 ]

If I try to run this on v6.0.0, I receive the error:

mris_pmake: unrecognized option '--surface0'


I first tried removing --surface0 option, but then the error becomes


mris_pmake: unrecognized option '--curv0'


I then tried removing the --curv0 and eventually --curv 1 options as well, but 
these gave more similar errors (unrecognized option) or core dumped.


Looking at older posts on the FreeSurfer list, I tried removing all three 
--surface0 --curv0 --curv 1 options, but this gives a clearly incorrect result 
where the startVertex and endVertex values are apparently not read from the 
command line:


Start->End vertices [ 0->0 ]
Total path cost  [ 0.00 ]


I tried renaming --surface0 to --surface and --curv0 to --curv, as it seems 
that some of the options have been renamed, and to some degree this worked as 
there were no more 'unrecognized option' errors. However, the result is still


Start->End vertices [ 0->0 ]
Total path cost  [ 0.00 ]


Any suggestions would be greatly appreciated.


Btw the command line documentation (mris_pmake --help) does not seem to be 
quite match the version distributed with FS v6.0.0, at least when it comes to 
the option names for surface and curve, and if there are separate definitions 
for 0 and 1.


Thank you!


Best regards,


Tommi Raij

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

[Freesurfer] Older tksurfer and tkmedit (FS version 5.0.0) fail to launch: glut issue?

2024-08-07 Thread Raij, Tommi A.
Dear Surfers,

I am trying to launch tksurfer/tkmedit in the stable 5_0_0 environment in the 
Martinos network, but this fails with glut segmentation errors. FS version 6 
tksurfer works on the same machine and data, but I need to create some figures 
that match version 5. We already tried with a different user and a few years 
older linux box, same issues. Any suggestions would be greatly appreciated!
For example, is there a variable that we could set to point to an older OpenGL 
version?
(My LD_LIBRARY_PATH has not been set, and my PATH does not include anything 
pointing to /usr/lib or /usr/lib64)

Details:

on machine rukki (locally at terminal):

setenv USE_STABLE_5_0_0
source /usr/local/freesurfer/nmr-stable50-env
cd $MY_SUBJECTS_DIR

Checking version:
freesurfer
...
You are running this version of FreeSurfer:
  freesurfer-Linux-centos4_x86_64-stable-v5.0.0-20110319

echo $FREESURFER_HOME
/usr/local/freesurfer/stable5_0_0

cp -r $FREESURFER_HOME/subjects/fsaverage $MY_SUBJECTS_DIR/.
chmod -R 777 fsaverage

[rukki:sphsm10-ffx] (nmr-stable5.0-env) tksurfer fsaverage lh inflated

subject is fsaverage
hemiis lh
surface is inflated
surfer: current subjects dir: <$MY_SUBJECTS_DIR>
surfer: not in "scripts" dir ==> using cwd for session root
surfer: session root data dir ($session) set to:
surfer: <$MY_SUBJECTS_DIR>
Reading image info <$MY_SUBJECTS_DIR>/fsaverage)
Reading <$MY_SUBJECTS_DIR>/fsaverage/mri/orig.mgz
surfer: Reading header info from /<$MY_SUBJECTS_DIR>/fsaverage/mri/orig.mgz
[rukki:sphsm10-ffx] (nmr-stable5.0-env)

... after which there is no screen output. The file xdebug_tksurfer was 
generated:

[rukki:sphsm10-ffx] (nmr-stable5.0-env) more .xdebug_tksurfer

Segfault
Initializing glut
xDebug stack (length: 1)
  00:
  00: Initializing glut

Segfault
Initializing glut
[rukki:sphsm10-ffx] (nmr-stable5.0-env)

[rukki:sphsm10-ffx] (nmr-stable5.0-env) echo $DISPLAY
:3

setenv DISPLAY :0 does not fix the issue (results in GLUT: Fatal Error in 
tksurfer.bin: could not open display: 0)

I also tried fsaverage4, fsaverage5, fsaverage6, and bert, copied from the same 
folder into my $SUBJECTS_DIR, same result.

The issue is not specific to tksurfer:

tkmedit -f fsaverage/mri/T1.mgz


===
ERROR: A segfault has occurred. This is not your fault,
  : but is most likely an unrecoverable error and has
  : made the program unstable.
  :
  : Please send the contents of the file .xdebug_tkmedit
  : that should be in this directory to freesurfer@nmr.mgh.harvard.edu
  :
  : Now exiting...
  :
[rukki:sphsm10-ffx] (nmr-stable5.0-env)

more .xdebug_tkmedit
tkmedit started: Wed Aug  7 16:54:21 2024

  tkmedit.bin -f fsaverage/mri/T1.mgz

$Id: tkmedit.c,v 1.341.2.1 2010/08/04 20:47:28 greve Exp $ $Name: stable5_0_0 $
Set user home dir to ($MY_SUBJECTS_DIR)
Set subject home dir to fsaverage/mri/T1.mgz

Segfault
Importing volume with MRIread
xDebug stack (length: 5)
  04: Volm_ImportData( this=0x3447db0, isSource=./fsaverage/mri/T1.mgz )
  04: Importing volume with MRIread
03: LoadVolume( iType=0, isName=fsaverage/mri/T1.mgz, ibConform = 0 )
03: Reading data into volume
  02: ParseCmdLineArgs( argc=3, argv=tkmedit.bin )
  02: Loading volume fsaverage/mri/T1.mgz
01: main()
01: Parsing command line arguments
  00:
  00:
[rukki:sphsm10-ffx] (nmr-stable5.0-env)

My OpenGL version:
[rukki:sphsm10-ffx] (nmr-stable5.0-env) glxinfo | grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 550.54.14
The other machine we tried had OpenGL version 4.6.0 NVIDIA 535.54.03

Thank you!

Best regards,

Tommi


---
Tommi Raij, MD, PhD
Director, TMS Clinical Research
MGH/MIT Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th st
Charlestown, MA 02129
___
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 Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
<https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


[Freesurfer] Pial surfaces include cerebellum - unable to fix with manual edits

2022-11-14 Thread Raij, Tommi A.
Dear Surfers,

I have a case where recon-all labels cerebellum as cerebral white matter 
(aparc+aseg.mgz) and the pial surfaces therefore include the cerebellum. The 
error has been resistant to attempts to fix the situation with manual edits to 
$SUBJECT/mri/brain.finalsurfs.mgz and re-running autorecon3 (with or without 
autorecon2).

Specifically:

Without manual edits, recon-all hangs at the stage:
...
CORRECTING DEFECT 0 (vertices=34440, convex hull=821, v0=4192)
XL defect detected...
...

After exiting with Ctrl-C, brain.finalsurfs.mgz include cerebellum, and the 
pial surfaces include cerebellum. I guess the "defect" FS is trying to correct 
is the cerebellum that was mislabeled.

My manual edits to brain.finalsurfs.mgz consisted of removing cerebellum by 
painting with brush value = 1 (freeview voxel edit tool). Thereafter, I 
recomputed autorecon 3:

recon-all -autorecon3 -s $SUBJECT -no-isrunning

With this, recon-all finishes "without error" but the recomputed aparc+aseg.mgz 
still thinks cerebellum is cerebral white matter and the pial surfaces again 
include cerebellum.

This is with Martinos Center stable version 6.

Any suggestions would be greatly appreciated! Also happy to send a link to the 
original T1 and recon-all results if you would like.

Bests,

Tommi

---
Tommi Raij, MD, PhD
MGH/MIT Athinoula A. Martinos Center for Biomedical Imaging
Bldg 149, 13th st
Charlestown, MA 02129
___
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 Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
<https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail.