-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegionItem.java
More file actions
83 lines (62 loc) · 1.47 KB
/
Copy pathRegionItem.java
File metadata and controls
83 lines (62 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import java.text.DecimalFormat;
import ij.ImagePlus;
import ij.gui.Roi;
public class RegionItem extends ThumbnailItem {
Roi roi;
ImagePlus red,green;
private double avgDistance;
private double [] distance;
private Histogram histogram;
public Histogram getHistogram() {
return histogram;
}
public void setHistogram(Histogram histogram) {
this.histogram = histogram;
}
public double[] getDistance() {
return distance;
}
public void setDistance(double[] distance) {
this.distance = distance;
}
public ImagePlus getRed() {
return red;
}
public ImagePlus getGreen(){
return green;
}
public Roi getRoi() {
return roi;
}
public void setRoi(Roi roi) {
this.roi = roi;
}
public RegionItem(ImagePlus red,ImagePlus green, ImagePlus thumbnail, Roi roi){
super(thumbnail);
this.roi=roi;
this.red = red;
this.green = green;
}
public String toString() {
DecimalFormat df = new DecimalFormat("0.000000");
return ("x=" + getX() + ", y="+ getY() + " (" + getWidth() + "x" + getHeight() + "). <b>Dist.: " + df.format(getAvgDistance()) + "</b> micron");
}
public int getX(){
return roi.getBounds().x;
}
public int getY(){
return roi.getBounds().y;
}
public int getWidth(){
return roi.getBounds().width;
}
public int getHeight(){
return roi.getBounds().height;
}
public double getAvgDistance() {
return avgDistance;
}
public void setAvgDistance(double distance) {
this.avgDistance = distance;
}
}