]> Creatis software - STMS.git/commitdiff
output 2D as png file
authorThomas Greneir <thomas.grenier@insa-lyon.fr>
Wed, 20 Sep 2017 16:34:34 +0000 (18:34 +0200)
committerThomas Greneir <thomas.grenier@insa-lyon.fr>
Wed, 20 Sep 2017 16:34:34 +0000 (18:34 +0200)
new options in .xml file about image file extension

CMakeLists.txt.user [new file with mode: 0644]
Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.h
Lib/PrePostProcessing/itkSTMS_TemporalSetToImageSequence.txx
Lib/PrePostProcessing/itkSTMS_XMLFileParser.h
Lib/PrePostProcessing/itkSTMS_XMLFileParser.hxx
Src/STMS_GrayLevelFiltering.cxx

diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user
new file mode 100644 (file)
index 0000000..e49be18
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 4.1.0, 2017-09-20T18:32:25. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{0d0dac41-b5d4-48ba-8b55-2eef6c8f9c37}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">1</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{02771194-e57d-45d0-a1ce-cf0336f8bb4f}</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <valuelist type="QVariantList" key="CMake.Configuration">
+     <value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
+    </valuelist>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/opt/MasterGrenier/bin/Creatis_GIT/STMS/STMS-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
+      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
+       <value type="QString">all</value>
+      </valuelist>
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
+      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <valuelist type="QVariantList" key="CMake.Configuration">
+     <value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
+     <value type="QString">CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++</value>
+    </valuelist>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/opt/MasterGrenier/bin/Creatis_GIT/STMS/STMS-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
+      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
+       <value type="QString">all</value>
+      </valuelist>
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
+      <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">STMS_GrayLevelFiltering</value>
+    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
+    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
+    <value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory.default">/opt/MasterGrenier/bin/Creatis_GIT/STMS/STMS-Release/Src</value>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">STMS_GrayLevelFiltering</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.STMS_GrayLevelFiltering</value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">18</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">18</value>
+ </data>
+</qtcreator>
index 996d65b8ce5e1e2546f573ac6d00c563fc5cd73d..1b53b3e57910ff07c5dfac7db346483cb867142b 100755 (executable)
 
 namespace itkSTMS
 {
-    template < class ImageType, class ClassImageType >
+    template < class ImageType, class ClassImageType, class OutputImageType=ImageType>
     class itkSTMS_TemporalSetToImageSequence
     {
     public:
         // Reader and writer typedefs
         typedef itk::ImageFileReader< ImageType >       ReaderType;
         typedef typename ReaderType::Pointer            ReaderPointer;
-        typedef itk::ImageFileWriter< ImageType >       WriterType;
+        typedef itk::ImageFileWriter< OutputImageType > WriterType;
         typedef typename WriterType::Pointer            WriterPointer;
         typedef itk::ImageFileWriter< ClassImageType >  ClassWriterType;
         typedef typename ClassWriterType::Pointer       ClassWriterPointer;
index c988bb7b821ce23edb88557b4ca76b01be6de67d..115918763c8368d28107ba013fb5d0bac3d73e15 100755 (executable)
@@ -67,8 +67,8 @@
 namespace itkSTMS
 {
 
-template < class ImageType, class ClassImageType >
-itkSTMS_TemporalSetToImageSequence < ImageType, ClassImageType >
+template < class ImageType, class ClassImageType, class OutputImageType>
+itkSTMS_TemporalSetToImageSequence < ImageType, ClassImageType, OutputImageType >
 ::itkSTMS_TemporalSetToImageSequence( IndexSampleSetType* cl, SpatialSampleSetType* sp, RangeSampleSetType* ra,
                                       itkSTMS::ParamsAnalysisOutputType* params, itkSTMS::ParserOutputType* desc )
 {
@@ -81,9 +81,9 @@ itkSTMS_TemporalSetToImageSequence < ImageType, ClassImageType >
 }
 
 
-template < class ImageType, class ClassImageType >
+template < class ImageType, class ClassImageType, class OutputImageType >
 void
-itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
+itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType, OutputImageType >
 ::GenerateImageSequence()
 {
     bool first = true;
@@ -114,9 +114,7 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
 
     std::string outputPath, classPath;
 
-    ClassImagePointer classImage
-            = ClassImageType::New();
-
+    ClassImagePointer classImage          = ClassImageType::New();
     classImage->SetRegions( classRegion );
     classImage->Allocate();
     classImage->FillBuffer( 15.0 );
@@ -128,10 +126,9 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
             "_Y-"+std::to_string((unsigned int)stmsParameters->spScales[1])+
             "_Z-"+std::to_string((unsigned int)stmsParameters->spScales[2])+
             "_R-"+std::to_string(stmsParameters->rScale)+
-            expDescription->outputImageExtension;
+            expDescription->outputClassExtension;
 
-    ClassWriterPointer classWriter
-            = ClassWriterType::New();
+    ClassWriterPointer classWriter         = ClassWriterType::New();
     classWriter->SetFileName( classPath );
 
     // Filetered image sequence and class image saving
@@ -154,10 +151,12 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
                 "_R-"+std::to_string(stmsParameters->rScale)+"_"+
                 buffer+expDescription->outputImageExtension;
 
-        ImagePointer outImage           = ImageType::New();
+
+
+        typename OutputImageType::Pointer outImage           = OutputImageType::New();
         outImage->SetRegions( region );
         outImage->Allocate();
-        outImage->FillBuffer( 15.0 );
+        outImage->FillBuffer( 0 );
 
         WriterPointer writer            = WriterType::New();
         writer->SetFileName( outputPath );
@@ -173,7 +172,7 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
                     classIndex[k] = outIndex[k];
             }
 
-            outImage->SetPixel( outIndex, rangeSet->at( classSet->at(j)-1 )[i-1]*stmsParameters->rScale );
+            outImage->SetPixel( outIndex, static_cast<typename OutputImageType::PixelType>(rangeSet->at( classSet->at(j)-1 )[i-1]*stmsParameters->rScale) );
 
             if( first )
                 classImage->SetPixel(classIndex, classSet->at(j));
@@ -192,9 +191,9 @@ itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
 }
 
 
-template < class ImageType, class ClassImageType>
+template < class ImageType, class ClassImageType, class OutputImageType>
 void
-itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType >
+itkSTMS_TemporalSetToImageSequence< ImageType, ClassImageType, OutputImageType>
 ::GenerateCSVFile(const std::string &delimiter)
 {
     std::string CSVFilename = expDescription->experimentPath+expDescription->outputFolder+
index 7bc7b185dabc81e99a69f279b164a0873d80d473..b27cd9f5898dc1ba89563bad65f2e7a19f8388cf 100755 (executable)
@@ -70,6 +70,7 @@ namespace itkSTMS
         std::string  experimentPath;
         std::string  imageExtension;
         std::string  outputImageExtension;
+        std::string  outputClassExtension;
         std::string  inputCommonRoot;
         std::string  inputFolder;
         std::string  maskImage;
index 191adb356b4928ad9cb49c53e77319e99227c513..130e518bfc5a2c342ab12cd69959bd6de81753b8 100755 (executable)
@@ -69,6 +69,7 @@ itkSTMS_XMLFileParser::itkSTMS_XMLFileParser()
     xmlParams.experimentPath     = "";
     xmlParams.imageExtension     = "";
     xmlParams.outputImageExtension = "";
+    xmlParams.outputClassExtension = "";
     xmlParams.inputCommonRoot    = "";
     xmlParams.inputFolder        = "";
     xmlParams.maskImage          = "";
@@ -109,10 +110,18 @@ void itkSTMS_XMLFileParser::Update()
     xmlParams.outputImageExtension = DomObject->GetAttribute( "outputImageExtension" );
     if ( xmlParams.outputImageExtension == "" )
     {
-        std::cout << std::endl << std::endl <<  "outputImageExtension not set" << std::endl << std::endl;
-        std::exit( EXIT_FAILURE );
+        std::cout << std::endl << std::endl <<  "outputImageExtension not set, using same as input (imageExtension) : "<< xmlParams.imageExtension << std::endl << std::endl;
+        xmlParams.outputImageExtension = xmlParams.imageExtension;
     }
 
+    xmlParams.outputClassExtension = DomObject->GetAttribute( "outputClassExtension" );
+    if ( xmlParams.outputClassExtension == "" )
+    {
+        std::cout << std::endl << std::endl <<  "outputClassExtension not set, .nii (nifti) used by default" << std::endl << std::endl;
+        xmlParams.outputClassExtension = ".nii";
+    }
+
+
     // Read input parameters
     listInput = DomObject->GetChild( "listInput" );
     xmlParams.inputFolder = listInput->GetAttribute( "inputFolder" );
index f999b5f7be4470c452f8f17f241809e8f4c47c3f..c7cfffda98c9c39383e5a9bbf4e382255f109a42 100755 (executable)
@@ -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,8 +157,8 @@ 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,
@@ -177,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;
@@ -218,8 +223,8 @@ 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,