~ubuntu-branches/ubuntu/precise/insighttoolkit/precise

« back to all changes in this revision

Viewing changes to Code/IO/itkGDCMSeriesFileNames.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-05-31 12:07:29 UTC
  • mfrom: (3.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080531120729-7g7layn480le43ko
Tags: 3.6.0-3
* debian/patches/gccxml-workaround.patch: New.  Work around gccxml issue
  with #include_next; c.f. http://www.gccxml.org/Bug/view.php?id=7134.  
* debian/patches/gcc43.patch: include <cstring> in itkNeighbourhood.h.
  This only showed up in the tcl wrapping step.

* Above two entries fix FTBFS for GCC 4.3-based systems.
  Closes: #478500.

* debian/patches/sharedforward.patch: New.  Ensure that linux/sparc
  systems are not also configured as a SUN sparc system, which requires
  SUN header sys/isa_defs.h.  Closes: #478940, #483312.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   Insight Segmentation & Registration Toolkit
4
4
  Module:    $RCSfile: itkGDCMSeriesFileNames.cxx,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2006/10/27 11:36:50 $
7
 
  Version:   $Revision: 1.32 $
 
6
  Date:      $Date: 2007-07-19 10:27:01 $
 
7
  Version:   $Revision: 1.35 $
8
8
 
9
9
  Copyright (c) Insight Software Consortium. All rights reserved.
10
10
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
47
47
 
48
48
void GDCMSeriesFileNames::SetInputDirectory (const char * name)
49
49
{
50
 
   if ( !name )
51
 
     {
52
 
     itkExceptionMacro(<<"SetInputDirectory() received a NULL string");
53
 
     }
54
 
   std::string fname = name;
55
 
   this->SetInputDirectory( fname );
 
50
  if ( !name )
 
51
    {
 
52
    itkExceptionMacro(<<"SetInputDirectory() received a NULL string");
 
53
    }
 
54
  std::string fname = name;
 
55
  this->SetInputDirectory( fname );
56
56
}
57
57
 
58
58
void GDCMSeriesFileNames::SetInputDirectory (std::string const &name)
67
67
    {
68
68
    return;
69
69
    }
 
70
  if( !itksys::SystemTools::FileIsDirectory(name.c_str()) )
 
71
    {
 
72
    itkWarningMacro( << name << " is not a directory" );
 
73
    return;
 
74
    }
70
75
  m_InputDirectory = name;
71
76
  m_SerieHelper->Clear();
72
77
  m_SerieHelper->SetUseSeriesDetails( m_UseSeriesDetails );
110
115
  gdcm::FileList *flist = m_SerieHelper->GetFirstSingleSerieUIDFileSet();
111
116
  if( !flist )
112
117
    {
113
 
    itkWarningMacro(<<"No Series can be found, make sure you restiction are not too strong");
 
118
    itkWarningMacro(
 
119
      << "No Series can be found, make sure your restrictions are not too strong");
114
120
    return m_InputFileNames;
115
121
    }
116
122
  if( serie != "" ) // user did not specify any sub selection based on UID
146
152
    for(it = flist->begin(); 
147
153
        it != flist->end(); ++it )
148
154
      {
149
 
        gdcm::File * header = *it;
150
 
        if( !header )
151
 
          {
152
 
          itkWarningMacro( << "GDCMSeriesFileNames got NULL header, "
153
 
            "this is a serious bug" );
154
 
          continue;
155
 
          }
156
 
        if( !header->IsReadable() )
157
 
          {
158
 
          itkWarningMacro( << "GDCMSeriesFileNames got a non DICOM file:" 
159
 
            << header->GetFileName() );
160
 
          continue;
161
 
          }
162
 
        m_InputFileNames.push_back( header->GetFileName() );
 
155
      gdcm::File * header = *it;
 
156
      if( !header )
 
157
        {
 
158
        itkWarningMacro( << "GDCMSeriesFileNames got NULL header, "
 
159
                         "this is a serious bug" );
 
160
        continue;
 
161
        }
 
162
      if( !header->IsReadable() )
 
163
        {
 
164
        itkWarningMacro( << "GDCMSeriesFileNames got a non DICOM file:" 
 
165
                         << header->GetFileName() );
 
166
        continue;
 
167
        }
 
168
      m_InputFileNames.push_back( header->GetFileName() );
163
169
      }
164
170
    }
165
171
  else
166
172
    {
167
173
    itkDebugMacro(<<"No files were found");
168
174
    }
169
 
 
 
175
  
170
176
  return m_InputFileNames;
171
177
}
172
178