@@ -204,6 +204,28 @@ In addition, provide any templates created during FA TBSS. On the other hand, sp
204204 raise AttributeError ('--skeletonMask and/or --skeletonMaskDst is invalid w/o --skeleton' )
205205
206206
207+ # take absolute path for everything
208+ if args .caselist :
209+ args .caselist = abspath (args .caselist )
210+ if args .template :
211+ args .template = abspath (args .template )
212+ if args .templateMask :
213+ args .templateMask = abspath (args .templateMask )
214+ if args .skeleton :
215+ args .skeleton = abspath (args .skeleton )
216+ if args .skeletonMask :
217+ args .skeletonMask = abspath (args .skeletonMask )
218+ if args .skeletonMaskDst :
219+ args .skeletonMaskDst = abspath (args .skeletonMaskDst )
220+ if args .space :
221+ args .space = abspath (args .space )
222+ if args .labelMap :
223+ args .labelMap = abspath (args .labelMap )
224+ if args .lut :
225+ args .lut = abspath (args .lut )
226+ if args .SEARCH_RULE_MASK :
227+ args .SEARCH_RULE_MASK = abspath (args .SEARCH_RULE_MASK )
228+
207229 if args .studyTemplate :
208230 # clear all template arguments
209231 print ('--study template specified, overriding any provided templates' )
@@ -247,23 +269,23 @@ In addition, provide any templates created during FA TBSS. On the other hand, sp
247269 chdir (statsDir )
248270
249271 # just copy template
250- if args .template :
272+ if args .template and not isfile ( args . template ) :
251273 check_call (f'cp { args .template } .' , shell = True )
252274
253275 # softlink the rest
254- if args .templateMask :
276+ if args .templateMask and not isfile ( args . templateMask ) :
255277 check_call (f'cp { args .templateMask } .' , shell = True )
256278 check_call (f'ln -s { basename (args .templateMask )} mean_FA_mask.nii.gz' , shell = True )
257279
258- if args .skeleton :
280+ if args .skeleton and not isfile ( args . skeleton ) :
259281 check_call (f'cp { args .skeleton } .' , shell = True )
260282 check_call (f'ln -s { basename (args .skeleton )} mean_FA_skeleton.nii.gz' , shell = True )
261283
262- if args .skeletonMask :
284+ if args .skeletonMask and not isfile ( args . skeletonMask ) :
263285 check_call (f'cp { args .skeletonMask } .' , shell = True )
264286 check_call (f'ln -s { basename (args .skeletonMask )} mean_FA_skeleton_mask.nii.gz' , shell = True )
265287
266- if args .skeletonMaskDst :
288+ if args .skeletonMaskDst and not isfile ( args . skeletonMaskDst ) :
267289 check_call (f'cp { args .skeletonMaskDst } .' , shell = True )
268290 check_call (f'ln -s { basename (args .skeletonMaskDst )} mean_FA_skeleton_mask_dst.nii.gz' , shell = True )
269291
@@ -349,7 +371,7 @@ In addition, provide any templates created during FA TBSS. On the other hand, sp
349371 # the following generates a warning since dirs are already created in Ln:247-249
350372 makeDirectory (measureDir , args .force )
351373
352- dwImgs , masks = read_imgs_masks (args .input )
374+ dwImgs , masks = read_imgs_masks (abspath ( args .input ) )
353375 if not args .caselist :
354376 # generate caselist
355377 args .caselist , cases = write_caselist (args .logDir , List = dwImgs )
@@ -369,7 +391,7 @@ In addition, provide any templates created during FA TBSS. On the other hand, sp
369391
370392 # when input is a modality image list
371393 elif isfile (args .input ):
372- allModImgs = read_imgs (args .input , num_modalities )
394+ allModImgs = read_imgs (abspath ( args .input ) , num_modalities )
373395 if not args .caselist :
374396 # generate caselist
375397 args .caselist , cases = write_caselist (args .logDir , List = allModImgs )
0 commit comments