filtered predicted vessels outside the predicted liver parenchyma region
Browse files
livermask/utils/process.py
CHANGED
@@ -211,8 +211,11 @@ def vessel_segmenter(curr, output, cpu, verbose, multiple_flag, liver_mask, name
|
|
211 |
#prediction_map = prediction_map + liver_mask
|
212 |
#prediction_map[prediction_map > 0] = 1
|
213 |
|
214 |
-
|
215 |
pred = prediction_map.astype(np.uint8)
|
|
|
|
|
|
|
216 |
img = nib.Nifti1Image(pred, affine=resampled_volume.affine)
|
217 |
resampled_lab = resample_from_to(img, nib_volume, order=0)
|
218 |
if multiple_flag:
|
|
|
211 |
#prediction_map = prediction_map + liver_mask
|
212 |
#prediction_map[prediction_map > 0] = 1
|
213 |
|
214 |
+
# filter segmented vessels outside the predicted liver parenchyma
|
215 |
pred = prediction_map.astype(np.uint8)
|
216 |
+
pred[liver_mask == 0] = 0
|
217 |
+
|
218 |
+
log.info("saving...")
|
219 |
img = nib.Nifti1Image(pred, affine=resampled_volume.affine)
|
220 |
resampled_lab = resample_from_to(img, nib_volume, order=0)
|
221 |
if multiple_flag:
|