Skip to content

Commit

Permalink
Revert inference back to v0.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aecelaya committed Jun 28, 2024
1 parent 3c36517 commit a73e55d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions mist/inference/main_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a73e55d

Please sign in to comment.