<commit_before>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkDICOMSeriesFileNamesTest.cxx
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "itkDICOMImageIO2Factory.h"
#include "itkDICOMSeriesFileNames.h"

int itkDICOMSeriesFileNamesTest(int ac, char* av[])
{

  if(ac < 1)
  {
    std::cerr << "Usage: " << av[0] << " DicomDirectory\n";
    return EXIT_FAILURE;
  }

  std::vector<std::string> names;
  std::vector<std::string>::iterator nit;

  itk::DICOMSeriesFileNames::Pointer fit = itk::DICOMSeriesFileNames::New();
  fit->SetDirectory(av[1]);
  fit->SetFileNameSortingOrderToSortByImageNumber();

  std::cout << "Files sorted by image number" << std::endl;
  names = fit->GetFileNames();
  for (nit = names.begin();
       nit != names.end();
       nit++)
    {
    std::cout << "File: " << (*nit).c_str() << std::endl;
    }


  fit->SetFileNameSortingOrderToSortBySliceLocation();

  std::cout << "Files sorted by slice location" << std::endl;
  names = fit->GetFileNames();
  for (nit = names.begin();
       nit != names.end();
       nit++)
    {
    std::cout << "File: " << (*nit).c_str() << std::endl;
    }

  
  fit->SetFileNameSortingOrderToSortByImagePositionPatient();

  std::cout << "Files sorted by ImagePositionPatient" << std::endl;
  names = fit->GetFileNames();
  for (nit = names.begin();
       nit != names.end();
       nit++)
    {
    std::cout << "File: " << (*nit).c_str() << std::endl;
    }
  
  return EXIT_SUCCESS;

}<commit_msg>ENH: Output information for every series.<commit_after>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkDICOMSeriesFileNamesTest.cxx
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "itkDICOMImageIO2Factory.h"
#include "itkDICOMSeriesFileNames.h"

int itkDICOMSeriesFileNamesTest(int ac, char* av[])
{

  if(ac < 1)
  {
    std::cerr << "Usage: " << av[0] << " DicomDirectory\n";
    return EXIT_FAILURE;
  }

  std::vector<std::string> names;
  std::vector<std::string>::iterator nit;

  itk::DICOMSeriesFileNames::Pointer fit = itk::DICOMSeriesFileNames::New();
  fit->SetDirectory(av[1]);
  fit->SetFileNameSortingOrderToSortByImageNumber();

  // Now look at each series in turn
  std::vector<std::string> seriesUIDs;
  seriesUIDs = fit->GetSeriesUIDs();
  
  std::vector<std::string>::iterator sit;
  for (sit = seriesUIDs.begin(); sit != seriesUIDs.end(); ++sit)
    {
    std::cout << "Series: " << *sit << std::endl;
    std::cout << "\tFiles sorted by image number" << std::endl;
    fit->SetFileNameSortingOrderToSortByImageNumber();
    names = fit->GetFileNames( *sit );
    for (nit = names.begin();
         nit != names.end();
         nit++)
      {
      std::cout << "\t\tFile: " << (*nit).c_str() << std::endl;
      }
    
    
    std::cout << "\tFiles sorted by slice location" << std::endl;
    fit->SetFileNameSortingOrderToSortBySliceLocation();
    names = fit->GetFileNames( *sit );
    for (nit = names.begin();
         nit != names.end();
         nit++)
      {
      std::cout << "\t\tFile: " << (*nit).c_str() << std::endl;
      }
    
    
    std::cout << "\tFiles sorted by ImagePositionPatient" << std::endl;
    fit->SetFileNameSortingOrderToSortByImagePositionPatient();
    names = fit->GetFileNames( *sit );
    for (nit = names.begin();
         nit != names.end();
         nit++)
      {
      std::cout << "\t\tFile: " << (*nit).c_str() << std::endl;
      }

    }
  return EXIT_SUCCESS;

}
{'fraction_non_alphanumeric': 0.20934869295525033, 'fraction_numerical': 0.003544528134692069, 'mean_word_length': 3.602446483180428, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207780', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1371, 'n_words': 316}