Dear author,
I try to recover the original image after going through the model. I have tried the following command (saver = NiftiSaver)
for val_data in val_loader:
val_images, val_labels = val_data["image"], val_data["label"]
# print(val_data)
roi_size = (160, 160, 160)
sw_batch_size = 4
val_outputs = sliding_window_inference(val_images, roi_size, sw_batch_size, model)
val_outputs = post_pred(val_outputs)
val_labels = post_label(val_labels)
value = compute_meandice(
y_pred=val_outputs,
y=val_labels,
include_background=False,
)
metric_count += len(value)
metric_sum += value.item() * len(value)
saver.save_batch(val_outputs, val_data["image_meta_dict"])
Here is my transforms to
val_transforms = Compose(
[
LoadImaged(keys=["image", "label"]),
AddChanneld(keys=["image", "label"]),
Spacingd(
keys=["image", "label"],
pixdim=(0.76, 0.76, 2),
mode=("bilinear", "nearest"),
),
RandSpatialCropd(
keys=["image", "label"],
roi_size=(200, 200, 64),
random_size=False,
random_center=False
),
ToTensord(keys=["image", "label"]),
]
)
As the result., the segmentation of (200,200,96) image is placing on the top left of the images (it does not recover as the original ones?). How can I solve this problem
Dear author,
I try to recover the original image after going through the model. I have tried the following command (saver = NiftiSaver)
Here is my transforms to
As the result., the segmentation of (200,200,96) image is placing on the top left of the images (it does not recover as the original ones?). How can I solve this problem