Skip to content

Commit

Permalink
COMP: making sure python move operations work
Browse files Browse the repository at this point in the history
Also with python 2.7.
  • Loading branch information
mstaring committed Oct 17, 2017
1 parent 20a1318 commit d34e7f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 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();
shutil.rename( landmarkstemp, landmarks1full ); # for later inspection
shutil.move( 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();
shutil.rename( landmarkstemp, landmarks2full ); # for later inspection
shutil.move( landmarkstemp, landmarks2full ); # for later inspection

# Compute the distance between all transformed landmarks
f1 = open( landmarks1, 'r' ); f2 = open( landmarks2, 'r' );
Expand Down
3 changes: 3 additions & 0 deletions Testing/elx_compare_overlap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys, subprocess
import os
import os.path
import shutil
import re
import glob
from optparse import OptionParser
Expand Down Expand Up @@ -71,6 +72,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.remove( seg_defm );
shutil.move( seg, seg_defm );

#
Expand All @@ -92,6 +94,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.remove( seg_defb );
shutil.move( seg, seg_defb );

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

0 comments on commit d34e7f9

Please sign in to comment.