]> Creatis software - STMS.git/commitdiff
modification image et csv
authorGrenier Thomas <thomas.grenier@creatis.insa-lyon.fr>
Tue, 19 Sep 2017 10:11:50 +0000 (12:11 +0200)
committerGrenier Thomas <thomas.grenier@creatis.insa-lyon.fr>
Tue, 19 Sep 2017 10:11:50 +0000 (12:11 +0200)
Lib/PrePostProcessing/itkSTMS_ImageSequenceToTemporalSet.txx
Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h
Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx
Src/STMS_GrayLevelFiltering.cxx

index 8b361d5..ed74c3c 100755 (executable)
@@ -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();
index 7c5e586..996d65b 100755 (executable)
@@ -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
index f5a00e9..2d51318 100755 (executable)
@@ -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 ; j<rangeSet->size() ; ++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;
     }
 
index 7f2cd02..6de7883 100755 (executable)
@@ -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<<std::endl<< std::setw(30) << std::left << "Image sequence saving: " << dtime/1000 << " s" <<std::endl;