]> Creatis software - clitk.git/blobdiff - tools/clitkImage2DicomGenericFilter.txx
Add output dicom filename to clitkImage2Dicom
[clitk.git] / tools / clitkImage2DicomGenericFilter.txx
index c58bd2ff1606004bab3955cf9b02723901ed2f41..da30589e125085dbc921179967144a794620d0fd 100644 (file)
@@ -374,7 +374,10 @@ Image2DicomGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
   // Generate the file names
   OutputNamesGeneratorType::Pointer outputNames = OutputNamesGeneratorType::New();
   std::string seriesFormat(m_ArgsInfo.outputDcm_arg);
-  seriesFormat = seriesFormat + "/" + "IM%d.dcm";
+  seriesFormat = seriesFormat + "/";
+  if (m_ArgsInfo.nameDicom_given)
+    seriesFormat = seriesFormat + m_ArgsInfo.nameDicom_arg + "_";
+  seriesFormat = seriesFormat + "IM%d.dcm";
   outputNames->SetSeriesFormat(seriesFormat.c_str());
   outputNames->SetStartIndex(1);
   outputNames->SetEndIndex(outputSize[2]);