diff --git a/models/spleen_deepedit_annotation/configs/evaluate.json b/models/spleen_deepedit_annotation/configs/evaluate.json index 42262b4b..4e3b2a52 100644 --- a/models/spleen_deepedit_annotation/configs/evaluate.json +++ b/models/spleen_deepedit_annotation/configs/evaluate.json @@ -24,7 +24,6 @@ "_target_": "SaveImaged", "_disabled_": true, "keys": "pred", - "meta_keys": "pred_meta_dict", "output_dir": "@output_dir", "resample": false, "squeeze_end_dims": true @@ -53,7 +52,7 @@ "metric_details": [ "val_mean_dice" ], - "batch_transform": "$monai.handlers.from_engine(['image_meta_dict'])", + "batch_transform": "$lambda x: [xx['image'].meta for xx in x]", "summary_ops": "*" } ], diff --git a/models/spleen_deepedit_annotation/configs/inference.json b/models/spleen_deepedit_annotation/configs/inference.json index 99cb7917..f4ff41a9 100644 --- a/models/spleen_deepedit_annotation/configs/inference.json +++ b/models/spleen_deepedit_annotation/configs/inference.json @@ -1,11 +1,17 @@ { "imports": [ "$import glob", + "$import numpy", "$import os", "$import ignite" ], "bundle_root": ".", + "image_key": "image", "output_dir": "$@bundle_root + '/eval'", + "output_ext": ".nii.gz", + "output_dtype": "$numpy.float32", + "output_postfix": "trans", + "separate_folder": true, "dataset_dir": "/workspace/Datasets/MSD_datasets/Task09_Spleen", "datalist": "$list(sorted(glob.glob(@dataset_dir + '/imagesTs/*.nii.gz')))", "label_names": { @@ -63,21 +69,21 @@ "preprocessing_transforms": [ { "_target_": "LoadImaged", - "keys": "image", + "keys": "@image_key", "reader": "ITKReader" }, { "_target_": "EnsureChannelFirstd", - "keys": "image" + "keys": "@image_key" }, { "_target_": "Orientationd", - "keys": "image", + "keys": "@image_key", "axcodes": "RAS" }, { "_target_": "ScaleIntensityRanged", - "keys": "image", + "keys": "@image_key", "a_min": -175, "a_max": 250, "b_min": 0.0, @@ -88,29 +94,29 @@ "deepedit_transforms": [ { "_target_": "scripts.transforms.OrientationGuidanceMultipleLabelDeepEditd", - "ref_image": "image", + "ref_image": "@image_key", "label_names": "@label_names" }, { "_target_": "AddGuidanceFromPointsDeepEditd", - "ref_image": "image", + "ref_image": "@image_key", "guidance": "guidance", "label_names": "@label_names" }, { "_target_": "Resized", - "keys": "image", + "keys": "@image_key", "spatial_size": "@spatial_size", "mode": "area" }, { "_target_": "ResizeGuidanceMultipleLabelDeepEditd", "guidance": "guidance", - "ref_image": "image" + "ref_image": "@image_key" }, { "_target_": "AddGuidanceSignalDeepEditd", - "keys": "image", + "keys": "@image_key", "guidance": "guidance", "number_intensity_ch": "@number_intensity_ch" } @@ -118,7 +124,7 @@ "extra_transforms": [ { "_target_": "EnsureTyped", - "keys": "image" + "keys": "@image_key" } ], "preprocessing": { @@ -156,8 +162,7 @@ "_target_": "Invertd", "keys": "pred", "transform": "@preprocessing", - "orig_keys": "image", - "meta_key_postfix": "meta_dict", + "orig_keys": "@image_key", "nearest_interp": false, "to_tensor": true }, @@ -169,8 +174,11 @@ { "_target_": "SaveImaged", "keys": "pred", - "meta_keys": "pred_meta_dict", - "output_dir": "@output_dir" + "output_dir": "@output_dir", + "output_ext": "@output_ext", + "output_dtype": "@output_dtype", + "output_postfix": "@output_postfix", + "separate_folder": "@separate_folder" } ] }, diff --git a/models/spleen_deepedit_annotation/configs/metadata.json b/models/spleen_deepedit_annotation/configs/metadata.json index 964a7a49..fcdd213d 100644 --- a/models/spleen_deepedit_annotation/configs/metadata.json +++ b/models/spleen_deepedit_annotation/configs/metadata.json @@ -1,7 +1,8 @@ { "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json", - "version": "0.5.0", + "version": "0.5.1", "changelog": { + "0.5.1": "add option to validate at training start, and I/O param entries", "0.5.0": "enable finetune and early stop", "0.4.9": "fix orientation issue on clicks", "0.4.8": "Add infer transforms to manage clicks from viewer", @@ -27,7 +28,7 @@ "0.1.0": "complete the model package", "0.0.1": "initialize the model package structure" }, - "monai_version": "1.2.0", + "monai_version": "1.3.0rc5", "pytorch_version": "1.13.1", "numpy_version": "1.22.2", "optional_packages_version": { diff --git a/models/spleen_deepedit_annotation/configs/train.json b/models/spleen_deepedit_annotation/configs/train.json index 52d28e94..e9ef9be4 100644 --- a/models/spleen_deepedit_annotation/configs/train.json +++ b/models/spleen_deepedit_annotation/configs/train.json @@ -28,6 +28,7 @@ "deepgrow_probability_train": 0.4, "deepgrow_probability_val": 1.0, "val_interval": 1, + "val_at_start": false, "device": "$torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')", "network_def": { "_target_": "DynUNet", @@ -324,6 +325,7 @@ "_target_": "ValidationHandler", "validator": "@validate#evaluator", "epoch_level": true, + "exec_at_start": "@val_at_start", "interval": "@val_interval" }, {