X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOSimpleView.h;h=4cc3d824ad89419af65e68ec5e3042b734e569c7;hb=3579beef5bd466705bc0431d7347d1150cdffe97;hp=5d658c43ac6301c5919b3c96b86ba366468e9591;hpb=c7482ec7d04a5e5987841932a6856ebd471cebdb;p=creaImageIO.git diff --git a/src/creaImageIOSimpleView.h b/src/creaImageIOSimpleView.h index 5d658c4..4cc3d82 100644 --- a/src/creaImageIOSimpleView.h +++ b/src/creaImageIOSimpleView.h @@ -38,71 +38,24 @@ namespace creaImageIO { - class __declspec(dllexport) SimpleView + class CREAIMAGEIO_EXPORT SimpleView { public: /// Ctor SimpleView(){} - ///Dtor ~SimpleView(){} - /// read file(s) and return a vector of vtkImageData - bool readFile( std::vector i_filenames, std::vector< vtkImageData *> &i_img){ - bool bresult, bfinal = true; - ImageReader *mReader = new ImageReader(); - std::vector::iterator it = i_filenames.begin(); - for (; it != i_filenames.end(); it++) - { - bresult = mReader->CanRead((*it).c_str()); - if(bresult) - { - i_img.push_back(mReader->ReadImage((*it).c_str())); - } - else - { - bfinal = false; - } - } - delete mReader; - return bfinal; - } - + bool readFile( std::vector i_filenames, // in information names + std::vector i_attr, // in information attributes names + std::vector > &i_imgAttr, // out information attributes names-values + std::vector< vtkImageData *> &i_img); // out information vtkImageData /// read a directory and return a vector of vtkImageData - bool readDirectory(const std::string i_pathname, std::vector< vtkImageData *> &i_imgs) - {bool bresult = true; - ImageReader *mReader = new ImageReader(); - std::vector names; - bresult = boost::filesystem::exists( i_pathname ); - if (bresult) - { - boost::filesystem::directory_iterator itr(i_pathname); - boost::filesystem::directory_iterator end_itr; - for(;itr != end_itr; ++itr) - { - if (!boost::filesystem::is_directory(itr->status())) - { - if( mReader->CanRead(itr->string()) ) - { - names.push_back(itr->string()); - } - } - } - std::sort (names.begin(), names.end()); // make sure names are in lexicographical order - int lgr = names.size(); - - for(int i=0; iReadImage(names[i]) ); - } - } - return bresult; - } - - }; - - - -} // namespace creaImageIO -#endif //__creaImageIOSimpleView_h_INCLUDED__ \ No newline at end of file + bool readDirectory( const std::string i_pathname, // in information names + std::vector i_attr, // in information attributes names + std::vector > &i_imgAttr, // out information attributes names-values + std::vector &i_imgs); // out information vtkImageData + vtkImageData* getVolumeSelected( std::vector images); + }; +} +#endif