Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb1cca4

Browse files
[refactor] Remove __all__ from module headings for everything but vxm.functional
1 parentb96f1b2 commitbb1cca4

File tree

6 files changed

+18
-47
lines changed

6 files changed

+18
-47
lines changed

‎voxelmorph/functional.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
importtorch
88

99
importneuriteasne
10-
importneurite.nn.functionalasnef
1110

1211
__all__= [
1312
'affine_to_disp',

‎voxelmorph/nn/functional.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212
# Local imports
1313
importvoxelmorphasvxm
1414

15-
__all__= [
16-
"spatial_transform",
17-
"disp_to_coords",
18-
"coords_to_disp",
19-
"integrate_disp",
20-
"compose",
21-
"random_disp",
22-
"random_transform",
23-
]
24-
2515

2616
defspatial_transform(
2717
image:torch.Tensor,

‎voxelmorph/nn/losses.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
importtorch.nn.functionalasF
1111
importnumpyasnp
1212

13-
__all__= [
14-
"NCC",
15-
"MSE",
16-
"Dice",
17-
"Grad",
18-
]
19-
2013

2114
classNCC:
2215
"""

‎voxelmorph/nn/models.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
# Local imports
1414
importvoxelmorphasvxm
1515

16-
__all__= [
17-
"VxmPairwise",
18-
]
19-
2016

2117
classVxmPairwise(nn.Module):
2218
"""

‎voxelmorph/nn/modules.py‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
# Standard library imports
6-
fromcollections.abcimportSequence
76
fromtypingimportUnion,Optional
87

98
# Third-party imports
@@ -15,12 +14,6 @@
1514
importneuriteasne
1615
importvoxelmorphasvxm
1716

18-
__all__= [
19-
"SpatialTransformer",
20-
"IntegrateVelocityField",
21-
"ResizeDisplacementField",
22-
]
23-
2417

2518
classSpatialTransformer(nn.Module):
2619
"""
@@ -185,8 +178,7 @@ def __init__(
185178

186179
super().__init__()
187180

188-
ifsteps<0:
189-
raiseValueError(f"steps should be >= 0, found:{steps}")
181+
assertsteps>=0,f"steps must be >= 0, got{steps}"
190182

191183
self.steps=steps
192184
self.scale=1.0/ (2**self.steps)# Initial downscaling factor

‎voxelmorph/py/generators.py‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@
1212
# Custom imports
1313
importvoxelmorphasvxm
1414

15-
__all__= [
16-
'volgen',
17-
'scan_to_scan',
18-
'scan_to_atlas',
19-
'semisupervised',
20-
'template_creation',
21-
'conditional_template_creation',
22-
'surf_semisupervised',
23-
'synthmorph'
24-
]
25-
2615

2716
defvolgen(
2817
vol_names,
@@ -186,10 +175,18 @@ def split_seg(seg):
186175

187176
# cache target vols and segs if atlas is supplied
188177
ifatlas_file:
189-
trg_vol=vxm.py.utils.load_volfile(atlas_file,np_var='vol',
190-
add_batch_axis=True,add_feat_axis=True)
191-
trg_seg=vxm.py.utils.load_volfile(atlas_file,np_var='seg',
192-
add_batch_axis=True,add_feat_axis=True)
178+
trg_vol=vxm.py.utils.load_volfile(
179+
atlas_file,
180+
np_var='vol',
181+
add_batch_axis=True,
182+
add_feat_axis=True
183+
)
184+
trg_seg=vxm.py.utils.load_volfile(
185+
atlas_file,
186+
np_var='seg',
187+
add_batch_axis=True,
188+
add_feat_axis=True
189+
)
193190
trg_seg=split_seg(trg_seg)
194191

195192
whileTrue:
@@ -353,7 +350,11 @@ def surf_semisupervised(
353350
# pre-compute the atlas surface points
354351
atlas_surface_pts=np.zeros((batch_size,nb_surface_pts,len(vol_shape)+1))
355352
ifnb_labels_sample==len(labels):
356-
nb_surface_pts_sel=vxm.py.utils.get_surface_pts_per_label(nb_surface_pts,layer_edge_ratios)
353+
nb_surface_pts_sel=vxm.py.utils.get_surface_pts_per_label(
354+
nb_surface_pts,
355+
layer_edge_ratios
356+
)
357+
357358
forli,labelinenumerate(labels):# if only one label, get surface points here
358359
atlas_surface_pts_=std_to_surf(atlas_sdt[li],nb_surface_pts_sel[li])[np.newaxis, ...]
359360
# get the surface point stack indexes for this element

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp