/*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv Authors belong to: - University of LYON http://www.universite-lyon.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 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the copyright notices for more information. It is distributed under dual licence - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ===========================================================================**/ #ifndef clitkLists_txx #define clitkLists_txx #include "clitkLists.h" using namespace std; namespace clitk { //--------------------------------------------------------------------- // Read //--------------------------------------------------------------------- template void Lists< ListItemType>::Read(const std::vector& filenames, bool verbose) { // Make the lists this->resize(filenames.size()); // Read the lists for (unsigned int i=0; iat(i).Read(filenames[i],verbose); } //--------------------------------------------------------------------- // Norm //--------------------------------------------------------------------- template Lists > Lists::Norm(void) { Lists > norm; // Normalize the lists for (unsigned int i=0; isize();i++) norm.push_back(this->at(i).Norm()); return norm; } //--------------------------------------------------------------------- // ReadPointPairs (specific for DARS- IX point list format) //--------------------------------------------------------------------- template void Lists::ReadAndConvertPointPairs(const std::vector& fileNames, ListType& refList, const typename ImageType::Pointer referenceImage, bool verbose) { // Init this->resize(fileNames.size()); refList.resize(0); bool pointWasFound=true; unsigned int pointNumber=0; itk::ContinuousIndex item1; std::vector > item2(fileNames.size()); itk::Point point1, point2; unsigned int totalNumberOfPoints=0; std::vector addedNumberOfPoints,ommittedNumberOfPoints; std::vector pointIsUnsure(fileNames.size()); std::vector > ommittedNumberOfPointsUnsure; // Loop over the points while (pointWasFound) { if (verbose) std::cout<at(i).ReadPointPair(fileNames[i],pointNumber,item1,item2[i],veryUnsure); if (verbose && pointWasFound) std::cout<<" "<TransformContinuousIndexToPhysicalPoint(item1, point1); refList.push_back(point1); } referenceImage->TransformContinuousIndexToPhysicalPoint(item2[i], point2); if (verbose) std::cout<<"Converted items "<at(i).push_back(point2); } } } // Next point pointNumber++; } if (verbose) { std::cout< void Lists::Write(const std::vector fileNames, const bool verbose) { for (unsigned int i =0; i< fileNames.size(); i++) this->at(i).Write(fileNames[i], verbose); } } // namespace #endif