#!/usr/bin/env ruby


system("echo Running Testing Hammer Module ... ");
system("rm *warped*");

#copy the scripts
system("cp ../scripts/performlabeling.pl /home/andresmf/ProgramFiles/hammer/bin/performlabeling_dev.pl");
#system("cp ../scripts/linearlyregisterbyfsl.sh /home/andresmf/ProgramFiles/hammer/bin/linearlyregisterbyfsl_dev.sh");
system("cp ../scripts/templinearlyregisterbyfsl.rb /home/andresmf/ProgramFiles/hammer/bin/templinearlyregisterbyfsl_dev.rb");
#copy the binaries for labeling script
system("cp ../bin/hammer /home/andresmf/ProgramFiles/hammer/bin/hammer_dev");
system("cp ../bin/cropslices /home/andresmf/ProgramFiles/hammer/bin/cropslices_dev");
system("cp ../bin/splitfile /home/andresmf/ProgramFiles/hammer/bin/splitfile_dev");
system("cp ../bin/transform3dvectorfield /home/andresmf/ProgramFiles/hammer/bin/transform3dvectorfield_dev");
system("cp ../bin/performdeformationusingvectorfield /home/andresmf/ProgramFiles/hammer/bin/performdeformationusingvectorfield_dev");
#copy the binaries for the registrtion by fsl script
system("cp ../bin/transform3dimg /home/andresmf/ProgramFiles/hammer/bin/transform3dimg_dev");
system("cp ../bin/getfilesize /home/andresmf/ProgramFiles/hammer/bin/getfilesize_dev");
system("cp ../bin/makeheader /home/andresmf/ProgramFiles/hammer/bin/makeheader_dev");
system("cp ../bin/fslmat2mymat /home/andresmf/ProgramFiles/hammer/bin/fslmat2mymat_dev");

system("echo Attempting to start the labeling process ... ");
system("performlabeling_dev.pl -S subject1_preprocessed.img -d subject1_warped -M /home/andresmf/ProgramFiles/hammer/models/jakob_rad_convention_segmented.img -L /home/andresmf/ProgramFiles/hammer/models/jakob_rad_convention_labels_nocere.img -X256,256,110 -x256,256,198 -V0.9375,0.9375,1.5 -v1.0,1.0,1.0 -i10 -R0.05 -r12,10,8 -m0.06");

system("echo Checking  the results ... ");
system("md5sum subject1_warped.Field.1.img.Subj2Mdl");
system("md5sum subject1_warped.Warped.Labels.trans");
system("md5sum subject1_warped.Warped.MdlSeg.img");

#system("echo The results are ok ... ");
#system("echo The results differ from current distribution ... ");
