Merge pull request #34 from andreped/demo-fix
Browse files- DeepDeformationMapRegistration/main.py +1 -0
- demo/src/gui.py +2 -2
- demo/src/utils.py +0 -2
DeepDeformationMapRegistration/main.py
CHANGED
|
@@ -310,6 +310,7 @@ def main():
|
|
| 310 |
# disp_map = disp_map_or
|
| 311 |
pred_image = zoom(pred_image, 1 / zoom_factors)
|
| 312 |
pred_image = pad_crop_to_original_shape(pred_image, fixed_image_or.shape, crop_min)
|
|
|
|
| 313 |
LOGGER.info('Done...')
|
| 314 |
|
| 315 |
if args.original_resolution:
|
|
|
|
| 310 |
# disp_map = disp_map_or
|
| 311 |
pred_image = zoom(pred_image, 1 / zoom_factors)
|
| 312 |
pred_image = pad_crop_to_original_shape(pred_image, fixed_image_or.shape, crop_min)
|
| 313 |
+
pred_image = np.squeeze(pred_image, axis=-1)
|
| 314 |
LOGGER.info('Done...')
|
| 315 |
|
| 316 |
if args.original_resolution:
|
demo/src/gui.py
CHANGED
|
@@ -61,7 +61,7 @@ class WebUI:
|
|
| 61 |
self.fixed_images = load_ct_to_numpy(fixed_image_path)
|
| 62 |
self.moving_images = load_ct_to_numpy(moving_image_path)
|
| 63 |
self.pred_images = load_ct_to_numpy(output_path + "pred_image.nii.gz")
|
| 64 |
-
return
|
| 65 |
|
| 66 |
def get_fixed_image(self, k):
|
| 67 |
k = int(k) - 1
|
|
@@ -183,7 +183,7 @@ class WebUI:
|
|
| 183 |
self.run_btn.click(
|
| 184 |
fn=lambda x: self.process(x),
|
| 185 |
inputs=file_output,
|
| 186 |
-
outputs=
|
| 187 |
)
|
| 188 |
|
| 189 |
self.slider.input(
|
|
|
|
| 61 |
self.fixed_images = load_ct_to_numpy(fixed_image_path)
|
| 62 |
self.moving_images = load_ct_to_numpy(moving_image_path)
|
| 63 |
self.pred_images = load_ct_to_numpy(output_path + "pred_image.nii.gz")
|
| 64 |
+
return None
|
| 65 |
|
| 66 |
def get_fixed_image(self, k):
|
| 67 |
k = int(k) - 1
|
|
|
|
| 183 |
self.run_btn.click(
|
| 184 |
fn=lambda x: self.process(x),
|
| 185 |
inputs=file_output,
|
| 186 |
+
outputs=None,
|
| 187 |
)
|
| 188 |
|
| 189 |
self.slider.input(
|
demo/src/utils.py
CHANGED
|
@@ -21,7 +21,6 @@ def load_ct_to_numpy(data_path):
|
|
| 21 |
data = data / np.amax(data) * 255
|
| 22 |
data = data.astype("uint8")
|
| 23 |
|
| 24 |
-
print(data.shape)
|
| 25 |
return [data[..., i] for i in range(data.shape[-1])]
|
| 26 |
|
| 27 |
|
|
@@ -38,7 +37,6 @@ def load_pred_volume_to_numpy(data_path):
|
|
| 38 |
data[data > 0] = 1
|
| 39 |
data = data.astype("uint8")
|
| 40 |
|
| 41 |
-
print(data.shape)
|
| 42 |
return [data[..., i] for i in range(data.shape[-1])]
|
| 43 |
|
| 44 |
|
|
|
|
| 21 |
data = data / np.amax(data) * 255
|
| 22 |
data = data.astype("uint8")
|
| 23 |
|
|
|
|
| 24 |
return [data[..., i] for i in range(data.shape[-1])]
|
| 25 |
|
| 26 |
|
|
|
|
| 37 |
data[data > 0] = 1
|
| 38 |
data = data.astype("uint8")
|
| 39 |
|
|
|
|
| 40 |
return [data[..., i] for i in range(data.shape[-1])]
|
| 41 |
|
| 42 |
|