38 for (
auto tagIter = tags.cbegin(); tagIter != tags.cend(); ++tagIter )
40 this->AddTag( *tagIter );
46 m_ScannedTags.insert(path);
51 for (
const auto& path : paths)
53 this->AddTagPath(path);
59 m_InputFilenames = filenames;
66 OFListConstIterator(DcmPathNode*) it = dcmpath->begin();
67 OFListConstIterator(DcmPathNode*) endOfList = dcmpath->end();
68 OFString pathStr; DcmEVR vr; DcmObject* obj;
70 while (it != endOfList)
72 if (((*it) == NULL) || ((*it)->m_obj == NULL))
74 mitkThrow() <<
"Error in DcmPathToTagPath(). Invalid search result";
79 if ((vr == EVR_SQ) || (obj->isLeaf()))
81 result.
AddElement(obj->getTag().getGroup(), obj->getTag().getElement());
83 else if ((vr == EVR_item) || (vr == EVR_dataset))
85 if (result.
Size() > 0)
92 mitkThrow() <<
"Error in DcmPathToTagPath(). DCMTK path is illegal due to toplevel sequence item.";
111 DcmPathProcessor processor;
112 processor.setItemWildcardSupport(
true);
116 for (
const auto& fileName : this->m_InputFilenames)
119 OFCondition cond = dfile.loadFile(fileName.c_str());
122 MITK_ERROR <<
"Error when scanning for tags. Cannot open given file. File: " << fileName;
128 for (
const auto& path : this->m_ScannedTags)
131 cond = processor.findOrCreatePath(dfile.getDataset(), tagPath.c_str());
134 OFList< DcmPath * > findings;
135 processor.getResults(findings);
136 for (
const auto& finding : findings)
138 auto element =
dynamic_cast<DcmElement*
>(finding->back()->m_obj);
141 auto item =
dynamic_cast<DcmItem*
>(finding->back()->m_obj);
144 element = item->getElement(finding->back()->m_itemNo);
151 cond = element->getOFStringArray(value);
160 newCache->AddFrameInfo(info);
178 return m_Cache.GetPointer();
183 if (m_Cache.IsNotNull())
185 return m_Cache->GetFrameInfoList();
DICOMTagPath & AddElement(unsigned int group, unsigned int element)
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.
PathIndexType AddNode(const NodeInfo &newNode)
static void info(const char *fmt,...)
PathIndexType Size() const
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
ItemSelectionIndex selection
MITKDICOMREADER_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath &tagPath)