Skip to content

Commit

Permalink
CI: Use the shutil equivalent of os.rename() and is.replace() which i…
Browse files Browse the repository at this point in the history
…s available in Python 2.7 #33
  • Loading branch information
kaspermarstal committed Oct 16, 2017
1 parent bd84820 commit 20a1318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Testing/elx_compare_landmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main():
for line in f1 :
f2.write( line.strip().split(';')[4].strip().strip( "OutputPoint = [ " ).rstrip( " ]" ) + "\n" );
f1.close(); f2.close();
os.rename( landmarkstemp, landmarks1full ); # for later inspection
shutil.rename( landmarkstemp, landmarks1full ); # for later inspection

#
# Transform the fixed image landmarks by the baseline result
Expand All @@ -95,7 +95,7 @@ def main():
for line in f1 :
f2.write( line.strip().split(';')[4].strip().strip( "OutputPoint = [ " ).rstrip( " ]" ) + "\n" );
f1.close(); f2.close();
os.rename( landmarkstemp, landmarks2full ); # for later inspection
shutil.rename( landmarkstemp, landmarks2full ); # for later inspection

# Compute the distance between all transformed landmarks
f1 = open( landmarks1, 'r' ); f2 = open( landmarks2, 'r' );
Expand Down
4 changes: 2 additions & 2 deletions Testing/elx_compare_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main():
seg_defm = os.path.join( options.directory, "segmentation_deformed.mha" );
subprocess.call( [ "transformix", "-in", options.mseg, "-out", options.directory, "-tp", tpFileName ],
stdout=subprocess.PIPE );
os.replace( seg, seg_defm );
shutil.move( seg, seg_defm );

#
# Deform the moving image segmentation by the baseline result
Expand All @@ -92,7 +92,7 @@ def main():
seg_defb = os.path.join( options.directory, "segmentation_baseline.mha" );
subprocess.call( [ "transformix", "-in", options.mseg, "-out", options.directory, "-tp", tpFileName_b ],
stdout=subprocess.PIPE );
os.replace( seg, seg_defb );
shutil.move( seg, seg_defb );

# Compute the overlap between baseline segmentation and deformed moving segmentation
try :
Expand Down

0 comments on commit 20a1318

Please sign in to comment.