Update app.py
Browse files
app.py
CHANGED
|
@@ -147,8 +147,8 @@ class DicomAnalyzer:
|
|
| 147 |
# Create mask with larger radius calculation
|
| 148 |
Y, X = np.ogrid[:height, :width]
|
| 149 |
|
| 150 |
-
# Increase effective radius to include boundary pixels
|
| 151 |
-
radius = (self.circle_diameter / 2.0) + 0
|
| 152 |
r_squared = radius * radius
|
| 153 |
|
| 154 |
# Calculate distances with more inclusive boundary
|
|
@@ -156,8 +156,8 @@ class DicomAnalyzer:
|
|
| 156 |
dy = Y - y
|
| 157 |
dist_squared = dx*dx + dy*dy
|
| 158 |
|
| 159 |
-
# Include
|
| 160 |
-
mask = dist_squared <= (r_squared + 0.
|
| 161 |
|
| 162 |
# Get ROI pixels
|
| 163 |
roi_pixels = self.original_image[mask]
|
|
@@ -223,7 +223,7 @@ class DicomAnalyzer:
|
|
| 223 |
zoomed_x = int(x * self.zoom_factor)
|
| 224 |
zoomed_y = int(y * self.zoom_factor)
|
| 225 |
# Use enhanced radius for display
|
| 226 |
-
zoomed_radius = int(((diameter/2.0 + 0
|
| 227 |
|
| 228 |
# Draw main circle
|
| 229 |
cv2.circle(zoomed_bgr,
|
|
|
|
| 147 |
# Create mask with larger radius calculation
|
| 148 |
Y, X = np.ogrid[:height, :width]
|
| 149 |
|
| 150 |
+
# Increase effective radius to include more boundary pixels
|
| 151 |
+
radius = (self.circle_diameter / 2.0) + 1.0 # Increased from 0.5 to 1.0
|
| 152 |
r_squared = radius * radius
|
| 153 |
|
| 154 |
# Calculate distances with more inclusive boundary
|
|
|
|
| 156 |
dy = Y - y
|
| 157 |
dist_squared = dx*dx + dy*dy
|
| 158 |
|
| 159 |
+
# Include more pixels in the mask
|
| 160 |
+
mask = dist_squared <= (r_squared + 0.5) # Increased tolerance
|
| 161 |
|
| 162 |
# Get ROI pixels
|
| 163 |
roi_pixels = self.original_image[mask]
|
|
|
|
| 223 |
zoomed_x = int(x * self.zoom_factor)
|
| 224 |
zoomed_y = int(y * self.zoom_factor)
|
| 225 |
# Use enhanced radius for display
|
| 226 |
+
zoomed_radius = int(((diameter/2.0 + 1.0) * self.zoom_factor)) # Increased from 0.5 to 1.0
|
| 227 |
|
| 228 |
# Draw main circle
|
| 229 |
cv2.circle(zoomed_bgr,
|