awesome! This is exactly what I want to do.

Many thanks.

Yang

On Wed, Aug 10, 2011 at 2:16 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu> wrote:
You can't do that with FSFAST. You can do something like that with mri_glmfit, something like:

mri_glmfit --y fmc.nii --qa --glmdir qa.glm --save-yhat

This will detrend the time series (removing mean, linear, and quadratic trends). With --save-yhat, one of the outputs will be yhat.mgh (the detrended time series). If  you have a task, the task will still be in there.

doug


Yang Liu wrote:
I want the time course for each voxel in my ROI.  But the time course should be corrected by removing the drift, which I think that is what the -polyfit option does.
I know I probably can do it myself, but I am wondering if Freesurfer has this already.

Yang
On Wed, Aug 10, 2011 at 1:55 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>> wrote:

   It is more accurate to say that it has the regression coefficients
   for the HRF. If you use a gamma or spm hrf, then it just has the
   amplitude (your case). If you use an FIR, then it has the
   coefficients for each delay in the FIR, which can be assembled
   into a waveform. I'm not sure what you are looking for if you want
   something that is equal to the number of time points. What do you
   want to do with it?
   doug

   Yang Liu wrote:

       Hi Doug,

       As the freesurferwiki says, the h.nii contains the estimated
       hemodynamic response at each voxel, along with the standard
       deviation of the residual error,
       and h-offset.nii  contains a map of the mean value at each voxel.
       My expectation is that h.nii should have the same dimension as
       my fmc.nii (the raw time course).
        For example, my fmc.nii is 90*90*60*256, where 256 is the
       TRs.  But the h.nii is only a 3D array 90*90*60. Why doesn't
       the h.nii have all the TRs?
       I also have h0.nii and h0-offset.nii, what are these volume?

       Thanks,

       Yang


       On Tue, Aug 9, 2011 at 1:16 PM, Douglas N Greve
       <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
       <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>> wrote:

          You're using a fairly old version of freesurfer. If you have to
          use this, then use mkanalysis-sess (without the .new).
          doug

          Yang Liu wrote:

              After I run recon-all -version, it shows: "v 1.133.2.57
              2009/08/06'.
              Since we have a lot of scripts for the older version,
       we kept
              using the old one.
              If we don't use mkanalysis-sess.new, what we shall use?

              Yang



              On Tue, Aug 9, 2011 at 12:51 PM, Douglas N Greve
              <greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
       <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>> wrote:

                 Yes, but don't use mkanalysis-sess.new. Are you not
       using
              version 5.X?
                 doug

                 Yang Liu wrote:

                     Hi Doug,

                     Thank you for prompt reply.
                     So I should remove '-gammafit', and add '-fir 4
       24' is for
                     mkanalysis-sess.new?



                     Yang

                     On Tue, Aug 9, 2011 at 11:42 AM, Douglas N Greve
                     <greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>
                     <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
                     <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>>> wrote:

                        If you want a time course, you should use an
       FIR model,
                     something
                        like "-fir 4 24" to start the time window 4 sec
              before the
                        stimulus onset and stop it 20 sec after stimulus
              onset. Do not
                        include -gammafit.

                        doug

                        Yang Liu wrote:

                            Hi all,

                            I want to plot the hemodynamic response of a
              voxel after my
                            analysis finishes. I hope I can get the
       hemodynamic
                     response
                            of each voxel for each session, so I can
       see the
                     statistics by
                            myself.

                            My analysis.cfg is below:

                            -gammafit 0 8
                            -gammaexp 0.3
                            -timewindow 40.0000
                            -prestim 0
                            -polyfit 2
                            -TER 2.0000
                            -autowhiten 40
                            -nskip 0
                            -fwhm 0
                            -extreg mcextreg
                            -nextreg 3
                            -rescale 1000


                            After I ran selxavg-sess, I got the following
              volumes:
                     h0.nii,
                            h0-offset.nii, h.nii, h-offset.nii, rstd.nii,
              rvar.nii.
                            How can I get a response from these volumes?

                            Yang


                                                 ------------------------------------------------------------------------

                                   _______________________________________________
                            Freesurfer mailing list
                            Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>
              <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>>
                     <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>
              <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>>>
                            <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>
              <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>>
                     <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>
              <mailto:Freesurfer@nmr.mgh.harvard.edu
       <mailto:Freesurfer@nmr.mgh.harvard.edu>>>>

                                                 https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


                        --     Douglas N. Greve, Ph.D.
                        MGH-NMR Center
                        greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
                     <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>
                     <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
                     <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>>
                        Phone Number: 617-724-2358 <tel:617-724-2358>
       <tel:617-724-2358 <tel:617-724-2358>>
              <tel:617-724-2358 <tel:617-724-2358> <tel:617-724-2358
       <tel:617-724-2358>>>
                     <tel:617-724-2358 <tel:617-724-2358>
       <tel:617-724-2358 <tel:617-724-2358>> <tel:617-724-2358
       <tel:617-724-2358>
              <tel:617-724-2358 <tel:617-724-2358>>>> Fax:

       617-726-7422 <tel:617-726-7422> <tel:617-726-7422
       <tel:617-726-7422>>
                     <tel:617-726-7422 <tel:617-726-7422>
       <tel:617-726-7422 <tel:617-726-7422>>>
                        <tel:617-726-7422 <tel:617-726-7422>
       <tel:617-726-7422 <tel:617-726-7422>>
              <tel:617-726-7422 <tel:617-726-7422> <tel:617-726-7422
       <tel:617-726-7422>>>>



                        Bugs:
       surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
       <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
              <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                            <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                               <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>

                        FileDrop:
                            www.nmr.mgh.harvard.edu/facility/filedrop/index.html
       <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                     <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                                   <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                                      <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>




                        The information in this e-mail is intended
       only for the
                     person to
                        whom it is
                        addressed. If you believe this e-mail was
       sent to you in
                     error and
                        the e-mail
                        contains patient information, please contact the
              Partners
                        Compliance HelpLine at
                        http://www.partners.org/complianceline . If the
              e-mail was
                     sent to
                        you in error
                        but does not contain patient information, please
              contact the
                        sender and properly
                        dispose of the e-mail.



                 --     Douglas N. Greve, Ph.D.
                 MGH-NMR Center
                 greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
              <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>>
                 Phone Number: 617-724-2358 <tel:617-724-2358>
       <tel:617-724-2358 <tel:617-724-2358>>
              <tel:617-724-2358 <tel:617-724-2358> <tel:617-724-2358
       <tel:617-724-2358>>> Fax: 617-726-7422 <tel:617-726-7422>
              <tel:617-726-7422 <tel:617-726-7422>>
                 <tel:617-726-7422 <tel:617-726-7422>
       <tel:617-726-7422 <tel:617-726-7422>>>

                 Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
       <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
              <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                 <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
                 FileDrop:
              www.nmr.mgh.harvard.edu/facility/filedrop/index.html
       <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                     <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
                        <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>



          --     Douglas N. Greve, Ph.D.
          MGH-NMR Center
          greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>
       <mailto:greve@nmr.mgh.harvard.edu
       <mailto:greve@nmr.mgh.harvard.edu>>
          Phone Number: 617-724-2358 <tel:617-724-2358>
       <tel:617-724-2358 <tel:617-724-2358>> Fax: 617-726-7422
       <tel:617-726-7422>
          <tel:617-726-7422 <tel:617-726-7422>>

          Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
       <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
          <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
          FileDrop:
       www.nmr.mgh.harvard.edu/facility/filedrop/index.html
       <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
          <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>



   --     Douglas N. Greve, Ph.D.
   MGH-NMR Center
   greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
   Phone Number: 617-724-2358 <tel:617-724-2358> Fax: 617-726-7422
   <tel:617-726-7422>

   Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
   <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
   FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html
   <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>