start matlab
cd c:\tutorial
spm fmri
Batch
SPM/Spatial/Realign/Realign:Estimate & Reslice
  Data: click "new session"
   Session: press "Select Files" button
     Filt: ^fmribl*.*; in the line below select 1:9999
      Select all 302 files
   Reslice Options, Resliced Images: "Mean Image only" - motion transforms stored in file "rp_fmriblocks009.txt" which lists translations and rotations. Therefore, not saving indvidual images is faster, uses less disk space and includes one less interpolation.
   
 
   -Press green Go button
  ModuleList: Click on Realign and delete module. 
   
We could do slice timing correction (especially for event related designs) SPM/Temporal/SliceTiming. However our TR is pretty fast so the slice timing error is small and should be largely explained by the temporal derivative. 
  
  
  SPM/Spatial/Normalise/Normalise Estimate & Write
  Data: Click new subject"
   Subject 
     Source Image, "Select Files" choose the "meanfmriblocks009.nii created during realignment
     Images to write click select files. Filt: ^fmribl*.*; in the line below select 1:9999
      Select all 302 files
   Template Image, Select Files "EPI"
    -Press green Go button
    ModuleList: Click on Normalize" and choose Edit/DeleteModule.

  SPM/Spatial/Normalise/Normalise Estimate & Write
  Select "Images to smooth" Filt: ^wfmribl*.* (note 'w' prefix, as we want the images warped by normalization) in the line below select 1:9999
      Select all 302 files
  Note by default SPM uses a 8mm Full width half maximum
    -Press green Go button
    ModuleList: Click on Smooth and choose Edit/DeleteModule.

  SPM/Stats/fMRImodelSpecification
  Click on directory and press "SelectFiles", chooe ".\" in the right column and press Done.
  Timing Parameters
    Units for design: Seconds
    InterscanInterval: Choose Edit value and enter your repeat time (TR) in seconds: 1.92
  Data & Design
    Press "New Subject/Session"
    In the new Subject/Session node that is created select "Scans" and press "Select Files" Filt: ^swfmribl*.* (note 'sw' prefix, as we want the smoothed warped images) in the line below select 1:9999
      Select all 302 files
    Conditions: Press "New: Condition" twice.
    For the first "Condition" node:
      Name: edit value "LeftMotor"
      Onsets: press Edit value and enter the values 0 1.094 2.203 3.297 4.406 5.5 6.594 7.703 8.797 9.906 11 12.094 52.797 53.906 55 56.094 57.203 58.297 59.406 60.5 61.594 62.703 63.797 64.906 105.594 106.703 107.797 108.906 110 111.094 112.203 113.297 114.406 115.5 116.594 117.703 158.406 159.5 160.594 161.703 162.797 163.906 165 166.094 167.203 168.297 169.406 170.5 211.203 212.297 213.406 214.5 215.594 216.703 217.797 218.906 220 221.094 222.203 223.297 264 265.094 266.203 267.297 268.406 269.5 270.594 271.703 272.797 273.906 275 276.094 316.797 317.906 319 320.094 321.203 322.297 323.406 324.5 325.594 326.703 327.797 328.906 369.594 370.703 371.797 372.906 374 375.094 376.203 377.297 378.406 379.5 380.594 381.703 422.406 423.5 424.594 425.703 426.797 427.906 429 430.094 431.203 432.297 433.406 434.5 475.203 476.297 477.406 478.5 479.594 480.703 481.797 482.906 484 485.094 486.203 487.297 528 529.094 530.203 531.297 532.406 533.5 534.594 535.703 536.797 537.906 539 540.094 580.797
	 Durations: press Edit value and enter 1. We will model each hand movement as a 1 second long impulse
    For the second "Condition" node:
      Name: edit value "RightMotor"
      Onsets: press Edit value and enter the values 26.406 27.5 28.594 29.703 30.797 31.906 33 34.094 35.203 36.297 37.406 38.5 79.203 80.297 81.406 82.5 83.594 84.703 85.797 86.906 88 89.094 90.203 91.297 132 133.094 134.203 135.297 136.406 137.5 138.594 139.703 140.797 141.906 143 144.094 184.797 185.906 187 188.094 189.203 190.297 191.406 192.5 193.594 194.703 195.797 196.906 237.594 238.703 239.797 240.906 242 243.094 244.203 245.297 246.406 247.5 248.594 249.703 290.406 291.5 292.594 293.703 294.797 295.906 297 298.094 299.203 300.297 301.406 302.5 343.203 344.297 345.406 346.5 347.594 348.703 349.797 350.906 352 353.094 354.203 355.297 396 397.094 398.203 399.297 400.406 401.5 402.594 403.703 404.797 405.906 407 408.094 448.797 449.906 451 452.094 453.203 454.297 455.406 456.5 457.594 458.703 459.797 460.906 501.594 502.703 503.797 504.906 506 507.094 508.203 509.297 510.406 511.5 512.594 513.703 554.406 555.5 556.594 557.703 558.797 559.906 561 562.094 563.203 564.297 565.406 566.5"
      Durations: press Edit value and enter 1. We will model each hand movement as a 1 second long impulse
	 
    For event related designs we would choose BasisFunctions/CanonicalHRF/ModelDerivatives and select "Time Derivatives" 



 Left 
 0	1.094	2.203	3.297	4.406	5.5	6.594	7.703	8.797	9.906	11	12.094	52.797	53.906	55	56.094	57.203	58.297	59.406	60.5	61.594	62.703	63.797	64.906	105.594	106.703	107.797	108.906	110	111.094	112.203	113.297	114.406	115.5	116.594	117.703	158.406	159.5	160.594	161.703	162.797	163.906	165	166.094	167.203	168.297	169.406	170.5	211.203	212.297	213.406	214.5	215.594	216.703	217.797	218.906	220	221.094	222.203	223.297	264	265.094	266.203	267.297	268.406	269.5	270.594	271.703	272.797	273.906	275	276.094	316.797	317.906	319	320.094	321.203	322.297	323.406	324.5	325.594	326.703	327.797	328.906	369.594	370.703	371.797	372.906	374	375.094	376.203	377.297	378.406	379.5	380.594	381.703	422.406	423.5	424.594	425.703	426.797	427.906	429	430.094	431.203	432.297	433.406	434.5	475.203	476.297	477.406	478.5	479.594	480.703	481.797	482.906	484	485.094	486.203	487.297	528	529.094	530.203	531.297	532.406	533.5	534.594	535.703	536.797	537.906	539	540.094	580.797

    
 Right vectors   "26.406	27.5	28.594	29.703	30.797	31.906	33	34.094	35.203	36.297	37.406	38.5	79.203	80.297	81.406	82.5	83.594	84.703	85.797	86.906	88	89.094	90.203	91.297	132	133.094	134.203	135.297	136.406	137.5	138.594	139.703	140.797	141.906	143	144.094	184.797	185.906	187	188.094	189.203	190.297	191.406	192.5	193.594	194.703	195.797	196.906	237.594	238.703	239.797	240.906	242	243.094	244.203	245.297	246.406	247.5	248.594	249.703	290.406	291.5	292.594	293.703	294.797	295.906	297	298.094	299.203	300.297	301.406	302.5	343.203	344.297	345.406	346.5	347.594	348.703	349.797	350.906	352	353.094	354.203	355.297	396	397.094	398.203	399.297	400.406	401.5	402.594	403.703	404.797	405.906	407	408.094	448.797	449.906	451	452.094	453.203	454.297	455.406	456.5	457.594	458.703	459.797	460.906	501.594	502.703	503.797	504.906	506	507.094	508.203	509.297	510.406	511.5	512.594	513.703	554.406	555.5	556.594	557.703	558.797	559.906	561	562.094	563.203	564.297	565.406	566.5"
