From: Grenier Thomas Date: Tue, 19 Sep 2017 10:11:50 +0000 (+0200) Subject: modification image et csv X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=eb863a819b64b16474944e84a8724a7d6c332cac;p=STMS.git modification image et csv --- diff --git a/Lib/PrePostProcessing/itkSTMS_ImageSequenceToTemporalSet.txx b/Lib/PrePostProcessing/itkSTMS_ImageSequenceToTemporalSet.txx index 8b361d5..ed74c3c 100755 --- a/Lib/PrePostProcessing/itkSTMS_ImageSequenceToTemporalSet.txx +++ b/Lib/PrePostProcessing/itkSTMS_ImageSequenceToTemporalSet.txx @@ -91,7 +91,7 @@ itkSTMS_ImageSequenceToTemporalSet < ImageType, MaskImageType > mReader = MaskReaderType::New(); MinMaxCalculator = MinMaxCalculatorType::New(); - maskPath = expDescription->experimentPath+expDescription->inputFolder+expDescription->maskImage+expDescription->imageExtension; + maskPath = expDescription->maskImage; //expDescription->experimentPath+expDescription->inputFolder+expDescription->maskImage+expDescription->imageExtension; mReader->SetFileName( maskPath ); mReader->Update(); mask = mReader->GetOutput(); diff --git a/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h b/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h index 7c5e586..996d65b 100755 --- a/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h +++ b/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h @@ -121,7 +121,10 @@ namespace itkSTMS itkSTMS::ParserOutputType* desc ); void GenerateImageSequence(); - void GenerateCSVFile(); + + //! To generate CSV File from all classes. The file contains the class ID, the number of pixels of this class and then all filtered values along time. + //! You can pass a delimiter (ie a record separator) to this function. + void GenerateCSVFile(const std::string &delimiter = std::string(", ")); private: // Attributes diff --git a/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx b/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx index f5a00e9..2d51318 100755 --- a/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx +++ b/Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx @@ -198,7 +198,7 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType > template < class ImageType, class ClassImageType> void itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType > -::GenerateCSVFile() +::GenerateCSVFile(const std::string &delimiter) { std::string CSVFilename = expDescription->experimentPath+expDescription->outputFolder+ expDescription->outputCommonRoot+ @@ -213,9 +213,9 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType > for(unsigned int j=0 ; jsize() ; ++j) { - ofs << j+1 <<", " << std::count (classSet->begin(), classSet->end(), j+1); + ofs << j+1 << delimiter << std::count (classSet->begin(), classSet->end(), j+1); for( unsigned int i=1 ; i<=stmsParameters->numTimePoints - stmsParameters->startTimePoint + 1; ++i ) - ofs << ", " << rangeSet->at(j)[i-1]*stmsParameters->rScale ; + ofs << delimiter << rangeSet->at(j)[i-1]*stmsParameters->rScale ; ofs << std::endl; } diff --git a/Src/STMS_GrayLevelFiltering.cxx b/Src/STMS_GrayLevelFiltering.cxx index 7f2cd02..6de7883 100755 --- a/Src/STMS_GrayLevelFiltering.cxx +++ b/Src/STMS_GrayLevelFiltering.cxx @@ -162,7 +162,7 @@ int main(int argc, char **argv){ postProcess->GenerateImageSequence(); if(preProcess->GetExperimentDescription()->outputCSV == "true" ) - postProcess->GenerateCSVFile( ); + postProcess->GenerateCSVFile(); dtime = gettime_hp()-dtime; std::cout<