- for (int i=0;i<static_cast<int>(n_thread);i++)
- {
- ///Static scheduling
- int remainder_shift=((i<remainder)?i:remainder);
- unsigned int start_image=i*reg_per_thread+remainder_shift;
- unsigned int end_image=((i+1)*reg_per_thread+remainder_shift+((i<remainder)?1:0));
- if (end_image<=refimage)
- partial_run(start_image,end_image,refimage,ref_file);
- else if (start_image<=refimage)
- partial_run(start_image,end_image+1,refimage,ref_file);
- else
- partial_run(start_image+1,end_image+1,refimage,ref_file);
- }
- if (aborted)
- {
- cleanup(images.size());
- return;
- }
- command.str("");
- int computed_vf=(refimage==0)?1:0; //index of an image that isn't the reference image
- 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());
- command.str("");
- command << "clitkVFMerge ";
- for (unsigned int i=0;i<images.size();i++) command << temp_dir << "/deformation_" << i << ".vf ";
- command << " --xorigin " << images[0]->GetOrigin()[0];
- command << " --yorigin " << images[0]->GetOrigin()[1];
- command << " --zorigin " << images[0]->GetOrigin()[2];
- command << " -o " << output_filename << std::endl;
- DD(command.str());
- std::system(command.str().c_str());
+ for (int i=0; i<static_cast<int>(n_thread); i++) {
+ ///Static scheduling
+ int remainder_shift=((i<remainder)?i:remainder);
+ unsigned int start_image=i*reg_per_thread+remainder_shift;
+ unsigned int end_image=((i+1)*reg_per_thread+remainder_shift+((i<remainder)?1:0));
+ if (end_image<=refimage)
+ partial_run(start_image,end_image,refimage,ref_file);
+ else if (start_image<=refimage)
+ partial_run(start_image,end_image+1,refimage,ref_file);
+ else
+ partial_run(start_image+1,end_image+1,refimage,ref_file);
+ }
+ if (aborted) {