21 #include <gdcmScanner.h>
35 assert(m_Cache.IsNotNull());
39 mitkThrow() <<
"Wrong usage of DICOMGDCMScanner- Called GetTagValue() before scanned at least once. No scanner cache available.";
42 return m_Cache->GetTagValue(frame, tag);
47 m_ScannedTags.insert( tag );
48 m_GDCMScanner->AddTag(
54 for (
auto tagIter = tags.cbegin(); tagIter != tags.cend(); ++tagIter )
56 this->AddTag( *tagIter );
64 std::stringstream errorstring;
65 errorstring <<
"Invalid call to DICOMGDCMTagScanner::AddTagPath(). "
66 <<
"Scanner does only support pathes that are explicitly specify one tag. "
67 <<
"Invalid path: "<<path.
ToStr();
69 throw std::invalid_argument(errorstring.str());
76 for (
const auto& path : paths)
78 if (path.Size() != 1 || !path.IsExplicit())
80 std::stringstream errorstring;
81 errorstring <<
"Invalid call to DICOMGDCMTagScanner::AddTagPaths(). "
82 <<
"Scanner does only support pathes that are explicitly specify one tag. "
83 <<
"Invalid path: " << path.ToStr();
85 throw std::invalid_argument(errorstring.str());
87 this->AddTag(path.GetFirstNode().tag);
93 m_InputFilenames = filenames;
100 m_GDCMScanner->Scan( m_InputFilenames );
103 newCache->InitCache(m_ScannedTags, m_GDCMScanner, m_InputFilenames);
111 return m_Cache.GetPointer();
117 if (m_Cache.IsNotNull())
119 result = m_Cache->GetFrameInfoList();
itk::SmartPointer< Self > Pointer
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag...
std::vector< DICOMTag > DICOMTagList
Representation of a DICOM tag.
std::string ToStr() const
Describes a frame within a DICOM file.
unsigned int GetGroup() const
PathIndexType Size() const
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
unsigned int GetElement() const
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
NodeInfo & GetFirstNode()