Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion generation/maisi/maisi_train_vae_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
}
],
"source": [
"config_file = \"./configs/config_maisi.json\"\n",
"config_file = \"./configs/config_maisi3d-rflow.json\"\n",
"config_dict = json.load(open(config_file, \"r\"))\n",
"for k, v in config_dict.items():\n",
" setattr(args, k, v)\n",
Expand Down
14 changes: 7 additions & 7 deletions generation/maisi/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, random_seed):
def augmentation_tumor_bone(pt_nda, output_size, random_seed=None):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 128] = 1
Expand Down Expand Up @@ -113,7 +113,7 @@ def augmentation_tumor_bone(pt_nda, output_size, random_seed):
return pt_nda


def augmentation_tumor_liver(pt_nda, output_size, random_seed):
def augmentation_tumor_liver(pt_nda, output_size, random_seed=None):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 1] = 1
Expand Down Expand Up @@ -163,7 +163,7 @@ def augmentation_tumor_liver(pt_nda, output_size, random_seed):
return pt_nda


def augmentation_tumor_lung(pt_nda, output_size, random_seed):
def augmentation_tumor_lung(pt_nda, output_size, random_seed=None):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 23] = 1
Expand Down Expand Up @@ -227,7 +227,7 @@ def augmentation_tumor_lung(pt_nda, output_size, random_seed):
return pt_nda


def augmentation_tumor_pancreas(pt_nda, output_size, random_seed):
def augmentation_tumor_pancreas(pt_nda, output_size, random_seed=None):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 4] = 1
Expand Down Expand Up @@ -277,7 +277,7 @@ def augmentation_tumor_pancreas(pt_nda, output_size, random_seed):
return pt_nda


def augmentation_tumor_colon(pt_nda, output_size, random_seed):
def augmentation_tumor_colon(pt_nda, output_size, random_seed=None):
volume = pt_nda.squeeze(0)
real_l_volume_ = torch.zeros_like(volume)
real_l_volume_[volume == 27] = 1
Expand Down Expand Up @@ -335,7 +335,7 @@ def augmentation_tumor_colon(pt_nda, output_size, random_seed):
return pt_nda


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

zoom = RandZoom(min_zoom=0.99, max_zoom=1.01, mode="nearest", align_corners=None, prob=1.0)
Expand All @@ -347,7 +347,7 @@ def augmentation_body(pt_nda, random_seed):
return pt_nda


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

Expand Down
Loading