Skip to content

Commit

Permalink
upd planners
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzjalen committed Mar 4, 2024
1 parent 35753da commit 4f95c4b
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def plan_experiment(self):
print(plans['configurations']['3d_fullres_mosaic_arch2'])
print()

plans['configurations']['3d_fullres_mosaic_resenc'] = {
plans['configurations']['3d_fullres_mosaic_resenc_NoRsmp'] = {
"inherits_from": "3d_fullres",
"UNet_class_name": "ResidualEncoderUNet",
"n_conv_per_stage_encoder": [
Expand All @@ -657,23 +657,28 @@ def plan_experiment(self):
4,
6,
6,
6,
6
],
"n_conv_per_stage_decoder": [
1,
1,
1,
1,
1,
1
]
],
"resampling_fn_data": "no_resampling_data_or_seg_to_shape",
"resampling_fn_seg": "no_resampling_data_or_seg_to_shape",
"resampling_fn_probabilities": "no_resampling_data_or_seg_to_shape",
}

print('3D fullres Mosaic ResEncUnet')
print(plans['configurations']['3d_fullres_mosaic_resenc'])
print(plans['configurations']['3d_fullres_mosaic_resenc_NoRsmp'])
print()

plans['configurations']["3d_fullres_mosaic_resenc_192x192x192_bs2_1mm"]= {
"inherits_from": "3d_fullres_mosaic_resenc",
"inherits_from": "3d_fullres_mosaic_resenc_NoRsmp",
"spacing": [1.0, 1.0, 1.0],
"patch_size": [
192,
Expand All @@ -683,8 +688,158 @@ def plan_experiment(self):
"batch_size": 2
}

print('3D fullres Mosaic ResEncUnet 192x192x192 bs3 1mm')
print(plans['configurations']['3d_fullres_mosaic_resenc'])
print('3D fullres Mosaic ResEncUnet 192x192x192 bs2 1mm')
print(plans['configurations']['3d_fullres_mosaic_resenc_192x192x192_bs2_1mm'])
print()

plans['configurations']["3d_fullres_mosaic_resenc_large_NoRsmp"]= {
"inherits_from": "3d_fullres",
"spacing": [1.0, 1.0, 1.0],
"batch_size": 2,
"data_identifier": "nnUNetPlansNoRs_3d_fullres_mosaic_ResEnc",
"preprocessor_name": "DefaultPreprocessor",
"batch_size": 2,
"patch_size": [
128,
256,
256
],
"median_image_size_in_voxels": [
128.0,
256.0,
256.0
],
"normalization_schemes": [
"CTNormalization"
],
"use_mask_for_norm": [
False
],
"UNet_class_name": "ResidualEncoderUNet",
"UNet_base_num_features": 32,
"n_conv_per_stage_encoder": [
2,
2,
2,
2,
2,
2,
2
],
"n_conv_per_stage_decoder": [
2,
2,
2,
2,
2,
2
],
"num_pool_per_axis": [
5,
6,
6
],
"pool_op_kernel_sizes": [
[
1,
1,
1
],
[
2,
2,
2
],
[
2,
2,
2
],
[
2,
2,
2
],
[
2,
2,
2
],
[
2,
2,
2
],
[
1,
2,
2
]
],
"conv_kernel_sizes": [
[
3,
3,
3
],
[
3,
3,
3
],
[
3,
3,
3
],
[
3,
3,
3
],
[
3,
3,
3
],
[
3,
3,
3
],
[
3,
3,
3
]
],
"unet_max_num_features": 320,
"resampling_fn_data": "no_resampling_data_or_seg_to_shape",
"resampling_fn_seg": "no_resampling_data_or_seg_to_shape",
"resampling_fn_data_kwargs": {
"is_seg": False,
"order": 3,
"order_z": 0,
"force_separate_z": None
},
"resampling_fn_seg_kwargs": {
"is_seg": True,
"order": 1,
"order_z": 0,
"force_separate_z": None
},
"resampling_fn_probabilities": "no_resampling_data_or_seg_to_shape",
"resampling_fn_probabilities_kwargs": {
"is_seg": False,
"order": 1,
"order_z": 0,
"force_separate_z": None
},
"batch_dice": False
}

print('3D fullres Mosaic ResEncUnet Large No Resampling')
print(plans['configurations']['3d_fullres_mosaic_resenc_large_NoRsmp'])
print()

self.plans = plans
Expand Down
77 changes: 65 additions & 12 deletions scripts/generate_json.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,82 @@
"from nnunetv2.dataset_conversion.generate_dataset_json import generate_dataset_json\n",
"import os\n",
"\n",
"dataset = \"/media/eolika/49755d50-5426-4672-87cc-2d1a5a3747ad/nnUNet/nnUNet_raw/Dataset301_liver_segments\"\n",
"dataset = \"/media/eolika/49755d50-5426-4672-87cc-2d1a5a3747ad/nnUNet/nnUNet_raw/Dataset101_mosaic_skeleton\"\n",
"\n",
"generate_dataset_json(output_folder=dataset,\n",
" channel_names={0: \"CT\"},\n",
" labels={\n",
" \"background\": 0,\n",
" \"liver_segment_1\": 1,\n",
" \"liver_segmen_2\": 2,\n",
" \"liver_segment_3\": 3,\n",
" \"liver_segment_4A\": 4,\n",
" \"liver_segment_4B\": 5,\n",
" \"liver_segment_5\": 6,\n",
" \"liver_segment_6\": 7,\n",
" \"liver_segment_7\": 8,\n",
" \"liver_segment_8\": 9\n",
" \"rib_left_1\": 1,\n",
" \"rib_left_2\": 2,\n",
" \"rib_left_3\": 3,\n",
" \"rib_left_4\": 4,\n",
" \"rib_left_5\": 5,\n",
" \"rib_left_6\": 6,\n",
" \"rib_left_7\": 7,\n",
" \"rib_left_8\": 8,\n",
" \"rib_left_9\": 9,\n",
" \"rib_left_10\": 10,\n",
" \"rib_left_11\": 11,\n",
" \"rib_left_12\": 12,\n",
" \"rib_right_1\": 13,\n",
" \"rib_right_2\": 14,\n",
" \"rib_right_3\": 15,\n",
" \"rib_right_4\": 16,\n",
" \"rib_right_5\": 17,\n",
" \"rib_right_6\": 18,\n",
" \"rib_right_7\": 19,\n",
" \"rib_right_8\": 20,\n",
" \"rib_right_9\": 21,\n",
" \"rib_right_10\": 22,\n",
" \"rib_right_11\": 23,\n",
" \"rib_right_12\": 24,\n",
" \"sternum\": 25,\n",
" \"costal_cartilages\": 26,\n",
" \"sacrum\": 27,\n",
" \"vertebrae_L5\": 28,\n",
" \"vertebrae_L4\": 29,\n",
" \"vertebrae_L3\": 30,\n",
" \"vertebrae_L2\": 31,\n",
" \"vertebrae_L1\": 32,\n",
" \"vertebrae_T12\": 33,\n",
" \"vertebrae_T11\": 34,\n",
" \"vertebrae_T10\": 35,\n",
" \"vertebrae_T9\": 36,\n",
" \"vertebrae_T8\": 37,\n",
" \"vertebrae_T7\": 38,\n",
" \"vertebrae_T6\": 39,\n",
" \"vertebrae_T5\": 40,\n",
" \"vertebrae_T4\": 41,\n",
" \"vertebrae_T3\": 42,\n",
" \"vertebrae_T2\": 43,\n",
" \"vertebrae_T1\": 44,\n",
" \"vertebrae_C7\": 45,\n",
" \"vertebrae_C6\": 46,\n",
" \"vertebrae_C5\": 47,\n",
" \"vertebrae_C4\": 48,\n",
" \"vertebrae_C3\": 49,\n",
" \"vertebrae_C2\": 50,\n",
" \"vertebrae_C1\": 51,\n",
" \"humerus_left\": 52,\n",
" \"humerus_right\": 53,\n",
" \"scapula_left\": 54,\n",
" \"scapula_right\": 55,\n",
" \"clavicula_left\": 56,\n",
" \"clavicula_right\": 57,\n",
" \"femur_left\": 58,\n",
" \"femur_right\": 59,\n",
" \"hip_left\": 60,\n",
" \"hip_right\": 61,\n",
" \"skull\": 62,\n",
" },\n",
" num_training_cases=len(os.listdir(f'{dataset}/imagesTr')), \n",
" file_ending='.nii.gz',\n",
" dataset_name=dataset.split('/')[-1], \n",
" reference='none',\n",
" release='1.0.0',\n",
" release='2.0.0',\n",
" overwrite_image_reader_writer='NibabelIOWithReorient',\n",
" description=\"liver_segments\")"
" description=\"skeleton\")"
]
},
{
Expand Down

0 comments on commit 4f95c4b

Please sign in to comment.