Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,7 @@ def extract_middle_slices(nifti_path, output_image_path, slice_size=180, center=
|
|
117 |
# Optionally label connected components
|
118 |
if label_components:
|
119 |
structure = generate_binary_structure(3, 3) # 3D, 26-connectivity
|
120 |
-
labeled_data, num_features = label(
|
121 |
else:
|
122 |
labeled_data = resampled_data
|
123 |
num_features = None # Not needed if we're not labeling
|
|
|
117 |
# Optionally label connected components
|
118 |
if label_components:
|
119 |
structure = generate_binary_structure(3, 3) # 3D, 26-connectivity
|
120 |
+
labeled_data, num_features = label(data > 0, structure=structure)
|
121 |
else:
|
122 |
labeled_data = resampled_data
|
123 |
num_features = None # Not needed if we're not labeling
|