X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvDeformableRegistration.cxx;h=980b3e7d1f86633811d1f8afe08ce93a5214f199;hb=7d4e77191e55f668f316ba3ddf0fddb63e59bd25;hp=a4d36f1e63876a2cb6dc45daff869d906a222542;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/vv/vvDeformableRegistration.cxx b/vv/vvDeformableRegistration.cxx index a4d36f1..980b3e7 100644 --- a/vv/vvDeformableRegistration.cxx +++ b/vv/vvDeformableRegistration.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #include #include #include @@ -27,6 +27,7 @@ #include "vtkVOXImageWriter.h" #include +#include #include "clitkCommon.h" #include "vvSlicerManager.h" @@ -53,8 +54,8 @@ vvDeformableRegistration::vvDeformableRegistration(vvImage::Pointer image,unsign void vvDeformableRegistration::abort() { aborted=true; - std::system("killall deformableregistration"); - std::system("killall clitkVFMerge"); + int tempReturn = std::system("killall deformableregistration"); + tempReturn = std::system("killall clitkVFMerge"); } unsigned int vvDeformableRegistration::getProgress() @@ -70,16 +71,16 @@ void vvDeformableRegistration::cleanup(int frame_number) //remove temporary file for (int i=0; iSetInput(images[i]); +#else + vox->SetInputData(images[i]); +#endif vox->SetFileName(filename.str().c_str()); if (i==refimage) ref_file=filename.str(); @@ -165,7 +170,7 @@ void vvDeformableRegistration::run() command << "clitkZeroVF -i " << temp_dir << "/deformation_" << computed_vf << ".vf -o " << temp_dir << "/deformation_" << refimage << ".vf"; DD(command.str()); //create zero VF for the ref image - std::system(command.str().c_str()); + int tempReturn = std::system(command.str().c_str()); command.str(""); command << "clitkVFMerge "; for (unsigned int i=0; iGetOrigin()[2]; command << " -o " << output_filename << std::endl; DD(command.str()); - std::system(command.str().c_str()); + tempReturn = std::system(command.str().c_str()); cleanup(images.size()); if (aborted) { - std::system(("rm " + output_filename).c_str()); + tempReturn = std::system(("rm " + output_filename).c_str()); return; } - vvImageReader reader; - reader.SetInputFilename(output_filename); - reader.Update(VECTORFIELD); + vvImageReader::Pointer reader = vvImageReader::New(); + reader->SetInputFilename(output_filename); + reader->Update(vvImageReader::VECTORFIELD); finish=clock(); DD((finish - start)/static_cast(CLOCKS_PER_SEC)); - mOutput=reader.GetOutput(); + mOutput = reader->GetOutput(); }