public int GetMaxQueueLength() { int maxQueueLen; QTrkDLL.QTrkGetQueueLength(inst, out maxQueueLen); return(maxQueueLen); }
public RMFrameCounters GetFrameCounters() { RMFrameCounters dst; QTrkDLL.RMGetFrameCounters(inst, out dst); return(dst); }
public LUTSize GetRadialZLUTSize() { LUTSize s; QTrkDLL.QTrkGetRadialZLUTSize(inst, out s.count, out s.planes, out s.radialsteps); return(s); }
public static QTrkComputedConfig FromConfig(QTrkConfig cfg) { QTrkComputedConfig cc; QTrkDLL.QTrkGetComputedConfig(ref cfg, out cc); return(cc); }
public LocalizationResult[] GetBeadResults(int start, int numFrames, int bead) { LocalizationResult[] results = new LocalizationResult[numFrames]; int count = QTrkDLL.RMGetBeadResults(inst, start, numFrames, bead, out results); Array.Resize(ref results, count); return(results); }
public LocalizationResult[] GetResults(int startFrame, int numFrames) { LocalizationResult[] results = new LocalizationResult[numFrames * rmcfg.numBeads]; int count = QTrkDLL.RMGetResults(inst, startFrame, numFrames, out results); Array.Resize(ref results, count * rmcfg.numBeads); return(results); }
public void Dispose() { if (inst != IntPtr.Zero) { QTrkDLL.RMDestroy(inst); inst = IntPtr.Zero; } }
public static void GenerateImageFromLUT(FloatImg image, FloatImg zlut, float minradius, float maxradius, Vector3 pos, bool useSplineInterp, int ovs) { ImageData imgData = image.ImageData; ImageData zlutData = zlut.ImageData; QTrkDLL.GenerateImageFromLUT(ref imgData, ref zlutData, minradius, maxradius, pos, useSplineInterp, ovs); }
public void ScheduleLocalization(FloatImg img, uint frame, int zlut, uint timestamp) { ImageData d = img.ImageData; LocalizationJob job = new LocalizationJob() { frame = frame, timestamp = timestamp, zlutIndex = zlut }; QTrkDLL.QTrkScheduleLocalization(inst, d.data, d.Pitch, QTRK_PixelDataType.Float, &job); }
public void Destroy() { if (inst != IntPtr.Zero) { Trace.WriteLine("Disposing QTrk instance..."); QTrkDLL.QTrkFreeInstance(inst); inst = IntPtr.Zero; } }
public QTrkInstance(QTrkConfig config) { if (!IsDLLSelected) { throw new ApplicationException("Use QTrkInstance::SelectDLL before creating an instance"); } inst = QTrkDLL.QTrkCreateInstance(ref config); QTrkDLL.QTrkGetComputedConfig(ref config, out cc); }
public void ScheduleFrameBitmap(Bitmap bmp, Int2[] positions, LocalizationJob[] jobInfo) { // public static extern int QTrkScheduleFrame(IntPtr qtrk, void* imgptr, int pitch, int width, int height, Int2* positions, int numROI, QTRK_PixelDataType pdt, LocalizationJob* jobInfo); BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed); QTrkDLL.QTrkScheduleFrame(inst, bmpData.Scan0, bmpData.Stride, bmpData.Width, bmpData.Height, positions, positions.Length, QTRK_PixelDataType.U8, jobInfo); bmp.UnlockBits(bmpData); // QTrkDLL.QTrkScheduleFrame(inst, }
public FloatImg GetRadialZLUT() { int count, planes, radialsteps; QTrkDLL.QTrkGetRadialZLUTSize(inst, out count, out planes, out radialsteps); FloatImg lut = new FloatImg(radialsteps, planes * count); QTrkDLL.QTrkGetRadialZLUT(inst, lut.pixels); return(lut); }
public ResultManager(string file, string frameInfoFile, ResultManagerConfig rmcfg, string[] colnames) { string scsColNames = colnames != null?string.Join(";", colnames) : ""; if (frameInfoFile == null) { frameInfoFile = ""; } rmcfg.numFrameInfoColumns = colnames == null ? 0 : colnames.Length; inst = QTrkDLL.RMCreate(file, frameInfoFile, ref rmcfg, scsColNames); this.rmcfg = rmcfg; }
public static Int2[] FindBeads(FloatImg img, Int2 sampleCornerPos, int roi, float imgRelDist, float acceptance) { // public static extern IntPtr QTrkFindBeads(float* image, int w, int h, int smpCornerPosX, int smpCornerPosY, int roi, float imgRelDist, float acceptance); int beadCount; ImageData sampleImg = new ImageData(); ImageData imgData = img.ImageData; IntPtr beadListPtr = QTrkDLL.QTrkFindBeads(ref imgData, sampleCornerPos.x, sampleCornerPos.y, roi, imgRelDist, acceptance, out beadCount, ref sampleImg); Int2 * beadpos = (Int2 *)beadListPtr.ToPointer(); Int2[] r = new Int2[beadCount]; for (int i = 0; i < beadCount; i++) { r[i] = beadpos[i]; } QTrkDLL.QTrkFreeROIPositions(beadListPtr); return(r); }
public FloatImg[] GetRadialZLUTImages() { int count, planes, radialsteps; QTrkDLL.QTrkGetRadialZLUTSize(inst, out count, out planes, out radialsteps); IntPtr lutspace = Marshal.AllocHGlobal(sizeof(float) * count * planes * radialsteps); QTrkDLL.QTrkGetRadialZLUT(inst, lutspace); FloatImg[] luts = new FloatImg[count]; float * src = (float *)lutspace.ToPointer(); for (int i = 0; i < count; i++) { float *srcimg = &src[i * planes * radialsteps]; luts[i] = new FloatImg(radialsteps, planes, srcimg); } Marshal.FreeHGlobal(lutspace); return(luts); }
public void SetTracker(QTrkInstance trkInst) { tracker = trkInst; QTrkDLL.RMSetTracker(inst, trkInst.InstancePtr); }
public static void ApplyPoissonNoise(FloatImg img, float poissonMax, float maxValue) { ImageData imgData = img.ImageData; QTrkDLL.ApplyPoissonNoise(ref imgData, poissonMax, maxValue); }
public static void SelectDLL(bool useDebug, bool useCUDA, string baseDir = "") { QTrkDLL.SelectNativeLibrary(baseDir == "" ? Directory.GetCurrentDirectory() : baseDir, useDebug, useCUDA, IntPtr.Size == 8); IsDLLSelected = true; }
public static void NormalizeRadialProfile(float[] prof) { QTrkDLL.NormalizeRadialProfile(prof, prof.Length); }
public void BeginLUT(bool normalize) { QTrkDLL.QTrkBeginLUT(inst, (uint)(normalize ? 4 : 0)); }
public void Normalize() { ImageData r = ImageData; QTrkDLL.NormalizeImage(ref r); }
public static void ComputeRadialProfile(float[] dst, int angularSteps, float minradius, float maxradius, Vector2 center, FloatImg src, float mean, bool normalize) { ImageData d = src.ImageData; QTrkDLL.ComputeRadialProfile(dst, dst.Length, angularSteps, minradius, maxradius, center, &d, mean, normalize); }
public void RemoveBead(int bead) { QTrkDLL.RMRemoveBead(inst, bead); }
public void BuildLUT(FloatImg image, int plane) { ImageData data = image.ImageData; QTrkDLL.QTrkBuildLUT(inst, data.data, data.Pitch, QTRK_PixelDataType.Float, plane, null); }
public void SetLocalizationMode(LocalizeModeEnum locMode) { QTrkDLL.QTrkSetLocalizationMode(inst, (int)locMode); }
public void Flush() { QTrkDLL.RMFlush(inst); }
public void Flush() { QTrkDLL.QTrkFlush(inst); }
public void ScheduleLocalization(ref ImageData img, LocalizationJob *job) { QTrkDLL.QTrkScheduleLocalization(inst, img.data, img.Pitch, QTRK_PixelDataType.Float, job); }
public void StoreFrameInfo(int frame, double timestamp, float[] cols) { QTrkDLL.RMStoreFrameInfo(inst, frame, timestamp, cols); }