X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=common%2FclitkCommon.h;h=31f28dc40637bd95e91dfec7974f23183edd43ac;hb=3de84bda64063da470fb7a12abd38c98ed14bfd3;hp=e3145b1d840425812feef4f2a6f4773c7073b90e;hpb=ff7b62d284bd4f5eadce3aff4b217ae722b369a7;p=clitk.git diff --git a/common/clitkCommon.h b/common/clitkCommon.h index e3145b1..31f28dc 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef CLITKCOMMON_H #define CLITKCOMMON_H @@ -30,8 +30,18 @@ #include #include +// std include #include +// Include for "rusage" +#include +#if defined(unix) || defined(__APPLE__) +# include +# include +#elif defined(WIN32) +# include +#endif + //-------------------------------------------------------------------- namespace clitk { @@ -71,6 +81,9 @@ namespace clitk { template std::string toStringVector(const T * t, const int n); template std::string toStringVector(const T & t, const int n); template std::string toStringVector(const std::vector & t); + template bool fromString(T& t, + const std::string& s, + std::ios_base& (*f)(std::ios_base&)=std::dec); //-------------------------------------------------------------------- // Display a progress % @@ -193,6 +206,9 @@ namespace clitk { template void CloneImage(const typename ImageType::Pointer & input, typename ImageType::Pointer & output); + //-------------------------------------------------------------------- + void PrintMemoryUsed(); + #include "clitkCommon.txx" } // end namespace