X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkDicomRTStruct2BinaryImage.cxx;fp=tools%2FclitkDicomRTStruct2BinaryImage.cxx;h=0000000000000000000000000000000000000000;hb=d90dd976c7ddbc78a397575f049a49a47cb031bb;hp=97eff971d4fb4b26f923d1a56357cc1424cbceb4;hpb=1717ab8852c9f77367e46eed770cb2f189cb6ee1;p=clitk.git diff --git a/tools/clitkDicomRTStruct2BinaryImage.cxx b/tools/clitkDicomRTStruct2BinaryImage.cxx deleted file mode 100644 index 97eff97..0000000 --- a/tools/clitkDicomRTStruct2BinaryImage.cxx +++ /dev/null @@ -1,70 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Main authors : XX XX XX - - Authors belongs 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 http://www.opensource.org/licenses/bsd-license.php - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - - =========================================================================*/ - -#include "clitkDicomRT_ROI_ConvertToImageFilter.h" -#include "clitkDicomRT_StructureSet.h" -#include "clitkDicomRTStruct2BinaryImage_ggo.h" - -//-------------------------------------------------------------------- -int main(int argc, char * argv[]) { - - // Init command line - GGO(clitkDicomRTStruct2BinaryImage, args_info); - - // Read and display information - clitk::DicomRT_StructureSet::Pointer s = clitk::DicomRT_StructureSet::New(); - s->Read(args_info.input_arg); - if (args_info.verboseFile_flag) { - s->Print(std::cout); - } - - // New filter to convert to binary image - clitk::DicomRT_ROI_ConvertToImageFilter filter; - filter.SetCropMaskEnabled(args_info.crop_flag); - filter.SetImageFilename(args_info.image_arg); // Used to get spacing + origin - if (args_info.roi_arg != -1) { - filter.SetROI(s->GetROI(args_info.roi_arg)); - filter.SetOutputImageFilename(args_info.output_arg); - filter.Update(); - } - else { - for(unsigned int i=0; iGetListOfROI().size(); i++) { - clitk::DicomRT_ROI_ConvertToImageFilter filter; - filter.SetCropMaskEnabled(args_info.crop_flag); - filter.SetImageFilename(args_info.image_arg); // Used to get spacing + origin - std::string name = s->GetListOfROI()[i]->GetName(); - int num = s->GetListOfROI()[i]->GetROINumber(); - filter.SetROI(s->GetListOfROI()[i]); - name.erase(remove_if(name.begin(), name.end(), isspace), name.end()); - std::string n = std::string(args_info.output_arg).append - (clitk::toString(num)).append - ("_").append - (name).append - (".mhd"); - if (args_info.verbose_flag) { - std::cout << i << " " << s->GetListOfROI()[i]->GetName() << " num=" << num << " : " << n << std::endl; - } - filter.SetOutputImageFilename(n); - filter.Update(); - } - } - - // This is the end my friend - return 0; -}