1 package com.github.celldynamics.quimp.plugin.qanalysis;
2
3 import java.io.File;
4
5 import com.github.celldynamics.quimp.QColor;
6 import com.github.celldynamics.quimp.QParams;
7 import com.github.celldynamics.quimp.plugin.AbstractPluginOptions;
8 import com.github.celldynamics.quimp.utils.QuimpToolsCollection;
9
10
11
12
13
14
15
16 public class Qp extends AbstractPluginOptions {
17
18
19
20
21 public transient File snQPfile;
22
23
24
25 public transient File stQPfile;
26
27
28
29
30
31
32 public transient File outFile;
33
34
35 public transient String filename;
36
37
38 public transient double scale = 1;
39
40
41 public transient double frameInterval = 1;
42
43
44 transient int startFrame;
45
46
47 transient int endFrame;
48
49
50
51
52
53
54 public transient double fps = 1;
55
56
57 public transient int increment = 1;
58
59
60 public String trackColor = QColor.colourMaps[0];
61
62
63 public transient String[] outlinePlots = { "Speed", "Fluorescence", "Convexity" };
64
65
66 public String outlinePlot = outlinePlots[0];
67
68
69 public double sumCov = 1;
70
71
72 public double avgCov = 0;
73
74
75 public int mapRes = 400;
76
77
78 public transient int channel = 0;
79
80
81 transient boolean singleImage = false;
82
83
84 transient boolean useDialog = true;
85
86
87 final transient boolean Build3D = false;
88
89
90
91
92 void convexityToPixels() {
93 avgCov /= scale;
94 sumCov /= scale;
95 }
96
97
98
99
100 void convexityToUnits() {
101 avgCov *= scale;
102 sumCov *= scale;
103 }
104
105
106
107
108 public Qp() {
109 }
110
111
112
113
114
115
116
117
118 public Qp(File file) {
119 paramFile = file.getPath();
120 }
121
122
123
124
125
126
127 public void setup(QParams qp) {
128 snQPfile = qp.getSnakeQP();
129 scale = qp.getImageScale();
130 frameInterval = qp.getFrameInterval();
131 filename = QuimpToolsCollection.removeExtension(snQPfile.getName());
132 outFile = new File(snQPfile.getParent() + File.separator + filename);
133 startFrame = qp.getStartFrame();
134 endFrame = qp.getEndFrame();
135
136 fps = 1d / frameInterval;
137 singleImage = false;
138 useDialog = true;
139 }
140
141
142
143
144
145
146 @Override
147 public Object clone() throws CloneNotSupportedException {
148 Qpldynamics/quimp/plugin/qanalysis/Qp.html#Qp">Qp cp = new Qp();
149 cp.paramFile = this.paramFile;
150 if (this.snQPfile != null && this.snQPfile.getPath() != null) {
151 cp.snQPfile = new File(this.snQPfile.getPath());
152 }
153 if (this.stQPfile != null && this.stQPfile.getPath() != null) {
154 cp.stQPfile = new File(this.stQPfile.getPath());
155 }
156 if (this.outFile != null && this.outFile.getPath() != null) {
157 cp.outFile = new File(this.outFile.getPath());
158 }
159 cp.filename = this.filename;
160 cp.scale = this.scale;
161 cp.frameInterval = this.frameInterval;
162 cp.startFrame = this.startFrame;
163 cp.endFrame = this.endFrame;
164 cp.fps = this.fps;
165 cp.increment = this.increment;
166 cp.trackColor = this.trackColor;
167 cp.outlinePlot = this.outlinePlot;
168 cp.sumCov = this.sumCov;
169 cp.avgCov = this.avgCov;
170 cp.mapRes = this.mapRes;
171 cp.channel = this.channel;
172 cp.singleImage = this.singleImage;
173 cp.useDialog = this.useDialog;
174
175 return cp;
176 }
177
178 }