Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
74ebbb5
New version, Accelerated maisi
Can-Zhao Feb 12, 2025
baa3583
update meta
Can-Zhao Feb 12, 2025
6b806a1
update meta
Can-Zhao Feb 12, 2025
9b5b1dd
update sample
Can-Zhao Feb 12, 2025
7358801
update sample
Can-Zhao Feb 12, 2025
e8ef29f
update sample
Can-Zhao Feb 12, 2025
7099ceb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2025
dbe8612
update config
Can-Zhao Feb 12, 2025
b0ca42c
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
Can-Zhao Feb 12, 2025
8064b54
reformat
Can-Zhao Feb 12, 2025
e8a7906
reformat
Can-Zhao Feb 12, 2025
96965aa
reformat
Can-Zhao Feb 12, 2025
814d992
resume original setting
Can-Zhao Feb 14, 2025
4e75b29
fully trained checkpoints
Can-Zhao Feb 14, 2025
abe510c
simplify find_mask
Can-Zhao Feb 14, 2025
e0e6101
simplify find_mask
Can-Zhao Feb 14, 2025
3c8e5a6
reformat
Can-Zhao Feb 14, 2025
a5ec051
reduce max_try, usually if it failes one tim, it is likely the mask h…
Can-Zhao Feb 14, 2025
6acf87e
reformat
Can-Zhao Feb 14, 2025
aaa56de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 14, 2025
7b68d37
reformat
Can-Zhao Feb 14, 2025
d4e56cf
reformat
Can-Zhao Feb 14, 2025
11290dd
remove unused code
Can-Zhao Feb 18, 2025
62446d7
remove unused code
Can-Zhao Feb 18, 2025
1d28f19
make quality range more reasonable
Can-Zhao Feb 18, 2025
bf08109
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 18, 2025
740fc98
make hish thresh of bone to 1000, change logic of regeneration when q…
Can-Zhao Feb 18, 2025
708cd68
add input restirction for z-axis FOV
Can-Zhao Feb 18, 2025
f62ddd6
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
Can-Zhao Feb 18, 2025
ce3532d
filter other labels
Can-Zhao Feb 19, 2025
5e1f564
random seed
Can-Zhao Feb 26, 2025
e8f0a59
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 26, 2025
b833988
FOV max limit
Can-Zhao Feb 26, 2025
73564c0
FOV max limit
Can-Zhao Feb 26, 2025
1421e3e
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
Can-Zhao Feb 26, 2025
33cece0
FOV max limit
Can-Zhao Feb 26, 2025
f834762
fix deterministic issue
Can-Zhao Feb 27, 2025
1484429
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2025
4486c61
rename the model name
binliunls Mar 5, 2025
fd6b702
update doc for inference
Can-Zhao Mar 7, 2025
e39e7ca
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
Can-Zhao Mar 7, 2025
f1bfed3
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
binliunls Mar 7, 2025
ebec91b
change to 3000
Can-Zhao Mar 8, 2025
c20b892
change to 3000
Can-Zhao Mar 8, 2025
266cf88
Merge branch 'dev' into maisi
Can-Zhao Mar 8, 2025
71121a9
back to 3000
Can-Zhao Mar 15, 2025
33e587a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 15, 2025
3cea983
revert
Can-Zhao Mar 15, 2025
bea9ae0
Merge branch 'maisi' of https://github.com/Can-Zhao/model-zoo into maisi
Can-Zhao Mar 15, 2025
b775a64
revert
Can-Zhao Mar 15, 2025
c1317b5
revert
Can-Zhao Mar 15, 2025
db604e2
reformat
Can-Zhao Mar 15, 2025
7355092
Merge branch 'dev' into maisi
binliunls Mar 16, 2025
f8dabca
reformat
Can-Zhao Mar 17, 2025
d20a1e2
reformat
Can-Zhao Mar 18, 2025
dcd7eb8
model link
Can-Zhao Mar 18, 2025
f8c5740
model link
Can-Zhao Mar 18, 2025
347ad71
add back old ckpt
Can-Zhao Mar 18, 2025
359d212
model name
Can-Zhao Mar 19, 2025
000d5e6
update test
Can-Zhao Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions ci/unit_tests/test_maisi_ct_generative.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@
}
]

TEST_CASE_INFER_ERROR = [
{
"bundle_root": "models/maisi_ct_generative",
"num_output_samples": 1,
"output_size": [256, 256, 256],
"body_region": ["head"],
"anatomy_list": ["colon cancer primaries"],
},
"Cannot find body region with given anatomy list.",
]

TEST_CASE_INFER_ERROR_2 = [
{
"bundle_root": "models/maisi_ct_generative",
Expand Down Expand Up @@ -277,7 +266,7 @@ def test_infer_config(self, override):
else:
self.assertTrue(output_file.endswith(".nii.gz"))

@parameterized.expand([TEST_CASE_INFER_ERROR, TEST_CASE_INFER_ERROR_7])
@parameterized.expand([TEST_CASE_INFER_ERROR_7])
def test_infer_config_error_input(self, override, expected_error):
# update override
override["output_dir"] = self.output_dir
Expand Down
48 changes: 27 additions & 21 deletions models/maisi_ct_generative/configs/inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"output_dir": "$@bundle_root + '/output'",
"create_output_dir": "$Path(@output_dir).mkdir(exist_ok=True)",
"device": "$torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')",
"trained_autoencoder_path": "$@model_dir + '/autoencoder_epoch273.pt'",
"trained_diffusion_path": "$@model_dir + '/input_unet3d_data-all_steps1000size512ddpm_random_current_inputx_v1.pt'",
"trained_controlnet_path": "$@model_dir + '/controlnet-20datasets-e20wl100fold0bc_noi_dia_fsize_current.pt'",
"trained_autoencoder_path": "$@model_dir + '/autoencoder.pt'",
"trained_diffusion_path": "$@model_dir + '/diffusion_unet.pt'",
"trained_controlnet_path": "$@model_dir + '/controlnet.pt'",
"trained_mask_generation_autoencoder_path": "$@model_dir + '/mask_generation_autoencoder.pt'",
"trained_mask_generation_diffusion_path": "$@model_dir + '/mask_generation_diffusion_unet.pt'",
"all_mask_files_base_dir": "$@bundle_root + '/datasets/all_masks_flexible_size_and_spacing_3000'",
Expand All @@ -21,14 +21,13 @@
"label_dict_remap_json": "$@bundle_root + '/configs/label_dict_124_to_132.json'",
"real_img_median_statistics_file": "$@bundle_root + '/configs/image_median_statistics.json'",
"num_output_samples": 1,
"body_region": [
"abdomen"
],
"body_region": [],
"anatomy_list": [
"liver"
],
"modality": "ct",
"controllable_anatomy_size": [],
"num_inference_steps": 1000,
"num_inference_steps": 30,
"mask_generation_num_inference_steps": 1000,
"random_seed": null,
"spatial_dims": 3,
Expand Down Expand Up @@ -63,11 +62,11 @@
64
],
"autoencoder_sliding_window_infer_size": [
96,
96,
96
80,
80,
80
],
"autoencoder_sliding_window_infer_overlap": 0.6667,
"autoencoder_sliding_window_infer_overlap": 0.4,
"autoencoder_def": {
"_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
"spatial_dims": "@spatial_dims",
Expand Down Expand Up @@ -96,7 +95,7 @@
"use_checkpointing": false,
"use_convtranspose": false,
"norm_float16": true,
"num_splits": 8,
"num_splits": 2,
"dim_split": 1
},
"diffusion_unet_def": {
Expand Down Expand Up @@ -124,9 +123,12 @@
],
"num_res_blocks": 2,
"use_flash_attention": true,
"include_top_region_index_input": true,
"include_bottom_region_index_input": true,
"include_spacing_input": true
"include_top_region_index_input": false,
"include_bottom_region_index_input": false,
"include_spacing_input": true,
"num_class_embeds": 128,
"resblock_updown": true,
"include_fc": true
},
"controlnet_def": {
"_target_": "monai.apps.generation.maisi.networks.controlnet_maisi.ControlNetMaisi",
Expand Down Expand Up @@ -157,7 +159,10 @@
8,
32,
64
]
],
"num_class_embeds": 128,
"resblock_updown": true,
"include_fc": true
},
"mask_generation_autoencoder_def": {
"_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
Expand Down Expand Up @@ -239,12 +244,11 @@
"load_mask_generation_diffusion": "$@mask_generation_diffusion_unet.load_state_dict(@checkpoint_mask_generation_diffusion_unet['unet_state_dict'], strict=True)",
"mask_generation_scale_factor": "$@checkpoint_mask_generation_diffusion_unet['scale_factor']",
"noise_scheduler": {
"_target_": "monai.networks.schedulers.ddpm.DDPMScheduler",
"_target_": "scripts.rectified_flow.RFlowScheduler",
"num_train_timesteps": 1000,
"beta_start": 0.0015,
"beta_end": 0.0195,
"schedule": "scaled_linear_beta",
"clip_sample": false
"use_discrete_timesteps": false,
"use_timestep_transform": true,
"sample_method": "uniform"
},
"mask_generation_noise_scheduler": {
"_target_": "monai.networks.schedulers.ddpm.DDPMScheduler",
Expand All @@ -269,6 +273,7 @@
],
"body_region": "@body_region",
"anatomy_list": "@anatomy_list",
"modality": "@modality",
"all_mask_files_json": "@all_mask_files_json",
"all_anatomy_size_condtions_json": "@all_anatomy_size_condtions_json",
"all_mask_files_base_dir": "@all_mask_files_base_dir",
Expand Down Expand Up @@ -300,6 +305,7 @@
"autoencoder_sliding_window_infer_overlap": "@autoencoder_sliding_window_infer_overlap"
},
"run": [
"$monai.utils.set_determinism(seed=@random_seed)",
"$@ldm_sampler.sample_multiple_images(@num_output_samples)"
],
"evaluator": null
Expand Down
3 changes: 2 additions & 1 deletion models/maisi_ct_generative/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_generator_ldm_20240318.json",
"version": "0.4.6",
"version": "1.0.0",
"changelog": {
"1.0.0": "accelerated maisi, inference only, is not compartible with previous maisi diffusion model weights",
"0.4.6": "add TensorRT support",
"0.4.5": "update README",
"0.4.4": "update issue for IgniteInfo",
Expand Down
8 changes: 5 additions & 3 deletions models/maisi_ct_generative/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This bundle is for Nvidia MAISI (Medical AI for Synthetic Imaging), a 3D Latent
The inference workflow of MAISI is depicted in the figure below. It first generates latent features from random noise by applying multiple denoising steps using the trained diffusion model. Then it decodes the denoised latent features into images using the trained autoencoder.

<p align="center">
<img src="https://developer.download.nvidia.com/assets/Clara/Images/monai_maisi_ct_generative_workflow.png" alt="MAISI inference scheme">
<img src="https://developer.download.nvidia.com/assets/Clara/Images/maisi_workflow_1.0.1.png" alt="MAISI inference scheme">
</p>

MAISI is based on the following papers:
Expand All @@ -13,6 +13,8 @@ MAISI is based on the following papers:

[**ControlNet:** Lvmin Zhang, Anyi Rao, Maneesh Agrawala; “Adding Conditional Control to Text-to-Image Diffusion Models.” ICCV 2023.](https://openaccess.thecvf.com/content/ICCV2023/papers/Zhang_Adding_Conditional_Control_to_Text-to-Image_Diffusion_Models_ICCV_2023_paper.pdf)

[**Rectified Flow:** Liu, Xingchao, and Chengyue Gong. "Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow." ICLR 2023.](https://arxiv.org/pdf/2209.03003)

#### Example synthetic image
An example result from inference is shown below:
![Example synthetic image](https://developer.download.nvidia.com/assets/Clara/Images/monai_maisi_ct_generative_example_synthetic_data.png)
Expand All @@ -27,11 +29,11 @@ The information for the inference input, like body region and anatomy to generat

- `"num_output_samples"`: int, the number of output image/mask pairs it will generate.
- `"spacing"`: voxel size of generated images. E.g., if set to `[1.5, 1.5, 2.0]`, it will generate images with a resolution of 1.5&times;1.5&times;2.0 mm. The spacing for x and y axes has to be between 0.5 and 3.0 mm and the spacing for the z axis has to be between 0.5 and 5.0 mm.
- `"output_size"`: volume size of generated images. E.g., if set to `[512, 512, 256]`, it will generate images with size of 512&times;512&times;256. They need to be divisible by 16. If you have a small GPU memory size, you should adjust it to small numbers. Note that `"spacing"` and `"output_size"` together decide the output field of view (FOV). For eample, if set them to `[1.5, 1.5, 2.0]`mm and `[512, 512, 256]`, the FOV is 768&times;768&times;512 mm. We recommend output_size is the FOV in x and y axis are same and to be at least 256mm for head, and at least 384mm for other body regions like abdomen. The output size for the x and y axes can be selected from [256, 384, 512], while for the z axis, it can be chosen from [128, 256, 384, 512, 640, 768].
- `"output_size"`: volume size of generated images. E.g., if set to `[512, 512, 256]`, it will generate images with size of 512&times;512&times;256. They need to be divisible by 16. If you have a small GPU memory size, you should adjust it to small numbers. Note that `"spacing"` and `"output_size"` together decide the output field of view (FOV). For eample, if set them to `[1.5, 1.5, 2.0]`mm and `[512, 512, 256]`, the FOV is 768&times;768&times;512 mm. We recommend output_size is the FOV in x and y axis are same and to be at least 256mm for head, at least 384mm for other body regions like abdomen, and no larger than 640mm. The output size for the x and y axes can be selected from [256, 384, 512], while for the z axis, it can be chosen from [128, 256, 384, 512, 640, 768].
- `"controllable_anatomy_size"`: a list of controllable anatomy and its size scale (0--1). E.g., if set to `[["liver", 0.5],["hepatic tumor", 0.3]]`, the generated image will contain liver that have a median size, with size around 50% percentile, and hepatic tumor that is relatively small, with around 30% percentile. In addition, if the size scale is set to -1, it indicates that the organ does not exist or should be removed. The output will contain paired image and segmentation mask for the controllable anatomy.
The following organs support generation with a controllable size: ``["liver", "gallbladder", "stomach", "pancreas", "colon", "lung tumor", "bone lesion", "hepatic tumor", "colon cancer primaries", "pancreatic tumor"]``.
The raw output of the current mask generation model has a fixed size of $256^3$ voxels with a spacing of $1.5^3$ mm. If the "output_size" differs from this default, the generated masks will be resampled to the desired `"output_size"` and `"spacing"`. Note that resampling may degrade the quality of the generated masks and could trigger multiple inference attempts if the images fail to pass the [image quality check](../scripts/quality_check.py).
- `"body_region"`: If "controllable_anatomy_size" is not specified, "body_region" will be used to constrain the region of generated images. It needs to be chosen from "head", "chest", "thorax", "abdomen", "pelvis", "lower".
- `"body_region"`: Deprecated, please leave it as empty `"[]"`.
- `"anatomy_list"`: If "controllable_anatomy_size" is not specified, the output will contain paired image and segmentation mask for the anatomy in "./configs/label_dict.json".
- `"autoencoder_sliding_window_infer_size"`: in order to save GPU memory, we use sliding window inference when decoding latents to image when `"output_size"` is large. This is the patch size of the sliding window. Small value will reduce GPU memory but increase time cost. They need to be divisible by 16.
- `"autoencoder_sliding_window_infer_overlap"`: float between 0 and 1. Large value will reduce the stitching artifacts when stitching patches during sliding window inference, but increase time cost. If you do not observe seam lines in the generated image result, you can use a smaller value to save inference time.
Expand Down
10 changes: 9 additions & 1 deletion models/maisi_ct_generative/large_files.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
large_files:
- path: "models/autoencoder_epoch273.pt"
- path: "models/autoencoder.pt"
url: "https://developer.download.nvidia.com/assets/Clara/monai/tutorials/model_zoo/model_maisi_autoencoder_epoch273_alternative.pt"
hash_val: "917cfb1e49631c8a713e3bb7c758fbca"
hash_type: "md5"
Expand All @@ -11,6 +11,14 @@ large_files:
url: "https://developer.download.nvidia.com/assets/Clara/monai/tutorials/model_zoo/model_maisi_controlnet-20datasets-e20wl100fold0bc_noi_dia_fsize_current_alternative.pt"
hash_val: "6c36572335372f405a0e85c760fa6dee"
hash_type: "md5"
- path: "models/diffusion_unet.pt"
url: "https://developer.download.nvidia.com/assets/Clara/monai/tutorials/diff_unet_ckpt_rflow_epoch19350.pt"
hash_val: "10501d59a3066802087c82ebd7a71719"
hash_type: "md5"
- path: "models/controlnet.pt"
url: "https://developer.download.nvidia.com/assets/Clara/monai/tutorials/controlnet_rflow_epoch208.pt"
hash_val: "49933da32826c0f7ca17016ccd13e23b"
hash_type: "md5"
- path: "models/mask_generation_autoencoder.pt"
url: "https://developer.download.nvidia.com/assets/Clara/monai/tutorials/mask_generation_autoencoder.pt"
hash_val: "b177778820f412abc9218cdb7ce3b653"
Expand Down
33 changes: 20 additions & 13 deletions models/maisi_ct_generative/scripts/augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def dilate3d(input_tensor, erosion=3):
return output.squeeze(0).squeeze(0)


def augmentation_tumor_bone(pt_nda, output_size):
def augmentation_tumor_bone(pt_nda, output_size, random_seed):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 128] = 1
Expand All @@ -74,6 +74,7 @@ def augmentation_tumor_bone(pt_nda, output_size):
scale_range=(0.15, 0.15, 0),
padding_mode="zeros",
)
elastic.set_random_state(seed=random_seed)

tumor_szie = torch.sum((real_l_volume_ > 0).float())
###########################
Expand Down Expand Up @@ -112,7 +113,7 @@ def augmentation_tumor_bone(pt_nda, output_size):
return pt_nda


def augmentation_tumor_liver(pt_nda, output_size):
def augmentation_tumor_liver(pt_nda, output_size, random_seed):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 1] = 1
Expand All @@ -129,6 +130,7 @@ def augmentation_tumor_liver(pt_nda, output_size):
scale_range=(0.2, 0.2, 0.2),
padding_mode="zeros",
)
elastic.set_random_state(seed=random_seed)

tumor_szie = torch.sum(real_l_volume_ == 2)
###########################
Expand Down Expand Up @@ -161,7 +163,7 @@ def augmentation_tumor_liver(pt_nda, output_size):
return pt_nda


def augmentation_tumor_lung(pt_nda, output_size):
def augmentation_tumor_lung(pt_nda, output_size, random_seed):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 23] = 1
Expand All @@ -177,6 +179,7 @@ def augmentation_tumor_lung(pt_nda, output_size):
scale_range=(0.15, 0.15, 0.15),
padding_mode="zeros",
)
elastic.set_random_state(seed=random_seed)

tumor_szie = torch.sum(real_l_volume_)
# before move lung tumor maks, full the original location by lung labels
Expand Down Expand Up @@ -224,7 +227,7 @@ def augmentation_tumor_lung(pt_nda, output_size):
return pt_nda


def augmentation_tumor_pancreas(pt_nda, output_size):
def augmentation_tumor_pancreas(pt_nda, output_size, random_seed):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 4] = 1
Expand All @@ -241,6 +244,7 @@ def augmentation_tumor_pancreas(pt_nda, output_size):
scale_range=(0.1, 0.1, 0.1),
padding_mode="zeros",
)
elastic.set_random_state(seed=random_seed)

tumor_szie = torch.sum(real_l_volume_ == 2)
###########################
Expand Down Expand Up @@ -273,7 +277,7 @@ def augmentation_tumor_pancreas(pt_nda, output_size):
return pt_nda


def augmentation_tumor_colon(pt_nda, output_size):
def augmentation_tumor_colon(pt_nda, output_size, random_seed):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 27] = 1
Expand All @@ -289,6 +293,7 @@ def augmentation_tumor_colon(pt_nda, output_size):
scale_range=(0.1, 0.1, 0.1),
padding_mode="zeros",
)
elastic.set_random_state(seed=random_seed)

tumor_szie = torch.sum(real_l_volume_)
###########################
Expand Down Expand Up @@ -330,37 +335,39 @@ def augmentation_tumor_colon(pt_nda, output_size):
return pt_nda


def augmentation_body(pt_nda):
def augmentation_body(pt_nda, random_seed):
volume = pt_nda.squeeze(0)

zoom = RandZoom(min_zoom=0.99, max_zoom=1.01, mode="nearest", align_corners=None, prob=1.0)
zoom.set_random_state(seed=random_seed)

volume = zoom(volume)

pt_nda = volume.unsqueeze(0)
return pt_nda


def augmentation(pt_nda, output_size):
def augmentation(pt_nda, output_size, random_seed):
label_list = torch.unique(pt_nda)
label_list = list(label_list.cpu().numpy())

if 128 in label_list:
print("augmenting bone lesion/tumor")
pt_nda = augmentation_tumor_bone(pt_nda, output_size)
pt_nda = augmentation_tumor_bone(pt_nda, output_size, random_seed)
elif 26 in label_list:
print("augmenting liver tumor")
pt_nda = augmentation_tumor_liver(pt_nda, output_size)
pt_nda = augmentation_tumor_liver(pt_nda, output_size, random_seed)
elif 23 in label_list:
print("augmenting lung tumor")
pt_nda = augmentation_tumor_lung(pt_nda, output_size)
pt_nda = augmentation_tumor_lung(pt_nda, output_size, random_seed)
elif 24 in label_list:
print("augmenting pancreas tumor")
pt_nda = augmentation_tumor_pancreas(pt_nda, output_size)
pt_nda = augmentation_tumor_pancreas(pt_nda, output_size, random_seed)
elif 27 in label_list:
print("augmenting colon tumor")
pt_nda = augmentation_tumor_colon(pt_nda, output_size)
pt_nda = augmentation_tumor_colon(pt_nda, output_size, random_seed)
else:
print("augmenting body")
pt_nda = augmentation_body(pt_nda)
pt_nda = augmentation_body(pt_nda, random_seed)

return pt_nda
Loading
Loading