Diff for "ScannerSynch" - CBU MRI facility Wiki
location: Diff for "ScannerSynch"
Differences between revisions 5 and 28 (spanning 23 versions)
Revision 5 as of 2015-09-14 16:46:07
Size: 395
Editor: TiborAuer
Comment:
Revision 28 as of 2016-02-23 14:46:45
Size: 2174
Editor: TiborAuer
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:

For more information, type in MATLAB
{{{#!highlight matlab numbers=off
help ScannerSynchClass
}}}

{{{#!wiki caution
N.B.: National Instruments PCI 6503 card does not monitor pulses in the background, so you have to make sure that you wait for any pulse before it comes!
}}}
Line 8: Line 17:
== Paths to ScannerSynch == == Obtain ScannerSynch ==
Line 10: Line 20:
 * From your desktop PC (Windows), you can also have a copy from `\\cbsu\data\Group\Imaging-Local\cbu\matlab`
 * You can also download it from [[attachment:ScannerSynchClass.m|here]] (right-click and "Save As...")

== Using ScannerSynch ==
=== Initialise ===
 * Default. Use only if device (scanner, pulse emulator) is connected (only in StimPCs and mimic PC)!
 . {{{#!highlight matlab numbers=off
SSO = ScannerSynchClass;
}}}
 * Emulations:
 . {{{#!highlight matlab numbers=off
SSO = ScannerSynchClass(1); % emulate scanner synch pulse
}}}
 . {{{#!highlight matlab numbers=off
SSO = ScannerSynchClass(0,1); % emulate button box
}}}
 . {{{#!highlight matlab numbers=off
SSO = ScannerSynchClass(1,1); % emulate scanner synch pulse and button box
}}}

=== Close ===
!ScannerSynchClass has a destructor, which is automatically triggered if the object is deleted (e.g. clear, returning function). If you use a script, however, it does not perform any auto-clear, so you have to destroy the object manually:
 . {{{#!highlight matlab numbers=off
SSO.delete;
}}}

=== Capture scanner synch pulse ===
 * Simple case
 . {{{#!highlight matlab numbers=off
SSO.SetSynchReadoutTime(0.5);
SSO.TR = 2; % allows detecting missing pulses
while SSO.SynchCount < 10 % polls 10 pulses
    SSO.WaitForSynch;
    fprintf('Pulse %d: %2.3f. Measured TR = %2.3fs\n',...
        SSO.SynchCount,...
        SSO.TimeOfLastPulse,...
        SSO.MeasuredTR);
end
}}}

ScannerSynch

ScannerSynch provides an interface for National Instruments PCI 6503 card used to capture all pulses (scanner synch pulse and button pulses alike).

For more information, type in MATLAB

help ScannerSynchClass

N.B.: National Instruments PCI 6503 card does not monitor pulses in the background, so you have to make sure that you wait for any pulse before it comes!

Any problems, report them to Tibor Auer.

Obtain ScannerSynch

  • ScannerSynch is available on all relevant PCs (StimPCs, "mimic" PC)

  • From your desktop PC (Windows), you can also have a copy from \\cbsu\data\Group\Imaging-Local\cbu\matlab

  • You can also download it from here (right-click and "Save As...")

Using ScannerSynch

Initialise

  • Default. Use only if device (scanner, pulse emulator) is connected (only in StimPCs and mimic PC)!
  • SSO = ScannerSynchClass;
    
  • Emulations:
  • SSO = ScannerSynchClass(1);   % emulate scanner synch pulse
    
  • SSO = ScannerSynchClass(0,1); % emulate button box
    
  • SSO = ScannerSynchClass(1,1); % emulate scanner synch pulse and button box
    

Close

ScannerSynchClass has a destructor, which is automatically triggered if the object is deleted (e.g. clear, returning function). If you use a script, however, it does not perform any auto-clear, so you have to destroy the object manually:

  • SSO.delete;
    

Capture scanner synch pulse

  • Simple case
  • SSO.SetSynchReadoutTime(0.5);
    SSO.TR = 2;                % allows detecting missing pulses
    while SSO.SynchCount < 10  % polls 10 pulses
        SSO.WaitForSynch;
        fprintf('Pulse %d: %2.3f. Measured TR = %2.3fs\n',...
            SSO.SynchCount,...
            SSO.TimeOfLastPulse,...
            SSO.MeasuredTR);
    end
    

None: ScannerSynch (last edited 2017-08-08 15:53:15 by JohanCarlin)