]> 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 8b361d59c9a2bea1a9754b185a91afd0a9710c2f..ed74c3c32b1b8155ead8ff4b429afc59c5ffb73d 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 7c5e5866f736f3329f6fca009090ae5d93b7c90b..996d65b8ce5e1e2546f573ac6d00c563fc5cd73d 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 f5a00e9c08706091ca710fac3b5cf62e6a3c8c0d..2d5131821dafa43f4ff2b394f9b137b0ed8f0e49 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 7f2cd022ba348c9af564772e8d7cd15ca82303da..6de788375fa7c36391b51c0a6653590728bb11eb 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;