Skip to content

Commit

Permalink
Elx 34 remove testing external dependencies (#39)
Browse files Browse the repository at this point in the history
* CI: Use the shutil equivalent of os.rename() and is.replace() which is available in Python 2.7 #33

* COMP: making sure python move operations work

Also with python 2.7.

* BUG: check for file existence

* COMP: copy paste error

* CI: Compile all components on AppVeyor

* CI: Touching appveyor.yml to trigger rebuild

* CI: Build ITK and elastix separately on AppVeyor to avoid build time limit

* CI: Fix AppVeyor script

* CI: Fix AppVeyor cache stamp
  • Loading branch information
mstaring committed Jan 3, 2018
1 parent 6472fc8 commit 2577adc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Testing/elx_compare_landmarks.py
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.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();
os.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
7 changes: 5 additions & 2 deletions Testing/elx_compare_overlap.py
@@ -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,7 +72,8 @@ 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 );
if( os.path.exists( seg_defm ) ) : os.remove( seg_defm );
shutil.move( seg, seg_defm );

#
# Deform the moving image segmentation by the baseline result
Expand All @@ -92,7 +94,8 @@ 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 );
if( os.path.exists( seg_defb ) ) : os.remove( seg_defb );
shutil.move( seg, seg_defb );

# Compute the overlap between baseline segmentation and deformed moving segmentation
try :
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Expand Up @@ -16,10 +16,12 @@ environment:
ITK_URL: https://github.com/InsightSoftwareConsortium/ITK
ITK_SOURCE_DIR: c:\ITK-source
ITK_BUILD_DIR: c:\ITK-build
ITK_BUILD_CACHE_STAMP: c:\BUILT_ITK
cache:
- '%ITK_SOURCE_DIR%'
- '%ITK_BUILD_DIR%'
build_script:
- cmd: if not exist %ITK_SOURCE_DIR% git clone %ITK_URL% %ITK_SOURCE_DIR% && cd %ITK_SOURCE_DIR% && git checkout v4.11.1
- cmd: if not exist %ITK_BUILD_DIR% mkdir -p %ITK_BUILD_DIR% && cd %ITK_BUILD_DIR% && cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING:BOOL=OFF -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF -DITKGroup_IO:BOOL=ON -DModule_ITKDistanceMap:BOOL=ON -DModule_ITKImageFusion:BOOL=ON -DModule_ITKLabelMap:BOOL:=ON -DModule_ITKMathematicalMorphology:BOOL=ON -DModule_ITKOptimizers:BOOL=ON -DModule_ITKOptimizersv4:BOOL=ON -DModule_ITKRegistrationCommon:BOOL=ON -DModule_ITKVideoIO:BOOL=ON-DCMAKE_BUILD_TYPE=Release %ITK_SOURCE_DIR% && cmake --build . --config Release -- /m
- cmd: mkdir -p %ELASTIX_BUILD_DIR% && cd %ELASTIX_BUILD_DIR% && cmake -DITK_DIR=%ITK_BUILD_DIR% -DCMAKE_BUILD_TYPE=Release %ELASTIX_SOURCE_DIR% && cmake --build . --config Release -- /m && ctest -j4 -VV -C Release || true
- cmd: if not exist %ITK_BUILD_DIR% mkdir -p %ITK_BUILD_DIR% && cd %ITK_BUILD_DIR% && cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING:BOOL=OFF -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF -DITKGroup_IO:BOOL=ON -DModule_ITKDistanceMap:BOOL=ON -DModule_ITKImageFusion:BOOL=ON -DModule_ITKLabelMap:BOOL:=ON -DModule_ITKMathematicalMorphology:BOOL=ON -DModule_ITKOptimizers:BOOL=ON -DModule_ITKOptimizersv4:BOOL=ON -DModule_ITKRegistrationCommon:BOOL=ON -DModule_ITKVideoIO:BOOL=ON-DCMAKE_BUILD_TYPE=Release %ITK_SOURCE_DIR% && cmake --build . --config Release -- /m && @echo BUILT_ITK > %ITK_BUILD_CACHE_STAMP%
- cmd: if not exist %ITK_BUILD_CACHE_STAMP% mkdir -p %ELASTIX_BUILD_DIR% && cd %ELASTIX_BUILD_DIR% && cmake -DUSE_ALL_COMPONENTS=ON -DITK_DIR=%ITK_BUILD_DIR% -DCMAKE_BUILD_TYPE=Release %ELASTIX_SOURCE_DIR% && cmake --build . --config Release -- /m && ctest -j4 -VV -C Release || true

0 comments on commit 2577adc

Please sign in to comment.