Skip to content

Commit 223d8ff

Browse files
fix Error in MAISI (#1967)
Fixes #1965 . ### Description A few sentences describing the changes proposed in this pull request. ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Avoid including large-size files in the PR. - [ ] Clean up long text outputs from code cells in the notebook. - [ ] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` --------- Signed-off-by: Can-Zhao <canz@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 840a399 commit 223d8ff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

generation/maisi/maisi_train_vae_tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
}
327327
],
328328
"source": [
329-
"config_file = \"./configs/config_maisi.json\"\n",
329+
"config_file = \"./configs/config_maisi3d-rflow.json\"\n",
330330
"config_dict = json.load(open(config_file, \"r\"))\n",
331331
"for k, v in config_dict.items():\n",
332332
" setattr(args, k, v)\n",

generation/maisi/scripts/augmentation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def dilate3d(input_tensor, erosion=3):
6060
return output.squeeze(0).squeeze(0)
6161

6262

63-
def augmentation_tumor_bone(pt_nda, output_size, random_seed):
63+
def augmentation_tumor_bone(pt_nda, output_size, random_seed=None):
6464
volume = pt_nda.squeeze(0)
6565
real_l_volume_ = torch.zeros_like(volume)
6666
real_l_volume_[volume == 128] = 1
@@ -113,7 +113,7 @@ def augmentation_tumor_bone(pt_nda, output_size, random_seed):
113113
return pt_nda
114114

115115

116-
def augmentation_tumor_liver(pt_nda, output_size, random_seed):
116+
def augmentation_tumor_liver(pt_nda, output_size, random_seed=None):
117117
volume = pt_nda.squeeze(0)
118118
real_l_volume_ = torch.zeros_like(volume)
119119
real_l_volume_[volume == 1] = 1
@@ -163,7 +163,7 @@ def augmentation_tumor_liver(pt_nda, output_size, random_seed):
163163
return pt_nda
164164

165165

166-
def augmentation_tumor_lung(pt_nda, output_size, random_seed):
166+
def augmentation_tumor_lung(pt_nda, output_size, random_seed=None):
167167
volume = pt_nda.squeeze(0)
168168
real_l_volume_ = torch.zeros_like(volume)
169169
real_l_volume_[volume == 23] = 1
@@ -227,7 +227,7 @@ def augmentation_tumor_lung(pt_nda, output_size, random_seed):
227227
return pt_nda
228228

229229

230-
def augmentation_tumor_pancreas(pt_nda, output_size, random_seed):
230+
def augmentation_tumor_pancreas(pt_nda, output_size, random_seed=None):
231231
volume = pt_nda.squeeze(0)
232232
real_l_volume_ = torch.zeros_like(volume)
233233
real_l_volume_[volume == 4] = 1
@@ -277,7 +277,7 @@ def augmentation_tumor_pancreas(pt_nda, output_size, random_seed):
277277
return pt_nda
278278

279279

280-
def augmentation_tumor_colon(pt_nda, output_size, random_seed):
280+
def augmentation_tumor_colon(pt_nda, output_size, random_seed=None):
281281
volume = pt_nda.squeeze(0)
282282
real_l_volume_ = torch.zeros_like(volume)
283283
real_l_volume_[volume == 27] = 1
@@ -335,7 +335,7 @@ def augmentation_tumor_colon(pt_nda, output_size, random_seed):
335335
return pt_nda
336336

337337

338-
def augmentation_body(pt_nda, random_seed):
338+
def augmentation_body(pt_nda, random_seed=None):
339339
volume = pt_nda.squeeze(0)
340340

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

349349

350-
def augmentation(pt_nda, output_size, random_seed):
350+
def augmentation(pt_nda, output_size, random_seed=None):
351351
label_list = torch.unique(pt_nda)
352352
label_list = list(label_list.cpu().numpy())
353353

0 commit comments

Comments
 (0)