public Replay(Queue <string> originalTrackData, Queue <string> originalInfoData, OriginalType originalType, int originalLength, int frameRate, int pxPERmm, string folder, string name, string fishID) : base(folder, name, fishID, originalLength, frameRate, pxPERmm) { if (FileSaver != null) { _trackWriter = FileSaver.GetStreamWriter(".track"); _imageWriter = FileSaver.GetTiffWriter("_camImage.tif", true); _backgroundWriter = FileSaver.GetTiffWriter("_bgImage.tif", true); //Create 10x10 mm region image _camRegion = new Image8(Properties.Settings.Default.PixelsPermm * 10, Properties.Settings.Default.PixelsPermm * 10); } _laser = new SDLPS500Controller(Properties.Settings.Default.DAQ, Properties.Settings.Default.LaserAO); string xchannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerX; string ychannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerY; //Load scan lookup table from file try { TextReader reader = File.OpenText("main.calib"); var scanTable = BLIScanLookupTable.LoadFromFile(reader); _scanner = new RandomAccessScanner(scanTable, xchannel, ychannel, -10, 10); reader.Dispose(); } catch (IOException) { System.Diagnostics.Debug.WriteLine("Could not find calibration data. No targeting available"); } //This is a closed-loop experiment - try to stay fully up-to-date SuggestedBufferSeconds = 0; _originalType = originalType; _originalTrackData = originalTrackData; _originalInfoData = originalInfoData; _experimentPhase = ExperimentPhase.Replay; }
public TargetingTest(int expSeconds, int frameRate, int pxPERmm, string folder, string name, string fishID) : base(folder, name, fishID, expSeconds, frameRate, pxPERmm) { _totalFrames = ExperimentLength * FrameRate; if (FileSaver != null) { _trackWriter = FileSaver.GetStreamWriter(".track"); _imageWriter = FileSaver.GetTiffWriter("_camImage.tif", true); } _laser = new SDLPS500Controller(Properties.Settings.Default.DAQ, Properties.Settings.Default.LaserAO); string xchannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerX; string ychannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerY; //Load scan lookup table from file try { TextReader reader = File.OpenText("main.calib"); var scanTable = BLIScanLookupTable.LoadFromFile(reader); _scanner = new RandomAccessScanner(scanTable, xchannel, ychannel, -10, 10); reader.Dispose(); } catch (IOException) { System.Diagnostics.Debug.WriteLine("Could not find calibration data. No targeting available"); } //This is an closed-loop experiment - try to stay fully up-to-date SuggestedBufferSeconds = 0; }
public CircularGradient(int habitSeconds, int preSeconds, int gradientSeconds, int nTrials, int frameRate, int pxPERmm, string folder, string name, string fishID) : base(folder, name, fishID, habitSeconds + (preSeconds + gradientSeconds) * nTrials, frameRate, pxPERmm) { if (FileSaver != null) { _trackWriter = FileSaver.GetStreamWriter(".track"); _imageWriter = FileSaver.GetTiffWriter("_camImage.tif", true); _backgroundWriter = FileSaver.GetTiffWriter("_bgImage.tif", true); //Create 10x10 mm region image _camRegion = new Image8(Properties.Settings.Default.PixelsPermm * 10, Properties.Settings.Default.PixelsPermm * 10); } _laser = new SDLPS500Controller(Properties.Settings.Default.DAQ, Properties.Settings.Default.LaserAO); string xchannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerX; string ychannel = Properties.Settings.Default.DAQ + "/" + Properties.Settings.Default.ScannerY; //Load scan lookup table from file try { TextReader reader = File.OpenText("main.calib"); var scanTable = BLIScanLookupTable.LoadFromFile(reader); _scanner = new RandomAccessScanner(scanTable, xchannel, ychannel, -10, 10); reader.Dispose(); } catch (IOException) { System.Diagnostics.Debug.WriteLine("Could not find calibration data. No targeting available"); } _preFrames = preSeconds * FrameRate; _gradFrames = gradientSeconds * FrameRate; _habitFrames = habitSeconds * FrameRate; _nTrials = nTrials; _currentPhaseFrame = 0; _currentTrial = 0;//Start at 0 during habituation will be pre-incremented as we enter pre-phase and will be checked for completing at end of gradient phase //This is a closed-loop experiment - try to stay fully up-to-date SuggestedBufferSeconds = 0; //Start in habituation phase _experimentPhase = ExperimentPhase.Habituation; }