]> Creatis software - STMS.git/blobdiff - Src/STMS_GrayLevelFiltering.cxx
V 1.5
[STMS.git] / Src / STMS_GrayLevelFiltering.cxx
index d2bcb3d4addd6ba2814d0576eddb54425b61aa6e..d0c17d2f312b142f1d59153a3f8686ef577afe5c 100755 (executable)
@@ -60,7 +60,7 @@
 #include <iomanip>
 #include <ctime>
 
-#define STMS_NUMBERING_FORM_ONE "01"
+#define STMS_NUMBERING_FORM_ONE "0001"
 
 #include "itkImage.h"
 #include "itkSTMS_ArgumentsAnalysis.h"
@@ -73,6 +73,9 @@
 
 
 typedef float PixelType;
+typedef unsigned char OutputPixelType2D;
+typedef float OutputPixelType3D;
+
 
 double gettime_hp()
 {
@@ -110,8 +113,9 @@ int main(int argc, char **argv){
     switch(params->dim){
         case 2:
         {
-            typedef itk::Image< PixelType, 2 >     ImageType2D;
-            typedef itk::Image< unsigned char, 2 > MaskImageType2D;
+            typedef itk::Image< PixelType, 2 >          ImageType2D;
+            typedef itk::Image< OutputPixelType2D, 2 >  OutputImageType2D;
+            typedef itk::Image< unsigned char, 2 >      MaskImageType2D;
 
 
             typedef itkSTMS::itkSTMS_ImageSequenceToTemporalSet< ImageType2D, MaskImageType2D >::IndexType            IndexType;
@@ -153,14 +157,16 @@ int main(int argc, char **argv){
 
             dtime=gettime_hp();
 
-            itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType2D, ClassImageType2D >* postProcess
-                    = new itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType2D, ClassImageType2D >(stmsFilter->GetClassMemory(),
+            itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType2D, ClassImageType2D, OutputImageType2D >* postProcess
+                    = new itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType2D, ClassImageType2D, OutputImageType2D>(stmsFilter->GetClassMemory(),
                                                                                                        stmsFilter->GetSpatialMemory(),
                                                                                                        stmsFilter->GetRangeSet(),
                                                                                                        params,
                                                                                                        preProcess->GetExperimentDescription());
 
             postProcess->GenerateImageSequence();
+            if(preProcess->GetExperimentDescription()->outputCSV == "true"  )
+                postProcess->GenerateCSVFile();
 
             dtime = gettime_hp()-dtime;
             std::cout<<std::endl<< std::setw(30) << std::left << "Image sequence saving: " << dtime/1000 << " s" <<std::endl;
@@ -175,6 +181,7 @@ int main(int argc, char **argv){
         case 3:
         {
             typedef itk::Image< PixelType, 3 >     ImageType3D;
+            typedef itk::Image< OutputPixelType3D, 3 >     OutputImageType3D;
             typedef itk::Image< unsigned char, 3 > MaskImageType3D;
 
             typedef itkSTMS::itkSTMS_ImageSequenceToTemporalSet< ImageType3D, MaskImageType3D >::IndexType            IndexType;
@@ -216,14 +223,16 @@ int main(int argc, char **argv){
 
             dtime=gettime_hp();
 
-            itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType3D, MaskImageType3D >* postProcess
-                    = new itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType3D, MaskImageType3D >(stmsFilter->GetClassMemory(),
+            itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType3D, MaskImageType3D, OutputImageType3D>* postProcess
+                    = new itkSTMS::itkSTMS_TemporalSetToImageSequence< ImageType3D, MaskImageType3D, OutputImageType3D >(stmsFilter->GetClassMemory(),
                                                                                                       stmsFilter->GetSpatialMemory(),
                                                                                                       stmsFilter->GetRangeSet(),
                                                                                                       params,
                                                                                                       preProcess->GetExperimentDescription());
 
             postProcess->GenerateImageSequence();
+            if(preProcess->GetExperimentDescription()->outputCSV == "true"  )
+                postProcess->GenerateCSVFile();
 
             dtime = gettime_hp()-dtime;
             std::cout<<std::endl<< std::setw(30) << std::left << "Image sequence saving: " << dtime/1000 << " s" <<std::endl;