Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,12 +61,10 @@ class DicomAnalyzer:
|
|
| 61 |
self.pan_y = 0
|
| 62 |
self.max_pan_x = 0
|
| 63 |
self.max_pan_y = 0
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
self.SMALL_CIRCLES_COLOR = (255, 255, 255)
|
| 69 |
-
|
| 70 |
print("DicomAnalyzer initialized...")
|
| 71 |
|
| 72 |
def save_results(self):
|
|
@@ -297,7 +295,7 @@ class DicomAnalyzer:
|
|
| 297 |
|
| 298 |
dx = X - x
|
| 299 |
dy = Y - y
|
| 300 |
-
dist_squared = dx*dx + dy*dy
|
| 301 |
|
| 302 |
mask = np.zeros((height, width), dtype=bool)
|
| 303 |
mask[dist_squared <= r_squared] = True
|
|
@@ -617,17 +615,8 @@ class DicomAnalyzer:
|
|
| 617 |
def create_interface():
|
| 618 |
print("Creating interface...")
|
| 619 |
analyzer = DicomAnalyzer()
|
| 620 |
-
|
| 621 |
-
#
|
| 622 |
-
# The direct link from icons8 is used below.
|
| 623 |
-
custom_css = """
|
| 624 |
-
#image_display {
|
| 625 |
-
outline: none;
|
| 626 |
-
cursor: url("https://img.icons8.com/?size=100&id=11202&format=png&color=FA5252"), auto !important;
|
| 627 |
-
}
|
| 628 |
-
"""
|
| 629 |
-
|
| 630 |
-
with gr.Blocks(css=custom_css) as interface:
|
| 631 |
gr.Markdown("# DICOM Image Analyzer")
|
| 632 |
|
| 633 |
with gr.Row():
|
|
@@ -654,6 +643,7 @@ def create_interface():
|
|
| 654 |
elem_id="image_display"
|
| 655 |
)
|
| 656 |
|
|
|
|
| 657 |
with gr.Row():
|
| 658 |
zero_btn = gr.Button("Add Zero Row")
|
| 659 |
zero2_btn = gr.Button("Add Two Zero Rows")
|
|
@@ -733,6 +723,7 @@ def create_interface():
|
|
| 733 |
outputs=image_display
|
| 734 |
)
|
| 735 |
|
|
|
|
| 736 |
zero_btn.click(
|
| 737 |
fn=analyzer.add_zero_row,
|
| 738 |
inputs=image_display,
|
|
|
|
| 61 |
self.pan_y = 0
|
| 62 |
self.max_pan_x = 0
|
| 63 |
self.max_pan_y = 0
|
| 64 |
+
# Main circle color remains yellow:
|
| 65 |
+
self.CIRCLE_COLOR = (0, 255, 255) # BGR format
|
| 66 |
+
# Small circles inside the main circle will be white:
|
| 67 |
+
self.SMALL_CIRCLES_COLOR = (255, 255, 255) # BGR white
|
|
|
|
|
|
|
| 68 |
print("DicomAnalyzer initialized...")
|
| 69 |
|
| 70 |
def save_results(self):
|
|
|
|
| 295 |
|
| 296 |
dx = X - x
|
| 297 |
dy = Y - y
|
| 298 |
+
dist_squared = dx * dx + dy * dy
|
| 299 |
|
| 300 |
mask = np.zeros((height, width), dtype=bool)
|
| 301 |
mask[dist_squared <= r_squared] = True
|
|
|
|
| 615 |
def create_interface():
|
| 616 |
print("Creating interface...")
|
| 617 |
analyzer = DicomAnalyzer()
|
| 618 |
+
|
| 619 |
+
with gr.Blocks(css="#image_display { outline: none; }") as interface:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 620 |
gr.Markdown("# DICOM Image Analyzer")
|
| 621 |
|
| 622 |
with gr.Row():
|
|
|
|
| 643 |
elem_id="image_display"
|
| 644 |
)
|
| 645 |
|
| 646 |
+
# Removed the "Add Blank Row" button
|
| 647 |
with gr.Row():
|
| 648 |
zero_btn = gr.Button("Add Zero Row")
|
| 649 |
zero2_btn = gr.Button("Add Two Zero Rows")
|
|
|
|
| 723 |
outputs=image_display
|
| 724 |
)
|
| 725 |
|
| 726 |
+
# Removed blank_btn
|
| 727 |
zero_btn.click(
|
| 728 |
fn=analyzer.add_zero_row,
|
| 729 |
inputs=image_display,
|