File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
nitorch/cli/registration/reslice Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ def exponentiate_transforms(transformations, **backend):
227227 prm = json .load (f )
228228 prm ['voxel_size' ] = spatial .voxel_size (trf .affine )
229229 trf .dat = spatial .shoot (trf .dat [None ], displacement = True ,
230- return_inverse = trf .inv )
230+ return_inverse = trf .inv , ** prm )
231231 if trf .inv :
232232 trf .dat = trf .dat [- 1 ]
233233 else :
Original file line number Diff line number Diff line change 1+ import os .path
2+ import json
13from . import struct
24from nitorch .core import cli
5+ from nitorch .core .pyutils import file_mod
36
47help = r"""[nitorch] Reslice volumes
58
@@ -103,8 +106,15 @@ def parse_transform(args, options):
103106
104107 cli .check_next_isvalue (args , tag )
105108 opt .file , * args = args
106- if isinstance (opt , struct .Velocity ) and cli .next_isvalue (args ):
107- opt .json , * args = args
109+ if isinstance (opt , struct .Velocity ):
110+ if cli .next_isvalue (args ):
111+ opt .json , * args = args
112+ elif os .path .exists (file_mod (opt .file , ext = '.json' )):
113+ fname = file_mod (opt .file , ext = '.json' )
114+ with open (fname , "r" ) as f :
115+ sidecar = json .load (f )
116+ if 'bending' in sidecar :
117+ opt .json = fname
108118
109119 while cli .next_istag (args ):
110120 tag , * args = args
You can’t perform that action at this time.
0 commit comments