From a73e55d2eddabfcd7ba0f2322781e4884140f905 Mon Sep 17 00:00:00 2001 From: aecelaya Date: Thu, 27 Jun 2024 23:28:15 -0700 Subject: [PATCH] Revert inference back to v0.4.8 --- docs/getting_started.md | 2 +- mist/inference/main_inference.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 061771c..aeba39f 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -40,7 +40,7 @@ naming convention for the files within your dataset. However, the MIST pipeline images in each patient directory is consistent or that each type of image is identifiable by a list of identifier strings. -MIST offers support for MSD and CSV formatted datasets. For more details, please see [MSD and CSV Formatted Data](#msd-and-csv-formatted-data). +MIST offers support for MSD and CSV formatted datasets. For more details, please see [MSD and CSV Formatted Data](usage.md). Once your dataset is in the correct format, the final step is to prepare a small JSON file containing the details of the dataset. We specifically ask for the following key-value diff --git a/mist/inference/main_inference.py b/mist/inference/main_inference.py index b1328b1..b70d465 100755 --- a/mist/inference/main_inference.py +++ b/mist/inference/main_inference.py @@ -80,19 +80,19 @@ def back_to_original_space(pred, og_ants_img, config, fg_bbox): new_size = og_ants_img.shape # Bug fix for sitk resample - new_size = np.array(new_size, dtype='int').tolist() + new_size = np.array(new_size, dtype='int').tolist() + pred = resample_mask(pred, labels=list(range(len(config["labels"]))), target_spacing=og_ants_img.spacing, new_size=new_size) - + # Return prediction to original image space - # FIX: replace ants.reorient_image2 - there is a bug in there - pred = ants.from_numpy(pred.numpy()) - pred.set_spacing(og_ants_img.spacing) + og_orientation = ants.get_orientation(og_ants_img) + pred = ants.reorient_image2(pred, og_orientation) pred.set_direction(og_ants_img.direction) pred.set_origin(og_ants_img.origin) - + # Appropriately pad back to original size if fg_bbox is not None: pred = decrop_from_fg(pred, fg_bbox)