From: tbaudier Date: Fri, 8 Mar 2019 09:59:13 +0000 (+0100) Subject: Add output dicom filename to clitkImage2Dicom X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=01d304e57910a247ec738631ba07ff93fd2ad2eb;p=clitk.git Add output dicom filename to clitkImage2Dicom With -o option, the result is stored into the folder defined by -o, we cannot add a prefix filename The -n option add this prefix filename --- diff --git a/tools/clitkImage2Dicom.ggo b/tools/clitkImage2Dicom.ggo index d790cbf..47ee878 100644 --- a/tools/clitkImage2Dicom.ggo +++ b/tools/clitkImage2Dicom.ggo @@ -8,5 +8,6 @@ option "verbose" v "Verbose" flag off option "input" i "Input image filename" string no option "inputDcm" d "Input dicom filename" string no -option "outputDcm" o "Output dicom filename" string no +option "outputDcm" o "Output dicom folder" string no +option "nameDicom" n "Output dicom filename" string no diff --git a/tools/clitkImage2DicomGenericFilter.txx b/tools/clitkImage2DicomGenericFilter.txx index c58bd2f..da30589 100644 --- a/tools/clitkImage2DicomGenericFilter.txx +++ b/tools/clitkImage2DicomGenericFilter.txx @@ -374,7 +374,10 @@ Image2DicomGenericFilter::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]);