Exemple #1
0
        public int GetMaxQueueLength()
        {
            int maxQueueLen;

            QTrkDLL.QTrkGetQueueLength(inst, out maxQueueLen);
            return(maxQueueLen);
        }
Exemple #2
0
        public RMFrameCounters GetFrameCounters()
        {
            RMFrameCounters dst;

            QTrkDLL.RMGetFrameCounters(inst, out dst);
            return(dst);
        }
Exemple #3
0
        public LUTSize GetRadialZLUTSize()
        {
            LUTSize s;

            QTrkDLL.QTrkGetRadialZLUTSize(inst, out s.count, out s.planes, out s.radialsteps);
            return(s);
        }
Exemple #4
0
        public static QTrkComputedConfig FromConfig(QTrkConfig cfg)
        {
            QTrkComputedConfig cc;

            QTrkDLL.QTrkGetComputedConfig(ref cfg, out cc);
            return(cc);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
 public void Dispose()
 {
     if (inst != IntPtr.Zero)
     {
         QTrkDLL.RMDestroy(inst);
         inst = IntPtr.Zero;
     }
 }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        public void Destroy()
        {
            if (inst != IntPtr.Zero)
            {
                Trace.WriteLine("Disposing QTrk instance...");

                QTrkDLL.QTrkFreeInstance(inst);
                inst = IntPtr.Zero;
            }
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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,
        }
Exemple #13
0
        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);
        }
Exemple #14
0
        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;
        }
Exemple #15
0
        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);
        }
Exemple #16
0
        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);
        }
Exemple #17
0
 public void SetTracker(QTrkInstance trkInst)
 {
     tracker = trkInst;
     QTrkDLL.RMSetTracker(inst, trkInst.InstancePtr);
 }
Exemple #18
0
        public static void ApplyPoissonNoise(FloatImg img, float poissonMax, float maxValue)
        {
            ImageData imgData = img.ImageData;

            QTrkDLL.ApplyPoissonNoise(ref imgData, poissonMax, maxValue);
        }
Exemple #19
0
 public static void SelectDLL(bool useDebug, bool useCUDA, string baseDir = "")
 {
     QTrkDLL.SelectNativeLibrary(baseDir == "" ? Directory.GetCurrentDirectory() : baseDir, useDebug, useCUDA, IntPtr.Size == 8);
     IsDLLSelected = true;
 }
Exemple #20
0
 public static void NormalizeRadialProfile(float[] prof)
 {
     QTrkDLL.NormalizeRadialProfile(prof, prof.Length);
 }
Exemple #21
0
 public void BeginLUT(bool normalize)
 {
     QTrkDLL.QTrkBeginLUT(inst, (uint)(normalize ? 4 : 0));
 }
Exemple #22
0
        public void Normalize()
        {
            ImageData r = ImageData;

            QTrkDLL.NormalizeImage(ref r);
        }
Exemple #23
0
        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);
        }
Exemple #24
0
 public void RemoveBead(int bead)
 {
     QTrkDLL.RMRemoveBead(inst, bead);
 }
Exemple #25
0
        public void BuildLUT(FloatImg image, int plane)
        {
            ImageData data = image.ImageData;

            QTrkDLL.QTrkBuildLUT(inst, data.data, data.Pitch, QTRK_PixelDataType.Float, plane, null);
        }
Exemple #26
0
 public void SetLocalizationMode(LocalizeModeEnum locMode)
 {
     QTrkDLL.QTrkSetLocalizationMode(inst, (int)locMode);
 }
Exemple #27
0
 public void Flush()
 {
     QTrkDLL.RMFlush(inst);
 }
Exemple #28
0
 public void Flush()
 {
     QTrkDLL.QTrkFlush(inst);
 }
Exemple #29
0
 public void ScheduleLocalization(ref ImageData img, LocalizationJob *job)
 {
     QTrkDLL.QTrkScheduleLocalization(inst, img.data, img.Pitch, QTRK_PixelDataType.Float, job);
 }
Exemple #30
0
 public void StoreFrameInfo(int frame, double timestamp, float[] cols)
 {
     QTrkDLL.RMStoreFrameInfo(inst, frame, timestamp, cols);
 }