Skip to content

Commit 31f82d7

Browse files
authored
Merge pull request medic#31 from cjpark87/config
Config clean up and refactoring
2 parents 88bb63f + 318e299 commit 31f82d7

File tree

14 files changed

+247
-381
lines changed

14 files changed

+247
-381
lines changed

app/src/main/assets/config.json

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,36 @@
33
"REF_IMG": "quickvue_ref_v5",
44
"VIEW_FINDER_SCALE_H": 0.6,
55
"VIEW_FINDER_SCALE_W": 0.15,
6-
"INTENSITY_THRESHOLD": 150,
7-
"CONTROL_INTENSITY_PEAK_THRESHOLD": 150,
8-
"TEST_INTENSITY_PEAK_THRESHOLD": 50,
6+
"LINE_INTENSITY": 150,
97
"LINE_SEARCH_WIDTH": 13,
108
"TOP_LINE_POSITION": 45,
119
"MIDDLE_LINE_POSITION": 15,
1210
"BOTTOM_LINE_POSITION": 75,
11+
"RESULT_WINDOW_TOP_LEFT": [600, 15],
12+
"RESULT_WINDOW_BOTTOM_RIGHT": [700, 45],
13+
"TOP_LINE_NAME": "TestA",
14+
"MIDDLE_LINE_NAME": "Control",
15+
"BOTTOM_LINE_NAME": "TestB",
16+
"FIDUCIAL_COUNT": 2,
17+
"FIDUCIAL_DISTANCE": 610,
1318
"FIDUCIAL_POSITION_MIN": 160,
1419
"FIDUCIAL_POSITION_MAX": 935,
1520
"FIDUCIAL_MIN_HEIGHT": 45,
1621
"FIDUCIAL_MIN_WIDTH": 20,
1722
"FIDUCIAL_MAX_WIDTH": 150,
18-
"FIDUCIAL_TO_RESULT_WINDOW_OFFSET": 50,
19-
"RESULT_WINDOW_RECT_HEIGHT": 90,
20-
"RESULT_WINDOW_RECT_WIDTH_PADDING": 10,
21-
"FIDUCIAL_DISTANCE": 610,
22-
"FIDUCIAL_COUNT": 2,
23-
"TOP_LINE_NAME": "TestA",
24-
"MIDDLE_LINE_NAME": "Control",
25-
"BOTTOM_LINE_NAME": "TestB"
23+
"FIDUCIAL_TO_RESULT_WINDOW_OFFSET": 50
2624
},
2725
"carestart": {
2826
"REF_IMG": "carestart_ref_v0",
2927
"VIEW_FINDER_SCALE_H": 0.6,
3028
"VIEW_FINDER_SCALE_W": 0.4,
31-
"INTENSITY_THRESHOLD": 85,
32-
"CONTROL_INTENSITY_PEAK_THRESHOLD": 85,
33-
"TEST_INTENSITY_PEAK_THRESHOLD": 85,
29+
"LINE_INTENSITY": 85,
3430
"LINE_SEARCH_WIDTH": 13,
3531
"TOP_LINE_POSITION": 15,
3632
"MIDDLE_LINE_POSITION": 50,
3733
"BOTTOM_LINE_POSITION": 85,
38-
"FIDUCIAL_POSITION_MIN": 0,
39-
"FIDUCIAL_POSITION_MAX": 0,
40-
"FIDUCIAL_MIN_HEIGHT": 0,
41-
"FIDUCIAL_MIN_WIDTH": 0,
42-
"FIDUCIAL_MAX_WIDTH": 0,
43-
"FIDUCIAL_TO_RESULT_WINDOW_OFFSET": 255,
44-
"RESULT_WINDOW_RECT_HEIGHT": 90,
45-
"RESULT_WINDOW_RECT_WIDTH_PADDING": 90,
46-
"FIDUCIAL_DISTANCE": 0,
47-
"FIDUCIAL_COUNT": 0,
34+
"RESULT_WINDOW_TOP_LEFT": [210, 90],
35+
"RESULT_WINDOW_BOTTOM_RIGHT": [300, 100],
4836
"TOP_LINE_NAME": "Control",
4937
"MIDDLE_LINE_NAME": "TestPv",
5038
"BOTTOM_LINE_NAME": "TestPf"
@@ -53,23 +41,13 @@
5341
"REF_IMG": "experimental_rdt_v2",
5442
"VIEW_FINDER_SCALE_H": 0.6,
5543
"VIEW_FINDER_SCALE_W": 0.4,
56-
"INTENSITY_THRESHOLD": 80,
57-
"CONTROL_INTENSITY_PEAK_THRESHOLD": 80,
58-
"TEST_INTENSITY_PEAK_THRESHOLD": 80,
44+
"LINE_INTENSITY": 80,
5945
"LINE_SEARCH_WIDTH": 13,
6046
"TOP_LINE_POSITION": 15,
6147
"MIDDLE_LINE_POSITION": 50,
6248
"BOTTOM_LINE_POSITION": 80,
63-
"FIDUCIAL_POSITION_MIN": 0,
64-
"FIDUCIAL_POSITION_MAX": 0,
65-
"FIDUCIAL_MIN_HEIGHT": 0,
66-
"FIDUCIAL_MIN_WIDTH": 0,
67-
"FIDUCIAL_MAX_WIDTH": 0,
68-
"FIDUCIAL_TO_RESULT_WINDOW_OFFSET": 310,
69-
"RESULT_WINDOW_RECT_HEIGHT": 100,
70-
"RESULT_WINDOW_RECT_WIDTH_PADDING": 100,
71-
"FIDUCIAL_DISTANCE": 0,
72-
"FIDUCIAL_COUNT": 0,
49+
"RESULT_WINDOW_TOP_LEFT": [260, 100],
50+
"RESULT_WINDOW_BOTTOM_RIGHT": [360, 116],
7351
"TOP_LINE_NAME": "Control",
7452
"MIDDLE_LINE_NAME": "TestPv",
7553
"BOTTOM_LINE_NAME": "TestPf"
@@ -78,23 +56,13 @@
7856
"REF_IMG": "covid19_ref_v0",
7957
"VIEW_FINDER_SCALE_H": 0.6,
8058
"VIEW_FINDER_SCALE_W": 0.4,
81-
"INTENSITY_THRESHOLD": 85,
82-
"CONTROL_INTENSITY_PEAK_THRESHOLD": 85,
83-
"TEST_INTENSITY_PEAK_THRESHOLD": 85,
59+
"LINE_INTENSITY": 85,
8460
"LINE_SEARCH_WIDTH": 19,
8561
"TOP_LINE_POSITION": 35,
8662
"MIDDLE_LINE_POSITION": 75,
8763
"BOTTOM_LINE_POSITION": 115,
88-
"FIDUCIAL_POSITION_MIN": 0,
89-
"FIDUCIAL_POSITION_MAX": 0,
90-
"FIDUCIAL_MIN_HEIGHT": 0,
91-
"FIDUCIAL_MIN_WIDTH": 0,
92-
"FIDUCIAL_MAX_WIDTH": 0,
93-
"FIDUCIAL_TO_RESULT_WINDOW_OFFSET": 330,
94-
"RESULT_WINDOW_RECT_HEIGHT": 156,
95-
"RESULT_WINDOW_RECT_WIDTH_PADDING": 115,
96-
"FIDUCIAL_DISTANCE": 0,
97-
"FIDUCIAL_COUNT": 0,
64+
"RESULT_WINDOW_TOP_LEFT": [252, 115],
65+
"RESULT_WINDOW_BOTTOM_RIGHT": [408, 125],
9866
"TOP_LINE_NAME": "Control",
9967
"MIDDLE_LINE_NAME": "lgG",
10068
"BOTTOM_LINE_NAME": "lgM"

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/activities/ExpirationDateActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
package edu.washington.cs.ubicomplab.rdt_reader.activities;
1010

1111
import static com.google.android.gms.vision.Frame.ROTATION_90;
12-
import static edu.washington.cs.ubicomplab.rdt_reader.utils.Constants.*;
12+
import static edu.washington.cs.ubicomplab.rdt_reader.core.Constants.*;
1313

1414
import android.content.Intent;
1515
import android.content.res.Resources;
@@ -47,9 +47,8 @@
4747
import java.util.Locale;
4848

4949
import edu.washington.cs.ubicomplab.rdt_reader.R;
50-
import edu.washington.cs.ubicomplab.rdt_reader.fragments.SettingDialogFragment;
5150
import edu.washington.cs.ubicomplab.rdt_reader.interfaces.SettingDialogListener;
52-
import edu.washington.cs.ubicomplab.rdt_reader.utils.Constants;
51+
import edu.washington.cs.ubicomplab.rdt_reader.core.Constants;
5352
import edu.washington.cs.ubicomplab.rdt_reader.views.RDTCameraView;
5453

5554
public class ExpirationDateActivity extends AppCompatActivity implements CvCameraViewListener2, SettingDialogListener {

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/activities/ImageQualityActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import android.util.Log;
77

88
import edu.washington.cs.ubicomplab.rdt_reader.interfaces.ImageQualityViewListener;
9-
import edu.washington.cs.ubicomplab.rdt_reader.models.RDTCaptureResult;
9+
import edu.washington.cs.ubicomplab.rdt_reader.core.RDTCaptureResult;
1010
import edu.washington.cs.ubicomplab.rdt_reader.views.ImageQualityView;
1111
import edu.washington.cs.ubicomplab.rdt_reader.R;
12-
import edu.washington.cs.ubicomplab.rdt_reader.models.RDTInterpretationResult;
12+
import edu.washington.cs.ubicomplab.rdt_reader.core.RDTInterpretationResult;
1313
import edu.washington.cs.ubicomplab.rdt_reader.utils.ImageUtil;
1414

15-
import static edu.washington.cs.ubicomplab.rdt_reader.utils.Constants.DEFAULT_RDT_NAME;
15+
import static edu.washington.cs.ubicomplab.rdt_reader.core.Constants.DEFAULT_RDT_NAME;
1616

1717
public class ImageQualityActivity extends Activity implements ImageQualityViewListener {
1818
ImageQualityView mImageQualityView;

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/activities/ImageResultActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
import java.util.Locale;
3131

3232
import edu.washington.cs.ubicomplab.rdt_reader.R;
33-
import edu.washington.cs.ubicomplab.rdt_reader.fragments.SettingDialogFragment;
3433
import edu.washington.cs.ubicomplab.rdt_reader.interfaces.SettingDialogListener;
35-
import edu.washington.cs.ubicomplab.rdt_reader.utils.Constants;
34+
import edu.washington.cs.ubicomplab.rdt_reader.core.Constants;
3635

3736
import static java.text.DateFormat.getDateTimeInstance;
3837

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/activities/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
package edu.washington.cs.ubicomplab.rdt_reader.activities;
1010

11-
import static edu.washington.cs.ubicomplab.rdt_reader.utils.Constants.*;
11+
import static edu.washington.cs.ubicomplab.rdt_reader.core.Constants.*;
1212
import android.Manifest;
1313
import android.content.Context;
1414
import android.content.Intent;
@@ -35,7 +35,7 @@
3535
import edu.washington.cs.ubicomplab.rdt_reader.R;
3636
import edu.washington.cs.ubicomplab.rdt_reader.fragments.SettingDialogFragment;
3737
import edu.washington.cs.ubicomplab.rdt_reader.interfaces.SettingDialogListener;
38-
import edu.washington.cs.ubicomplab.rdt_reader.utils.Constants;
38+
import edu.washington.cs.ubicomplab.rdt_reader.core.Constants;
3939

4040
public class MainActivity extends AppCompatActivity implements View.OnClickListener, SettingDialogListener {
4141

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/utils/Constants.java renamed to app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/core/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* of a BSD-style license that can be found in the LICENSE file.
77
*/
88

9-
package edu.washington.cs.ubicomplab.rdt_reader.utils;
9+
package edu.washington.cs.ubicomplab.rdt_reader.core;
1010

1111
import android.os.Environment;
1212

@@ -45,7 +45,7 @@ public final class Constants {
4545

4646
public static double CROP_RATIO = 0.75;
4747

48-
public static double ENHANCING_THRESHOLD = 10.0;
48+
public static double ENHANCING_THRESHOLD = 7.5;
4949

5050
public static double BLOOD_PERCENTAGE_THRESHOLD = 0.25;
5151

0 commit comments

Comments
 (0)