creaImageIO_lib
creaImageIO::OutputModel Class Reference

#include <creaImageIOOutputModel.h>

Public Member Functions

 OutputModel ()
 
virtual ~OutputModel ()
 
double orderFilesWithZspacing (std::vector< std::string > &im)
 

Detailed Description

Definition at line 51 of file creaImageIOOutputModel.h.

Constructor & Destructor Documentation

creaImageIO::OutputModel::OutputModel ( )
inline

Definition at line 54 of file creaImageIOOutputModel.h.

54 {}
creaImageIO::OutputModel::~OutputModel ( )
virtual

Definition at line 58 of file creaImageIOOutputModel.cpp.

59  {
60  }

Member Function Documentation

double creaImageIO::OutputModel::orderFilesWithZspacing ( std::vector< std::string > &  im)

liberer les GDCM_NAME_SPACE::File a la fin! // JPR

Definition at line 63 of file creaImageIOOutputModel.cpp.

Referenced by creaImageIO::WxGimmickView::getSelectedFiles().

64  {
65  double spacing=1;
66  typedef std::vector<GDCM_NAME_SPACE::File* > FileList;
67  FileList fileVector;
68  //GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
69  GDCM_NAME_SPACE::SerieHelper *sh = GDCM_NAME_SPACE::SerieHelper::New();
70  std::vector<std::string> lstAux;
71  std::vector<std::string>::iterator it;
72  for (it=im.begin(); it!=im.end(); ++it)
73  {
75  GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
76  f->SetFileName(*it);
77  f->Load();
78  if (f->IsReadable())
79  {
80  fileVector.push_back(f);
81  } else {
82  lstAux.push_back(*it);
83  }
84  } // for
85 
86  if ((fileVector.size()>1) && (sh->IsCoherent( &fileVector )))
87  {
88  sh->OrderFileList(&fileVector);
89  spacing= sh->GetZSpacing();
90  im.clear();
91  int i;
92  for (i=0; i<fileVector.size(); i++)
93  {
94  im.push_back( (fileVector[i])->GetFileName() );
95  }
96  for (i=0; i<lstAux.size(); i++)
97  {
98  im.push_back( lstAux[i] );
99  }
100  }else {
101  std::sort( im.begin(), im.end() );
102  }
103 
104  return spacing;
105  }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: