From: tbaudier Date: Thu, 10 Mar 2016 08:37:38 +0000 (+0100) Subject: Add a tag to preserve UID and private DICOM tags for clitkWriteDicomSeries (see previ... X-Git-Tag: v1.4.0~30 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=82a070f2eaa960eae4236fb11ab5afc64a2c171b;p=clitk.git Add a tag to preserve UID and private DICOM tags for clitkWriteDicomSeries (see previous commit) --- diff --git a/tools/clitkWriteDicomSeries.ggo b/tools/clitkWriteDicomSeries.ggo index faa08cb..d5f1347 100644 --- a/tools/clitkWriteDicomSeries.ggo +++ b/tools/clitkWriteDicomSeries.ggo @@ -14,3 +14,4 @@ option "tag" t "Tags values" string no multiple default="MIDPOSITION" option "newSeriesUID" e "Write the series with a new series UID (ignored if given in key/tag option)" flag off option "newStudyUID" u "Write the series with a new study UID (ignored if given in key/tag option; forces newSeriesUID = true)" flag off option "useSizeAsReference" s "Use the size of the dicom image as reference for an occasional resampling" flag off +option "preserve" p "Preserve private tags and keep original UID (eg: Xio)" flag off diff --git a/tools/clitkWriteDicomSeriesGenericFilter.txx b/tools/clitkWriteDicomSeriesGenericFilter.txx index f30947f..a2bccc4 100644 --- a/tools/clitkWriteDicomSeriesGenericFilter.txx +++ b/tools/clitkWriteDicomSeriesGenericFilter.txx @@ -153,8 +153,12 @@ WriteDicomSeriesGenericFilter::UpdateWithDimAndPixelType() // Read the series typename ReaderType::Pointer reader = ReaderType::New(); - gdcmIO->LoadPrivateTagsOn(); - gdcmIO->KeepOriginalUIDOn(); + if (m_ArgsInfo.preserve_flag) { +#if GDCM_MAJOR_VERSION >= 2 + gdcmIO->LoadPrivateTagsOn(); + gdcmIO->KeepOriginalUIDOn(); +#endif + } reader->SetImageIO( gdcmIO ); reader->SetFileNames( filenames_in ); try {