HeshamAI commited on
Commit
3d765a4
·
verified ·
1 Parent(s): 06bce29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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.5 # Add 0.5 to include boundary pixels
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 slightly more pixels in the mask
160
- mask = dist_squared <= (r_squared + 0.25) # Add small tolerance
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.5) * self.zoom_factor))
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,