File size: 2,497 Bytes
28e6f98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
mamba activate diffmri
cd /home/cbtil3/hao/repo/Frequency-Diffusion
# cd STEP1.AutoencoderModel2D
#git stash
git pull

datapath=/home/hao/data/medical/Brain/
# /gamedrive/Datasets/medical/Brain/

dataset=Brain
domain=BraTS-GLI-T1C    # T1C
aux_modality=T1N        # T1C, T1N, T2W, T2F
num_channels=1


# T1: T1-weighted MRI; T1c: gadolinium-contrast-enhanced T1-weighted MRI;


diffusion_type=twobranch_kspace    # Easy NaN


time_step=30
image_size=480          #128
sampling_routine=x0_step_down_fre  # x0_step_down_fre # x0_step_down_fre  # default | x0_step_down  | x0_step_down_fre
loss_type=l1   #  l2 1     # l2 | l1 | l2_l1, l1 is better


tag=new_norm   #add_blur_transformer   # x0_step_down | x0_step_down_fre

deviceid=1   # specify the GPU ids
# fre_before_attn + l1
train_bs=2     # 4 | 32 | 24 | 36


save_folder=./results/${diffusion_type}_${sampling_routine}


datapath=/home/hao/data/medical/Brain/
datapath=/gamedrive/Datasets/medical/Brain/brats/Processed/


mode=train

# Train
python  main.py --time_steps $time_step --train_steps 700000 \
            --save_folder $save_folder  --tag $tag \
            --data_path $datapath --dataset $dataset \
            --domain $domain --aux_modality $aux_modality \
            --sampling_routine $sampling_routine \
            --remove_time_embed --residual --image_size $image_size \
            --diffusion_type $diffusion_type  --train_bs $train_bs \
            --num_channels $num_channels --deviceid $deviceid \
            --kernel_std 0.15   --loss_type $loss_type   --debug  --mode  $mode   # --debug,  --discrete

# FSM Brain
/gamedrive/Datasets/medical/FrequencyDiffusion/image_100patients_4X

BraTS20_Training_099_99_t1.png
BraTS20_Training_099_99_t2.png

mode=test
checkpoint=results/52_twobranch_kspace_x0_step_down_fre_new_norm/model.pt


deviceid=1  # deviceid=1


# test
python  main.py --time_steps $time_step --train_steps 700000 \
            --save_folder $save_folder  --tag $tag \
            --data_path $datapath --dataset $dataset \
            --domain $domain --aux_modality $aux_modality \
            --sampling_routine $sampling_routine \
            --remove_time_embed --residual --image_size $image_size \
            --diffusion_type $diffusion_type  --train_bs $train_bs \
            --num_channels $num_channels --deviceid $deviceid \
            --kernel_std 0.15   --load_path $checkpoint   --debug  --mode  $mode   # --debug,  --discrete



# Knee
/gamedrive/Datasets/medical/Knee/fastMRI/