Skip to content

Commit 4e87d7f

Browse files
committed
STYLE: Remove unused CLI mangling code
1 parent 78dad33 commit 4e87d7f

File tree

2 files changed

+16
-34
lines changed

2 files changed

+16
-34
lines changed

ants/registration/apply_transforms.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,6 @@ def apply_transforms(fixed, moving, transformlist,
161161

162162
myargs = utils._int_antsProcessArguments(args)
163163

164-
# NO CLUE WHAT THIS DOES OR WHY IT'S NEEDED
165-
for jj in range(len(myargs)):
166-
if myargs[jj] is not None:
167-
if myargs[jj] == '-':
168-
myargs2 = [None]*(len(myargs)-1)
169-
myargs2[:(jj-1)] = myargs[:(jj-1)]
170-
myargs2[jj:(len(myargs)-1)] = myargs[(jj+1):(len(myargs))]
171-
myargs = myargs2
172-
173164
myverb = int(verbose)
174165
if verbose:
175166
print(myargs)

ants/registration/resample_image.py

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
33

44
__all__ = ['resample_image',
55
'resample_image_to_target']
@@ -11,7 +11,7 @@
1111

1212
def resample_image(image, resample_params, use_voxels=False, interp_type=1):
1313
"""
14-
Resample image by spacing or number of voxels with
14+
Resample image by spacing or number of voxels with
1515
various interpolators. Works with multi-channel images.
1616
1717
ANTsR function: `resampleImage`
@@ -20,14 +20,14 @@ def resample_image(image, resample_params, use_voxels=False, interp_type=1):
2020
---------
2121
image : ANTsImage
2222
input image
23-
23+
2424
resample_params : tuple/list
2525
vector of size dimension with numeric values
26-
26+
2727
use_voxels : boolean
2828
True means interpret resample params as voxel counts
29-
30-
interp_type : integer
29+
30+
interp_type : integer
3131
one of 0 (linear), 1 (nearest neighbor), 2 (gaussian), 3 (windowed sinc), 4 (bspline)
3232
3333
Returns
@@ -58,20 +58,20 @@ def resample_image(image, resample_params, use_voxels=False, interp_type=1):
5858

5959
def resample_image_to_target(image, target, interp_type='linear', imagetype=0, verbose=False, **kwargs):
6060
"""
61-
Resample image by using another image as target reference.
62-
This function uses ants.apply_transform with an identity matrix
61+
Resample image by using another image as target reference.
62+
This function uses ants.apply_transform with an identity matrix
6363
to achieve proper resampling.
64-
64+
6565
ANTsR function: `resampleImageToTarget`
6666
6767
Arguments
6868
---------
6969
image : ANTsImage
7070
image to resample
71-
71+
7272
target : ANTsImage
7373
image of reference, the output will be in this space
74-
74+
7575
interp_type : string
7676
Choice of interpolator. Supports partial matching.
7777
linear
@@ -84,16 +84,16 @@ def resample_image_to_target(image, target, interp_type='linear', imagetype=0, v
8484
hammingWindowedSinc
8585
lanczosWindowedSinc
8686
genericLabel use this for label images
87-
88-
imagetype : integer
87+
88+
imagetype : integer
8989
choose 0/1/2/3 mapping to scalar/vector/tensor/time-series
90-
90+
9191
verbose : boolean
9292
print command and run verbose application of transform.
93-
93+
9494
kwargs : keyword arguments
9595
additional arugment passed to antsApplyTransforms C code
96-
96+
9797
Returns
9898
-------
9999
ANTsImage
@@ -145,15 +145,6 @@ def resample_image_to_target(image, target, interp_type='linear', imagetype=0, v
145145

146146
myargs = utils._int_antsProcessArguments(args)
147147

148-
# NO CLUE WHAT THIS DOES OR WHY IT'S NEEDED
149-
for jj in range(len(myargs)):
150-
if myargs[jj] is not None:
151-
if myargs[jj] == '-':
152-
myargs2 = [None]*(len(myargs)-1)
153-
myargs2[:(jj-1)] = myargs[:(jj-1)]
154-
myargs2[jj:(len(myargs)-1)] = myargs[(jj+1):(len(myargs))]
155-
myargs = myargs2
156-
157148
myverb = int(verbose)
158149

159150
processed_args = myargs + ['-z', str(1), '-v', str(myverb), '--float', str(1), '-e', str(imagetype)]

0 commit comments

Comments
 (0)