if (m_ArgsInfo.verbose_flag)
DD(entryId);
- seriesUIDGiven = (entryId == seriesUIDkey || entryId == frameOfReferenceUIDKey);
- seriesNumberGiven = (entryId == seriesNumberKey);
- seriesDescriptionGiven = (entryId == seriesDescriptionKey);
- studyUIDGiven = (entryId == studyUIDKey);
- studyIDGiven = (entryId == studyIDKey);
- studyDescriptionGiven = (entryId == studyDescriptionKey);
+ seriesUIDGiven |= (entryId == seriesUIDkey || entryId == frameOfReferenceUIDKey);
+ seriesNumberGiven |= (entryId == seriesNumberKey);
+ seriesDescriptionGiven |= (entryId == seriesDescriptionKey);
+ studyUIDGiven |= (entryId == studyUIDKey);
+ studyIDGiven |= (entryId == studyIDKey);
+ studyDescriptionGiven |= (entryId == studyDescriptionKey);
}
// force the creation of a new series if a new study was specified
bool useInputFileUID = true;
if (m_ArgsInfo.newSeriesUID_flag || m_ArgsInfo.newStudyUID_flag || seriesUIDGiven || studyUIDGiven) {
useInputFileUID = false;
+ }
+ else {
#if GDCM_MAJOR_VERSION < 2
gdcmIO->SetKeepOriginalUID(true);
#endif
- }
- else {
namesGenerator->SetOutputDirectory( m_ArgsInfo.outputDir_arg );
filenames_out = namesGenerator->GetOutputFileNames();
}
// study description
if (studyUIDGiven || m_ArgsInfo.newStudyUID_flag) {
if (!studyIDGiven)
- itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), studyIDKey, m_ArgsInfo.outputDir_arg );
+ itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), studyIDKey,itksys::SystemTools::GetFilenameName( m_ArgsInfo.outputDir_arg ));
if (!studyDescriptionGiven)
- itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), studyDescriptionKey, m_ArgsInfo.outputDir_arg );
+ itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), studyDescriptionKey,itksys::SystemTools::GetFilenameName( m_ArgsInfo.outputDir_arg ));
itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), "0008|0020", instanceDate.str() );
itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), "0008|0030", instanceTime.str() );
// series description/number
if (seriesUIDGiven || m_ArgsInfo.newSeriesUID_flag) {
if (!seriesDescriptionGiven)
- itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), seriesDescriptionKey, m_ArgsInfo.outputDir_arg );
+ itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), seriesDescriptionKey, itksys::SystemTools::GetFilenameName(m_ArgsInfo.outputDir_arg) );
if (!seriesNumberGiven)
- itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), seriesNumberKey, m_ArgsInfo.outputDir_arg );
+ itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), seriesNumberKey, itksys::SystemTools::GetFilenameName(m_ArgsInfo.outputDir_arg) );
itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), "0008|0012", instanceDate.str() );
itk::EncapsulateMetaData<std::string>( *((*dictionary)[fni]), "0008|0013", instanceTime.str() );