20120131 - ANTS: Advanced Normalization ToolS
Try out ANTS Tool
A. Build
A.1. Error
Following instructions from http://picsl.upenn.edu/ANTS/download.php
2012 02 02: svn update -r r1106 ( Revision 1107 is broken. )
CMake magic does not work for now.
CMake Magic
Hi Regina,
You need to update as I'm currently testing on a 5-modality
3-D data set and I discovered that the rigid initialization
wasn't being performed properly in the ants multivariate
template building script.
Regarding $ANTSPATH---it should point to your build directory.
The cmake magic should copy all your scripts to the build
directory and that's where all your executables should
reside (at least that is the intent). If not, then something
unexpected happened.
Nick
A.2. Temporary solution
CMAKE Magic?
Don't we need to set CMAKE_INSTALL_PREFIX properly?
MESSAGE("CMAKE_INSTALL_PREFIX::: ${CMAKE_INSTALL_PREFIX}") install(PROGRAMS ../Scripts/ants.sh ../Scripts/basic_ants_example.sh ../Scripts/antsIntroduction.sh ../Scripts/antsaffine.sh ../Scripts/waitForXGridJobs.pl ../Scripts/ANTSAverage2DAffine.sh ../Scripts/ANTSAverage3DAffine.sh ../Scripts/buildtemplateparallel.sh ../Scripts/ANTSpexec.sh ../Scripts/waitForSGEQJobs.pl DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE CONFIGURATIONS Release )
[eunyokim@wundt build]$ make
[ 47%] Built target ITKv4
[ 47%] Performing forcebuild step for 'ANTS'
[ 47%] Performing build step for 'ANTS'
CMAKE_INSTALL_PREFIX::: /usr/local
-- Configuring done
-- Generating done
[eunyokim@wundt build]$ find ../ANTS/ -type f -print |xargs grep -n "CMAKE_INSTALL_PREFIX"
../ANTS//CMake/PreventInBuildInstalls.cmake:2:string(TOLOWER "${CMAKE_INSTALL_PREFIX}" _PREFIX)
../ANTS//CMake/PreventInBuildInstalls.cmake:6: "The current CMAKE_INSTALL_PREFIX points at the build tree:\n"
../ANTS//CMake/PreventInBuildInstalls.cmake:7: " ${CMAKE_INSTALL_PREFIX}\n"
../ANTS//Examples/CMakeLists.txt:320:MESSAGE("CMAKE_INSTALL_PREFIX::: ${CMAKE_INSTALL_PREFIX}")
../ANTS//SuperBuild.cmake:154: CMAKE_INSTALL_PREFIX:PATH
../ANTS//SuperBuild/External_KWStyle.cmake:39: -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/Utils
/opt/cmake-2.8.6-Darwin64-universal/bin/cmake ../ANTS/ -DCMAKE_INSTALL_PREFIX:PATH=/ipldev/scratch/eunyokim/src/ANTSFromGitHub/build/bin [eunyokim@wundt build]$ make [ 47%] Built target ITKv4 [ 47%] Performing forcebuild step for 'ANTS' [ 47%] Performing build step for 'ANTS' CMAKE_INSTALL_PREFIX::: /ipldev/scratch/eunyokim/src/ANTSFromGitHub/build/bin -- Configuring done -- Generating done [eunyokim@wundt build]$ ls bin/ ANTS* LabelOverlapMeasures* ANTSIntegrateVectorField* LaplacianThickness* ANTSIntegrateVelocityField* MeasureImageSimilarity* ANTSJacobian* MeasureMinMaxMean* ANTSUseDeformationFieldToGetAffineTransform* MemoryTest* ANTSUseLandmarkImagesToGetAffineTransform* MultiplyImages* Atropos* N3BiasFieldCorrection* AtroposMin* N4BiasFieldCorrection* AverageAffineTransform* PasteImageIntoImage* AverageImages* PermuteFlipImageOrientationAxes* AverageTensorImages* PrintHeader* ClusterImageStatistics* ReorientTensorImage* ComposeMultiTransform* ResampleImage* ConvertImagePixelType* ResampleImageBySpacing* ConvertScalarImageToRGB* ResetDirection* ConvertToJpg* SetDirectionByMatrix* CopyImageHeaderInformation* SetOrigin* CreateDTICohort* SetSpacing* CreateImage* SmoothImage* CreateWarpedGridImage* StackSlices* ExtractRegionFromImage* SurfaceBasedSmoothing* ExtractRegionFromImageByMask* SurfaceCurvature* ExtractSliceFromImage* ThresholdImage* H5detect* TileImages* H5make_libsettings* WarpImageMultiTransform* ImageCompare* WarpTensorImageMultiTransform* ImageMath* WarpTimeSeriesImageMultiTransform* ImageSetStatistics* antsApplyTransforms* KellyKapowski* antsMotionCorr* KellySlater* antsRegistration* LabelClustersUniquely* itkTestDriver* LabelGeometryMeasures* sccan*
export ANTSScriptPATH=/ipldev/scratch/eunyokim/src/ANTSFromGitHub/ANTS/Scripts/
PEXEC=${ANTSScriptPATH}ANTSpexec.sh SGE=${ANTSScriptPATH}waitForSGEQJobs.pl PBS=${ANTSScriptPATH}waitForPBSQJobs.pl XGRID=${ANTSScriptPATH}waitForXGridJobs.pl
B. Testing with five subjects
bash -x /ipldev/scratch/eunyokim/src/ANTSFromGitHub/ANTS/Scripts/antsMultivariateTemplateConstruction.sh -d 3 -c 0 -k 2 -o ./ANTSOut -z /ipldev/scratch/eunyokim/src/BRAINS20111028/build-Darwin/ReferenceAtlas-build/Atlas/Atlas_20120104/template_t1.nii.gz /ipldev/scratch/eunyokim/src/ANTS/trial/fiveSubjectOnly.csv 2>&1|tee result.log
The above script is running (Started on Friday 10th Feb)
Wierd 1. The script is deleting the csv file I provided. ( rm -f ${IMAGESETVARIABLE} ). The script delete only when the script failed. yeat, that's weird too.
Wierd 2. The same script in different location DOES NOT WORK.
It looks like -d, -c, -z options are mendatory not optional
fiveSubjectsTest.csv:::
/paulsen/IPIG/predict_3T_MR/site-054/0284/20715/10_AUTO.NN3Tv20110418/20715_AVG_T1.nii.gz,/paulsen/IPIG/predict_3T_MR/site-054/0284/20715/10_AUTO.NN3Tv20110418/20715_AVG_T2.nii.gz
/paulsen/IPIG/predict_3T_MR/site-024/0644/84123/10_AUTO.NN3Tv20110418/84123_AVG_T1.nii.gz,/paulsen/IPIG/predict_3T_MR/site-024/0644/84123/10_AUTO.NN3Tv20110418/84123_AVG_T2.nii.gz
/paulsen/IPIG/predict_3T_MR/site-024/0326/10335/10_AUTO.NN3Tv20110418/10335_AVG_T1.nii.gz,/paulsen/IPIG/predict_3T_MR/site-024/0326/10335/10_AUTO.NN3Tv20110418/10335_AVG_T2.nii.gz
/paulsen/IPIG/predict_3T_MR/site-024/0241/37022/10_AUTO.NN3Tv20110418/37022_AVG_T1.nii.gz,/paulsen/IPIG/predict_3T_MR/site-024/0241/37022/10_AUTO.NN3Tv20110418/37022_AVG_T2.nii.gz
/paulsen/IPIG/predict_3T_MR/site-024/0652/23958/10_AUTO.NN3Tv20110418/23958_AVG_T1.nii.gz,/paulsen/IPIG/predict_3T_MR/site-024/0652/23958/10_AUTO.NN3Tv20110418/23958_AVG_T2.nii.gz
Results: Four Iterations pdf
C. Testing with 30 subjects
The relative path would NOT work: Giving un-related error.
Specifying 12 core to use will KILL your machine. Don't do it.
bash -x /ipldev/scratch/eunyokim/src/ANTSFromGitHub/ANTS/Scripts/antsMultivariateTemplateConstruction.sh -d 3 -c 2 -j 4 -k 2 -o ./ANTS -z /ipldev/scratch/eunyokim/src/BRAINS20111028/build-Darwin/ReferenceAtlas-build/Atlas/Atlas_20120104/templa_t1.nii.gz /hjohnson/HDNI/PREDICT_TRAINING/regina_ann/TrainingModels/ANTSTrails/30Subjects/30Subjects.csv 2>&1|tee logInTheBuild.txt
ANTS trial result with 30 subjects:
What do you think?!