コード例 #1
0
ファイル: Tags.cs プロジェクト: swharden/ABFsharp
        public Tags(ABFFIO.TagStruct[] tagStructs, ABFFIO.AbfFileHeader header)
        {
            float sampleRate   = 1e6f / header.fADCSequenceInterval / header.nADCNumChannels;
            float samplePeriod = 1.0f / sampleRate;
            float tagTimeMult  = (header.fSynchTimeUnit == 0)
                ? samplePeriod / header.nADCNumChannels
                : header.fSynchTimeUnit / 1e6f;

            IndividualTags = tagStructs.Select(x => new Tag(x, tagTimeMult)).ToArray();
        }
コード例 #2
0
 /// <summary>
 /// Load an ABF using the official library (ABFFIO.DLL)
 /// </summary>
 /// <param name="filePath">Path to the ABF</param>
 /// <param name="preloadSweepData">If True, sweep data will be loaded into memory up-front for faster (filesystem-free) access later</param>
 public ABF(string filePath, bool preloadSweepData = true)
 {
     FilePath             = System.IO.Path.GetFullPath(filePath);
     using Wrapper abffio = new(filePath);
     Header    = abffio.GetHeader();
     Tags      = new Tags(abffio.ReadTags(), Header);
     SweepData = new float[SweepCount * ChannelCount][];
     if (preloadSweepData)
     {
         LoadAllSweeps(abffio);
     }
 }
コード例 #3
0
 private static extern bool ABF_ReadChannel(Int32 nFile, ref AbfFileHeader pFH, Int32 nChannel, Int32 dwEpisode, ref float pfBuffer, ref UInt32 puNumSamples, ref Int32 pnError);
コード例 #4
0
 private static extern bool ABF_ReadTags(Int32 nFile, ref AbfFileHeader pFH, UInt32 dwFirstTag, ref TagStruct pTagArray, UInt32 uNumTags, ref Int32 pnError);
コード例 #5
0
 private static extern bool ABF_ReadOpen(String szFileName, ref Int32 phFile, UInt32 fFlags, ref AbfFileHeader pFH, ref UInt32 puMaxSamples, ref UInt32 pdwMaxEpi, ref Int32 pnError);
コード例 #6
0
 private static extern float ABF_GetWaveform(Int32 fileHandle, ref AbfFileHeader pFH, Int32 nChannel, Int32 sweep, ref float pfBuffer, ref Int32 pnError);
コード例 #7
0
 private static extern bool ABFH_GetEpochLimits(ref AbfFileHeader pFH,
                                                Int32 nADCChannel, Int32 uDACChannel, Int32 dwEpisode, Int32 nEpoch,
                                                ref UInt32 puEpochStart, ref UInt32 puEpochEnd, ref Int32 pnError);
コード例 #8
0
 private static extern float ABFH_GetEpochLevel(ref AbfFileHeader pFH, Int32 nChannel, Int32 dwEpisode, Int32 nEpoch);
コード例 #9
0
 private static extern int ABFH_GetEpochDuration(ref AbfFileHeader pFH, Int32 nChannel, Int32 dwEpisode, Int32 nEpoch);