Re: [Freesurfer] Freesurfer V6 installation: ubuntu virtual machine

2019-05-31 Thread fsbuild
External Email - Use Caution

Hello Steve,
We have run the freesurfer 6.0.0 release on Ubuntu 16 and 18 which should also 
work in a VM.

You may have to install some packages in order to run freesurfer, especially 
for the freeview program which uses various graphics packages, etc. After 
downloading the freesurfer 6.0.0 binaries from,
https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.0/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz
- I would first try to run the freeview binary as that is a good test to help 
determine what packages may be missing.
I needed to both build and run freesurfer on Ubuntu, so I will list below the 
packages I installed for both purposes. You should not need for example 
the gcc compiler packages just to run the 6.0.0 release binaries, but I have 
not tried to identify a set of packages to only run the binaries.
You will likely also need sudo privileges to install packages.
- R.
  $ sudo apt-get install build-essential  $ 
sudo apt-get install libgl1-mesa-dev freeglut3-dev mesa-common-dev  
$ sudo apt-get install libblas-dev liblapack-dev  $ 
sudo apt-get install ocl-icd-opencl-dev  $ sudo apt-get 
install libxmu-dev libxi-dev  $ sudo apt-get install 
libopencv-dev  Ubuntu 16: $ sudo apt-get install 
gcc-4.9 g++-4.9 gfortran-4.9  Ubuntu 18: $ sudo apt-get 
install gcc-4.8 g++-4.8 gfortran-4.8  $ sudo apt-get install 
xorg xorg-dev libx11-dev  $ sudo apt-get install tcl tcl-dev 
tk tk-dev  $ sudo apt-get install qt5-default qtcreator 
 $ sudo apt-get install libqt5x11extras5-dev  $ 
sudo apt-get install git-annex  $ sudo apt-get install 
python3-dev
 … you will need a libpng, which I got from the archives,
 
http://se.archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
  $curl -O 
http://se.archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64..deb
 - then install the gdebi tool,
  $ sudo apt install gdebi
  - change directories to where you downloaded the libpng12 
package, and use gdebi to install it,
  $ sudo gdebi libpng12-0_1.2.54-1ubuntu1_amd64.deb


On May 31, 2019, at 02:57, Steve Petersen marfne...@gmail.com 
wrote:External Email - Use 
CautionDear Freesurfer 
experts,Just a simple question, is possible to install the Freesurfer 
(Version 6) in a virtual machine of ubuntu?Thanks in advance,Best 
regards,Steve___Freesurfer mailing 
listfreesur...@nmr.mgh.harvard.eduhttps://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

Re: [Freesurfer] Fw: mri_aparc2aseg increases number of parcels? {Disarmed}

2019-05-31 Thread Greve, Douglas N.,Ph.D.
what do you mean?

On 5/31/19 3:00 PM, Winkelbeiner, Stephanie A wrote:
>
> External Email - Use Caution
>
> Hi Freesurfers,
>
> the number of my parcels increases after extending them into the WM with
>
> mri_aparc2aseg \
>     --s s001 \
>     --annot 500.aparc \
>     --wmparc-dmax 2 \
>     --labelwm \
>     --hypo-as-wm \
>     --o mri/aparc.500+2mm.nii.gz
>
> Could that really be the case? And if so, what can I do to keep the 
> original number of parcels?
> (See more detailed description of my approach below)
>
> I would be very grateful for some suggestions!
> Thanks a lot,
> Stephanie Winkelbeiner
>
> ---
> *Stephanie Winkelbeiner, PhD*
>
> Psychiatry Research
>
> Zucker Hillside Hospital
>
> 75-59 263 Street
>
> Glen Oaks, NY 11004
>
> Tel: (718) 470-8267
>
> Email:swinkel...@northwell.edu 
>
>
>
> 
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu 
>  on behalf of Winkelbeiner, 
> Stephanie A 
> *Sent:* Friday, 24 May 2019 6:08 PM
> *To:* Freesurfer support list
> *Subject:* Re: [Freesurfer] [EXTERNAL] Re: Checking number of parcels 
> after transformation of an annotation file into a .nii.gz file
>
> */External Email. Use Caution./*
>
> External Email - Use Caution
>
> Hi Doug,
>
> thanks again for the great tip with MRIread - worked perfectly (after 
> gunzipping the parc300.nii.gz).
>
> So, this means I have the next problem now: instead of 300 parcels 
> this image contains 638 parcels...
>
> How I created parc300.nii.gz:
>
>  1. MATLAB script to create annotation file with 150 parcels/hemisphere
>  2. extending the parcels 2mm into the WM with mri_aparc2aseg (see 1st
> email)
>  3. coregistering to the T1 to get the transformation matrix (bbregister)
>  4. coregistering to DWI space (mri_vol2vol)
>
> I found in an earlier answer of yours that the extention into the WM 
> might duplicate the parcels/labels (*MailScanner has detected a 
> possible fraud attempt from "urldefense.proofpoint.com" claiming to 
> be* 
> https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2018-February/055952.html
>  
> )
> Following your suggestions in that email exchange, I did the following:
> ## 1. Create a mask of the wm labels:
> mri_binarize \
>     --i aparc.500+2mm.nii.gz \
>     --min 2999.5 \
>     --max 4035.5 \
>     --o wm.mask.500.nii.gz
>
> ## 2. Mask the wmparc:
> mri_mask \
>     aparc.500+2mm.nii.gz \
>     wm.mask.500.nii.gz \
>     aparc.500+2mm.masked.nii.gz
>
> This results in only two parcels... What am I doing wrong or 
> overlooking here?
>
> Thanks a lot for your help (as always)!
> Cheers,
> Stephanie
>
>
> 
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu 
>  on behalf of Winkelbeiner, 
> Stephanie A 
> *Sent:* Wednesday, 22 May 2019 6:23 PM
> *To:* Freesurfer support list
> *Subject:* Re: [Freesurfer] [EXTERNAL] Re: Checking number of parcels 
> after transformation of an annotation file into a .nii.gz file
>
> */External Email. Use Caution./*
>
> External Email - Use Caution
>
> That sounds  like a perfect plan!
>
> I gonna try that immediately! Thanks so much, Doug!
> 
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu 
>  on behalf of Greve, Douglas 
> N.,Ph.D. 
> *Sent:* Wednesday, 22 May 2019 6:19 PM
> *To:* freesurfer@nmr.mgh.harvard.edu
> *Subject:* [EXTERNAL] Re: [Freesurfer] Checking number of parcels 
> after transformation of an annotation file into a .nii.gz file
> External Email. Use Caution.
>
> the way that pops to mind is to use matlab
> a = MRIread('aparc.250+2mm.nii.gz');
>
> u = unique(a.vol(:));
> length(u) will give you the number of unique segmentation number
> (including 0)
>
> On 5/22/19 5:54 PM, Winkelbeiner, Stephanie A wrote:
> >
> > External Email - Use Caution
> >
> > Hi Freesurfers,
> >
> > I'm struggling to find out if the number of parcels during a process
> > of transformations from annot -> nii.gz has changed.
> >
> > I extended the parcels from 500.annot 2mm into the WM with
> > mri_aparc2aseg \
> > --s s001 \
> > --annot 500.aparc \
> > --wmparc-dmax 2 \
> > --labelwm \
> > --hypo-as-wm \
> > --o mri/aparc.250+2mm.nii.gz
> > and coregistered the resulting file to the DWI image using bbregister
> > and mri_vol2vol.
> >
> > Using afni's probilistic tractography pipeline, I end up with more
> > parcels than I thought I had.
> >
> > Is there a way to check the number of parcels after extension into the
> > WM (mri_aparc2aseg)?
> >
> > I would 

[Freesurfer] Fw: mri_aparc2aseg increases number of parcels? {Disarmed}

2019-05-31 Thread Winkelbeiner, Stephanie A
External Email - Use Caution

Hi Freesurfers,

the number of my parcels increases after extending them into the WM with

mri_aparc2aseg \
--s s001 \
--annot 500.aparc \
--wmparc-dmax 2 \
--labelwm \
--hypo-as-wm \
--o mri/aparc.500+2mm.nii.gz

Could that really be the case? And if so, what can I do to keep the original 
number of parcels?
(See more detailed description of my approach below)

I would be very grateful for some suggestions!
Thanks a lot,
Stephanie Winkelbeiner

---
Stephanie Winkelbeiner, PhD

Psychiatry Research

Zucker Hillside Hospital

75-59 263 Street

Glen Oaks, NY 11004

Tel: (718) 470-8267

Email: swinkel...@northwell.edu



From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Winkelbeiner, Stephanie A 

Sent: Friday, 24 May 2019 6:08 PM
To: Freesurfer support list
Subject: Re: [Freesurfer] [EXTERNAL] Re: Checking number of parcels after 
transformation of an annotation file into a .nii.gz file


External Email. Use Caution.

External Email - Use Caution

Hi Doug,

thanks again for the great tip with MRIread - worked perfectly (after 
gunzipping the parc300.nii.gz).

So, this means I have the next problem now: instead of 300 parcels this image 
contains 638 parcels...

How I created parc300.nii.gz:

  1.  MATLAB script to create annotation file with 150 parcels/hemisphere
  2.  extending the parcels 2mm into the WM with mri_aparc2aseg (see 1st email)
  3.  coregistering to the T1 to get the transformation matrix (bbregister)
  4.  coregistering to DWI space (mri_vol2vol)

I found in an earlier answer of yours that the extention into the WM might 
duplicate the parcels/labels 
(https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2018-February/055952.html)
Following your suggestions in that email exchange, I did the following:
## 1. Create a mask of the wm labels:
mri_binarize \
--i aparc.500+2mm.nii.gz \
--min 2999.5 \
--max 4035.5 \
--o wm.mask.500.nii.gz

## 2. Mask the wmparc:
mri_mask \
aparc.500+2mm.nii.gz \
wm.mask.500.nii.gz \
aparc.500+2mm.masked.nii.gz

This results in only two parcels... What am I doing wrong or overlooking here?

Thanks a lot for your help (as always)!
Cheers,
Stephanie



From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Winkelbeiner, Stephanie A 

Sent: Wednesday, 22 May 2019 6:23 PM
To: Freesurfer support list
Subject: Re: [Freesurfer] [EXTERNAL] Re: Checking number of parcels after 
transformation of an annotation file into a .nii.gz file


External Email. Use Caution.

External Email - Use Caution

That sounds  like a perfect plan!

I gonna try that immediately! Thanks so much, Doug!

From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Greve, Douglas N.,Ph.D. 

Sent: Wednesday, 22 May 2019 6:19 PM
To: freesurfer@nmr.mgh.harvard.edu
Subject: [EXTERNAL] Re: [Freesurfer] Checking number of parcels after 
transformation of an annotation file into a .nii.gz file

External Email. Use Caution.

the way that pops to mind is to use matlab
a = MRIread('aparc.250+2mm.nii.gz');

u = unique(a.vol(:));
length(u) will give you the number of unique segmentation number
(including 0)

On 5/22/19 5:54 PM, Winkelbeiner, Stephanie A wrote:
>
> External Email - Use Caution
>
> Hi Freesurfers,
>
> I'm struggling to find out if the number of parcels during a process
> of transformations from annot -> nii.gz has changed.
>
> I extended the parcels from 500.annot 2mm into the WM with
> mri_aparc2aseg \
> --s s001 \
> --annot 500.aparc \
> --wmparc-dmax 2 \
> --labelwm \
> --hypo-as-wm \
> --o mri/aparc.250+2mm.nii.gz
> and coregistered the resulting file to the DWI image using bbregister
> and mri_vol2vol.
>
> Using afni's probilistic tractography pipeline, I end up with more
> parcels than I thought I had.
>
> Is there a way to check the number of parcels after extension into the
> WM (mri_aparc2aseg)?
>
> I would be extremely grateful for some insight!
> Thanks,
> Stephanie
>
> The information contained in this electronic e-mail transmission and
> any attachments are intended only for the use of the individual or
> entity to whom or to which it is addressed, and may contain
> information that is privileged, confidential and exempt from
> disclosure under applicable law. If the reader of this communication
> is not the intended recipient, or the employee or agent responsible
> for delivering this communication to the intended recipient, you are
> hereby notified that any dissemination, distribution, 

Re: [Freesurfer] 4 optseq2 questions

2019-05-31 Thread Greve, Douglas N.,Ph.D.


On 5/31/2019 2:18 AM, Katarina Bendtz wrote:

External Email - Use Caution

Dear Douglas:


Thank you so much for your reply. It is however still not clear to me how this 
works. Pls see my replies below.


All the best and many thanks for your time,

Katarina


PS. I'm registered to the list so I don't know why my mail is listed as 
external, sorry.



On 5/29/19 1:05 PM, Katarina Bendtz wrote:
>
> External Email - Use Caution
>
> Dear experts:
>
>
> I'm using the optseq2 version 2.15 2009/05/26. I have three questions:
>
>
>  1. How does the [PSDmin, PSDmax] relate to the jittered
> intertrial intervals?
>
The PSDmax sets the maximum window overwhich jitter needs to be
considered. It is assumed that the hemodyn response will be 0 after
PSDmax and so that jitter will not matter beyond this time.

Why then do I get schedules with intertrial breaks (NULLs) with durations 
longer than PSDmax? Isn't that just a waste of time then?
Yes, it depends on how long the scan is (TR*NumberOfTRs) and how many trials 
you have. If you have too few trials, then you will get "empty" space.

>
>  1. I have stimuli of between 12 and 20 seconds, where the part of my
> stimulus that I want to measure is in the last 5 seconds or so.
> What should I put my dPSD window to? It's both a matter of that
> the signal starts later than the stimulus presentation, so I guess
> I would have a PSDmin of a couple of seconds, but how do I handle
> the variation in stimuli lengths?
>
You need to have the PSD window completely cover the hemodyn response
regardless of what you are interested in.

This is counting from the onset time of the stimuli right? In that case I will 
have to put the PSDmin to the time when my target starts?(My stimuli are 
dialogues: Context (appr. 12 s) + Q (appr. 3 s)  + A (appr. 3 s), and I only 
want to measure the answer, so I should then put PSDmin to 12 s + 3 s = 15 s? 
And then PSDmax to PSDmin  + (HRF response time)?
No, you have to put PSDMin=0. All those other events will produce a hemodyn 
response regardless of whether you want to measure it or not.


>
>  1. As mentioned above I have quite a large variation between my
> stimuli. When I try to specify them individually (about 25) I
> always get that all schedules are ill-conditioned. Is this because
> such schedules are generally hard to optimize?
>
Schedules with lots of different conditions are hard to optimize.
>
>  1. I quite often get that all schedules are ill-conditioned, but
> there is no information in the log file that tells me what is
> wrong. Example:
>
>
> ./optseq2 --ntp 1500 --tr 1.86 --psdwin 0 22.32 0.93 --nkeep 3
> --nsearch 1000 --o test --ev control_trial_1 16.74 1 --ev
> control_trial_3 18.6 1 --ev control_trial_7 18.6 1 --ev test_trial_11
> 16.74 1
>
You only have 1 event for each condition. Surely you must have more?

I have 20 trials, and two conditions, "test" and "control", with 10 trials of 
each condition. In this example I only had 4 trials since I wanted to test if 
the large number of events was yielding my problem. The reason why I specify 
all trials as individual events is that the trials differ greatly in duration 
(between 12 s and 20 s) and *all* have individual durations. I was assuming 
this would be important information for the schedule optimization, but maybe 
you think it is better to use the average duration of each condition (even 
though that will differ from individual event durations with up to 6 s) and 
then I randomimze the order of events myself?
No, you are right, it is important. I'm not sure what is going wrong here 
without the full command line. optseq was not designed with this type of 
application in mind, so it might not be possible.

>
>
> I get:
>
>
> NFO: searched 1000 iterations for 0.010556 hours
> INFO: 26.3158 iterations per second
> INFO: 1000/1000 schedules were ill-conditioned
> ERROR: all schedules found were ill-conditioned. This
> probably means that you need more scan time (ie, a
> greater number of time points) or fewer repetitions.
>
> (I'm running on a macOS Mojave version 10.14.3. )
>
> But it's obviously not the ntp that is the problem since I put an
> extra long time there that cover the event durations by far.
>
> Is there any way I can troubleshoot more efficiently myself? The log
> file doesn't tell me anything.

>
> Very happy for any advice,
>
> All the best,
>
> Katarina
>
>
>
>
> Katarina Bendtz, Ph.D. (particle physics)
> Postdoctoral researcher in cognitive neuroscience
> Department of Psychology, Stockholm University
>
> ___
> 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

[Freesurfer] Freesurfer V6 installation: ubuntu virtual machine

2019-05-31 Thread Steve Petersen
External Email - Use Caution

Dear Freesurfer experts,


Just a simple question, is possible to install the Freesurfer (Version 6)
in a virtual machine of ubuntu?

Thanks in advance,


Best regards,

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

Re: [Freesurfer] 4 optseq2 questions

2019-05-31 Thread Katarina Bendtz
External Email - Use Caution

Dear Douglas:


Thank you so much for your reply. It is however still not clear to me how this 
works. Pls see my replies below.


All the best and many thanks for your time,

Katarina


PS. I'm registered to the list so I don't know why my mail is listed as 
external, sorry.



On 5/29/19 1:05 PM, Katarina Bendtz wrote:
>
> External Email - Use Caution
>
> Dear experts:
>
>
> I'm using the optseq2 version 2.15 2009/05/26. I have three questions:
>
>
>  1. How does the [PSDmin, PSDmax] relate to the jittered
> intertrial intervals?
>
The PSDmax sets the maximum window overwhich jitter needs to be
considered. It is assumed that the hemodyn response will be 0 after
PSDmax and so that jitter will not matter beyond this time.

Why then do I get schedules with intertrial breaks (NULLs) with durations 
longer than PSDmax? Isn't that just a waste of time then?

>
>  1. I have stimuli of between 12 and 20 seconds, where the part of my
> stimulus that I want to measure is in the last 5 seconds or so.
> What should I put my dPSD window to? It's both a matter of that
> the signal starts later than the stimulus presentation, so I guess
> I would have a PSDmin of a couple of seconds, but how do I handle
> the variation in stimuli lengths?
>
You need to have the PSD window completely cover the hemodyn response
regardless of what you are interested in.

This is counting from the onset time of the stimuli right? In that case I will 
have to put the PSDmin to the time when my target starts?(My stimuli are 
dialogues: Context (appr. 12 s) + Q (appr. 3 s)  + A (appr. 3 s), and I only 
want to measure the answer, so I should then put PSDmin to 12 s + 3 s = 15 s? 
And then PSDmax to PSDmin  + (HRF response time)?


>
>  1. As mentioned above I have quite a large variation between my
> stimuli. When I try to specify them individually (about 25) I
> always get that all schedules are ill-conditioned. Is this because
> such schedules are generally hard to optimize?
>
Schedules with lots of different conditions are hard to optimize.
>
>  1. I quite often get that all schedules are ill-conditioned, but
> there is no information in the log file that tells me what is
> wrong. Example:
>
>
> ./optseq2 --ntp 1500 --tr 1.86 --psdwin 0 22.32 0.93 --nkeep 3
> --nsearch 1000 --o test --ev control_trial_1 16.74 1 --ev
> control_trial_3 18.6 1 --ev control_trial_7 18.6 1 --ev test_trial_11
> 16.74 1
>
You only have 1 event for each condition. Surely you must have more?

I have 20 trials, and two conditions, "test" and "control", with 10 trials of 
each condition. In this example I only had 4 trials since I wanted to test if 
the large number of events was yielding my problem. The reason why I specify 
all trials as individual events is that the trials differ greatly in duration 
(between 12 s and 20 s) and *all* have individual durations. I was assuming 
this would be important information for the schedule optimization, but maybe 
you think it is better to use the average duration of each condition (even 
though that will differ from individual event durations with up to 6 s) and 
then I randomimze the order of events myself?

>
>
> I get:
>
>
> NFO: searched 1000 iterations for 0.010556 hours
> INFO: 26.3158 iterations per second
> INFO: 1000/1000 schedules were ill-conditioned
> ERROR: all schedules found were ill-conditioned. This
> probably means that you need more scan time (ie, a
> greater number of time points) or fewer repetitions.
>
> (I'm running on a macOS Mojave version 10.14.3. )
>
> But it's obviously not the ntp that is the problem since I put an
> extra long time there that cover the event durations by far.
>
> Is there any way I can troubleshoot more efficiently myself? The log
> file doesn't tell me anything.

>
> Very happy for any advice,
>
> All the best,
>
> Katarina
>
>
>
>
> Katarina Bendtz, Ph.D. (particle physics)
> Postdoctoral researcher in cognitive neuroscience
> Department of Psychology, Stockholm University
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


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