]> Creatis software - STMS.git/blobdiff - Lib/PrePostProcessing/itkSTMS_XMLFileParser.hxx
output 2D as png file
[STMS.git] / Lib / PrePostProcessing / itkSTMS_XMLFileParser.hxx
index 1bb4c27c17ac901e3b246986ac63715da12168f9..130e518bfc5a2c342ab12cd69959bd6de81753b8 100755 (executable)
@@ -69,11 +69,13 @@ itkSTMS_XMLFileParser::itkSTMS_XMLFileParser()
     xmlParams.experimentPath     = "";
     xmlParams.imageExtension     = "";
     xmlParams.outputImageExtension = "";
+    xmlParams.outputClassExtension = "";
     xmlParams.inputCommonRoot    = "";
     xmlParams.inputFolder        = "";
     xmlParams.maskImage          = "";
     xmlParams.outputFolder       = "";
     xmlParams.outputCommonRoot   = "";
+    xmlParams.outputCSV          = "";
 }
 
 
@@ -108,10 +110,18 @@ void itkSTMS_XMLFileParser::Update()
     xmlParams.outputImageExtension = DomObject->GetAttribute( "outputImageExtension" );
     if ( xmlParams.outputImageExtension == "" )
     {
-        std::cout << std::endl << std::endl <<  "outputImageExtension not found" << 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" );
@@ -150,6 +160,13 @@ void itkSTMS_XMLFileParser::Update()
         std::cout << std::endl << std::endl <<  "outputCommonRoot not found" << std::endl << std::endl;
         std::exit( EXIT_FAILURE );
     }
+
+    xmlParams.outputCSV = listOutput->GetAttribute( "outputCSV" );
+    if ( xmlParams.outputCSV == "" )
+    {
+        std::cout << std::endl << std::endl <<  "outputCSV not set: no CSV file will be created" << std::endl << std::endl;
+    }
+
 }
 } // end of namespace itkSTMS
 #endif // itkSTMS_XMLFileParser_HXX