Skip to content

Commit e386513

Browse files
authored
Merge pull request #37 from HiLab-git/dev
Dev
2 parents 78c1460 + ea8d405 commit e386513

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+936
-333
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ BibTeX entry:
1515
author = {Guotai Wang and Xiangde Luo and Ran Gu and Shuojue Yang and Yijie Qu and Shuwei Zhai and Qianfei Zhao and Kang Li and Shaoting Zhang},
1616
title = {{PyMIC: A deep learning toolkit for annotation-efficient medical image segmentation}},
1717
year = {2023},
18-
url = {http://arxiv.org/abs/2208.09350},
18+
url = {https://doi.org/10.1016/j.cmpb.2023.107398},
1919
journal = {Computer Methods and Programs in Biomedicine},
20-
volume = {February},
20+
volume = {231},
2121
pages = {107398},
2222
}
2323

2424
# Features
2525
PyMIC provides flixible modules for medical image computing tasks including classification and segmentation. It currently provides the following functions:
26-
* Support for annotation-efficient image segmentation, especially for semi-supervised, weakly-supervised and noisy-label learning.
26+
* Support for annotation-efficient image segmentation, especially for semi-supervised, self-supervised, weakly-supervised and noisy-label learning.
2727
* User friendly: For beginners, you only need to edit the configuration files for model training and inference, without writing code. For advanced users, you can customize different modules (networks, loss functions, training pipeline, etc) and easily integrate them into PyMIC.
2828
* Easy-to-use I/O interface to read and write different 2D and 3D images.
2929
* Various data pre-processing/transformation methods before sending a tensor into a network.
@@ -47,10 +47,10 @@ Run the following command to install the latest released version of PyMIC:
4747
```bash
4848
pip install PYMIC
4949
```
50-
To install a specific version of PYMIC such as 0.3.1, run:
50+
To install a specific version of PYMIC such as 0.4.0, run:
5151

5252
```bash
53-
pip install PYMIC==0.3.1
53+
pip install PYMIC==0.4.0
5454
```
5555
Alternatively, you can download the source code for the latest version. Run the following command to compile and install:
5656

pymic/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
__version__ = "0.4.0"

pymic/io/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from __future__ import absolute_import
2+
from pymic.io.image_read_write import *
3+
from pymic.io.nifty_dataset import *
4+
from pymic.io.h5_dataset import *

pymic/layer/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/loss/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/loss/cls/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/loss/seg/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/net/cls/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/net/net2d/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import absolute_import
2+
from . import *

pymic/net/net2d/unet2d.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class UNet2D(nn.Module):
187187
:param class_num: (int) The class number for segmentation task.
188188
:param bilinear: (bool) Using bilinear for up-sampling or not.
189189
If False, deconvolution will be used for up-sampling.
190-
:param deep_supervise: (bool) Using deep supervision for training or not.
190+
:param multiscale_pred: (bool) Get multiscale prediction.
191191
"""
192192
def __init__(self, params):
193193
super(UNet2D, self).__init__()
@@ -197,7 +197,7 @@ def __init__(self, params):
197197
self.dropout = self.params['dropout']
198198
self.n_class = self.params['class_num']
199199
self.bilinear = self.params['bilinear']
200-
self.deep_sup = self.params['deep_supervise']
200+
self.mul_pred = self.params['multiscale_pred']
201201

202202
assert(len(self.ft_chns) == 5 or len(self.ft_chns) == 4)
203203

@@ -213,7 +213,7 @@ def __init__(self, params):
213213
self.up4 = UpBlock(self.ft_chns[1], self.ft_chns[0], self.ft_chns[0], self.dropout[0], self.bilinear)
214214

215215
self.out_conv = nn.Conv2d(self.ft_chns[0], self.n_class, kernel_size = 1)
216-
if(self.deep_sup):
216+
if(self.mul_pred):
217217
self.out_conv1 = nn.Conv2d(self.ft_chns[1], self.n_class, kernel_size = 1)
218218
self.out_conv2 = nn.Conv2d(self.ft_chns[2], self.n_class, kernel_size = 1)
219219
self.out_conv3 = nn.Conv2d(self.ft_chns[3], self.n_class, kernel_size = 1)
@@ -239,7 +239,7 @@ def forward(self, x):
239239
x_d1 = self.up3(x_d2, x1)
240240
x_d0 = self.up4(x_d1, x0)
241241
output = self.out_conv(x_d0)
242-
if(self.deep_sup):
242+
if(self.mul_pred):
243243
output1 = self.out_conv1(x_d1)
244244
output2 = self.out_conv2(x_d2)
245245
output3 = self.out_conv3(x_d3)
@@ -261,7 +261,8 @@ def forward(self, x):
261261
'feature_chns':[2, 8, 32, 48, 64],
262262
'dropout': [0, 0, 0.3, 0.4, 0.5],
263263
'class_num': 2,
264-
'bilinear': True}
264+
'bilinear': True,
265+
'multiscale_pred': False}
265266
Net = UNet2D(params)
266267
Net = Net.double()
267268

0 commit comments

Comments
 (0)