Public Member Functions

creaImageIO::OutputModel Class Reference

#include <creaImageIOOutputModel.h>

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 24 of file creaImageIOOutputModel.h.


Constructor & Destructor Documentation

creaImageIO::OutputModel::OutputModel (  )  [inline]

Definition at line 27 of file creaImageIOOutputModel.h.

{}

creaImageIO::OutputModel::~OutputModel (  )  [virtual]

Definition at line 31 of file creaImageIOOutputModel.cpp.

        {
        }


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 36 of file creaImageIOOutputModel.cpp.

        {
                double spacing=1;
                typedef std::vector<GDCM_NAME_SPACE::File* > FileList;
                FileList fileVector;
                //GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
                GDCM_NAME_SPACE::SerieHelper *sh = GDCM_NAME_SPACE::SerieHelper::New();
                std::vector<std::string> lstAux;
                std::vector<std::string>::iterator it;
                for (it=im.begin(); it!=im.end(); ++it)
                {
                        GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
                        f->SetFileName(*it);
                        f->Load();
                        if (f->IsReadable())
                        {
                                fileVector.push_back(f);
                        } else {
                                lstAux.push_back(*it);
                        }
                } // for

                if ((fileVector.size()>1) && (sh->IsCoherent( &fileVector )))
                {
                                sh->OrderFileList(&fileVector);
                                spacing= sh->GetZSpacing();
                                im.clear();
                                int i;
                                for (i=0; i<fileVector.size(); i++)
                                {
                                        im.push_back( (fileVector[i])->GetFileName() );
                                }
                                for (i=0; i<lstAux.size(); i++)
                                {
                                        im.push_back( lstAux[i] );
                                }
                }else {
                        std::sort( im.begin(), im.end() );
                }
                
           return spacing;
        }


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