public static ImageROI GenerateImageROI(ImageObject image) { ImageROI imgROI = new ImageROI(); imgROI.imageGuid = Guid.NewGuid().ToString(); imgROI.sourceID = image.sourceID; imgROI.centerX = image.centerX; imgROI.centerY = image.centerY; imgROI.imageWidth = image.imageWidth; imgROI.imageHeight = image.imageHeight; imgROI.minValue = image.minValue; imgROI.maxValue = image.maxValue; imgROI.averageValue = image.averageValue; imgROI.pixelSize = image.pixelSize; imgROI.level = image.level; imgROI.window = image.window; imgROI.converse = image.converse; imgROI.colorModeName = image.colorModeName; if (image.LUT != null) { imgROI.LUT = (Color[])image.LUT.Clone(); } if (image.imageData != null) { imgROI.imageData = (ushort[, ])image.imageData.Clone(); } if (image.BMP != null) { imgROI.BMP = (Bitmap)image.BMP.Clone(); } return(imgROI); }
//记得每次更换选择图片时运行该方法 public void CheckImageInList(int index) { if (imgBase != null) { if (imgBase.Count != 0) { img = imgBase[index]; } } }
public override ImageObject Clone() { ImageROI cBmp = GenerateImageROI(this); cBmp.getClahe = this.getClahe; //获得clahe后的图像,但是data不变 cBmp.strength = this.strength; cBmp.strengthPara = this.strengthPara; cBmp.showROI = this.showROI; PointF[] ps = new PointF[this.ROIPoints.Count]; this.ROIPoints.CopyTo(ps, 0); cBmp.ROIPoints = new List <PointF>(ps); return(cBmp); }