/* * Constructor from data location. * Assume gf is valid. */ Line::Line(spGframe_t gf, spCoordVector_t dpts, bool pixflag) : Roi() { created_type = ROI_LINE; init(gf, 2); if(pixflag) { pntData = dpts; setMagnetCoordsFromPixels(); // TODO: Should be set from data } else { magnetCoords = dpts; setDataPntsFromMagnet(); } setPixPntsFromData(); // Sets pntPix, npnts, min/max gf->addRoi(this); pntData->name = "Line"; magnetCoords->name="Line"; }
/* * Constructor from data location. * Assume gf is valid. */ Point::Point(spGframe_t gf, spCoordVector_t dpts, bool pixflag) : Roi() { init(gf, 1); created_type = ROI_POINT; myID = ++id; // Unique ID for this Point ROI // note: dpts is in magnet frame if(pixflag) { pntData = dpts; setMagnetCoordsFromPixels(); // TODO: Should be set from data } else { magnetCoords = dpts; setDataPntsFromMagnet(); } setPixPntsFromData(); // Sets pntPix, npnts, min/max gf->addRoi(this); pntData->name = "Point"; magnetCoords->name="Point"; }
/* * Constructor from data location. * Assume gf is valid. */ Polyline::Polyline(spGframe_t gf, spCoordVector_t dpts, bool pixflag) : Polygon() { init(gf, dpts->coords.size()); created_type = ROI_POLYGON_OPEN; closed = false; initEdgelist(); if(pixflag) { pntData = dpts; setMagnetCoordsFromPixels(); // TODO: Should be set from data } else { magnetCoords = dpts; setDataPntsFromMagnet(); } setPixPntsFromData(); // Sets pntPix, npnts, min/max gf->addRoi(this); pntData->name = "Polyline"; magnetCoords->name="Polyline"; }