- also some bug corrections...
option "key" k "Keys of tags to modify" string no multiple default="0008|103e"
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 "key" k "Keys of tags to modify" string no multiple default="0008|103e"
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)" 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 "useSizeAsReference" s "Use the size of the dicom image as reference for an occasional resampling" flag off
namesGenerator->SetInputDirectory( m_ArgsInfo.inputDir_arg );
namesGenerator->SetOutputDirectory( m_ArgsInfo.outputDir_arg );
typename ReaderType::FileNamesContainer filenames_in = namesGenerator->GetInputFileNames();
namesGenerator->SetInputDirectory( m_ArgsInfo.inputDir_arg );
namesGenerator->SetOutputDirectory( m_ArgsInfo.outputDir_arg );
typename ReaderType::FileNamesContainer filenames_in = namesGenerator->GetInputFileNames();
- typename ReaderType::FileNamesContainer filenames_out = namesGenerator->GetOutputFileNames();
+ typename ReaderType::FileNamesContainer filenames_out;
// Output the dicom files
unsigned int numberOfFilenames = filenames_in.size();
// Output the dicom files
unsigned int numberOfFilenames = filenames_in.size();
// Get keys
unsigned int numberOfKeysGiven=m_ArgsInfo.key_given;
// Get keys
unsigned int numberOfKeysGiven=m_ArgsInfo.key_given;
+ if (m_ArgsInfo.verbose_flag)
+ DD(numberOfKeysGiven);
std::string seriesUID;
std::string frameOfReferenceUID;
std::string seriesUID;
std::string frameOfReferenceUID;
bool studyUIDGiven = false;
for (unsigned int i = 0; i < numberOfKeysGiven; i++) {
std::string entryId( m_ArgsInfo.key_arg[i] );
bool studyUIDGiven = false;
for (unsigned int i = 0; i < numberOfKeysGiven; i++) {
std::string entryId( m_ArgsInfo.key_arg[i] );
+ if (m_ArgsInfo.verbose_flag)
+ DD(entryId);
seriesUIDGiven = (entryId == seriesUIDkey || entryId == frameOfReferenceUIDKey);
seriesUIDGiven = (entryId == seriesUIDkey || entryId == frameOfReferenceUIDKey);
- if (seriesUIDGiven)
- {
- if (entryId == seriesUIDkey)
- seriesUID = m_ArgsInfo.tag_arg[i];
- else
- frameOfReferenceUID = m_ArgsInfo.tag_arg[i];
- }
- else if (m_ArgsInfo.newSeriesUID_flag) {
+ studyUIDGiven = (entryId == studyUIDKey);
+ }
+
+ // force the creation of a new series if a new study was specified
+ if (!studyUIDGiven && m_ArgsInfo.newStudyUID_flag) {
+ m_ArgsInfo.newSeriesUID_flag = true;
#if GDCM_MAJOR_VERSION >= 2
#if GDCM_MAJOR_VERSION >= 2
- gdcm::UIDGenerator suid;
- seriesUID = suid.Generate();
- gdcm::UIDGenerator fuid;
- frameOfReferenceUID = fuid.Generate();
+ gdcm::UIDGenerator suid;
+ studyUID = suid.Generate();
- seriesUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
- frameOfReferenceUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
+ studyUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
- }
-
- studyUIDGiven = (entryId == studyUIDKey);
- if (studyUIDGiven)
- studyUID = m_ArgsInfo.tag_arg[i];
- else if (m_ArgsInfo.newStudyUID_flag) {
+ }
+
+ if (!seriesUIDGiven && m_ArgsInfo.newSeriesUID_flag) {
#if GDCM_MAJOR_VERSION >= 2
#if GDCM_MAJOR_VERSION >= 2
- gdcm::UIDGenerator suid;
- studyUID = suid.Generate();
+ gdcm::UIDGenerator suid;
+ seriesUID = suid.Generate();
+ gdcm::UIDGenerator fuid;
+ frameOfReferenceUID = fuid.Generate();
- studyUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
+ seriesUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
+ frameOfReferenceUID = gdcm::Util::CreateUniqueUID( gdcmIO->GetUIDPrefix());
}
if (m_ArgsInfo.verbose_flag) {
}
if (m_ArgsInfo.verbose_flag) {