14 #include "mitkRTPlanReader.h" 25 RTPlanReader::RTPlanReader() : AbstractFileReader(IOMimeTypes::DICOM_MIMETYPE_NAME(),
"DICOM RTPlan File Reader") {
33 RTPlanReader::~RTPlanReader(){}
35 std::vector<itk::SmartPointer<BaseData> > RTPlanReader::Read()
37 std::vector<itk::SmartPointer<mitk::BaseData> > result;
39 auto tagsOfInterest = m_DICOMTagsOfInterestService->GetTagsOfInterest();
41 for (
const auto& tag : tagsOfInterest){
42 tagsOfInterestList.push_back(tag.first);
48 scanner->SetInputFiles(files);
49 scanner->AddTagPaths(tagsOfInterestList);
54 MITK_ERROR <<
"Error reading the RTPLAN file" << std::endl;
64 result.push_back(dummyImage.GetPointer());
71 return new RTPlanReader(*
this);
76 std::vector<mitk::DICOMDatasetAccess::FindingsListType > findings;
77 for (
const auto& entry : pathsOfInterest){
78 findings.push_back(frames.front()->GetTagValueAsString(entry));
85 for (
const auto& finding : findings){
86 for (
const auto& entry : finding){
89 property->SetValue(entry.value);
90 image->SetProperty(propertyName.c_str(), property);
100 if (!toiRegisters.empty())
102 if (toiRegisters.size() > 1)
104 MITK_WARN <<
"Multiple DICOM tags of interest services found. Using just one.";
MITKDICOMREADER_EXPORT FindingsListVectorType ExtractPathsOfInterest(const DICOMTagPathList &pathsOfInterest, const DICOMDatasetAccessingImageFrameList &frames)
std::vector< mitk::DICOMDatasetAccess::FindingsListType > FindingsListVectorType
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
void * GetService(const ServiceReferenceBase &reference)
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath &tagPath)
us::ServiceRegistration< IFileReader > RegisterService(us::ModuleContext *context=us::GetModuleContext())
mitk::Image::Pointer image
std::vector< ServiceReferenceU > GetServiceReferences(const std::string &clazz, const std::string &filter=std::string())
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
MITKDICOMREADER_EXPORT void SetProperties(BaseDataPointer image, const FindingsListVectorType &findings)
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
MITKDICOMREADER_EXPORT mitk::IDICOMTagsOfInterest * GetDicomTagsOfInterestService()
std::string GetInputLocation() const override
Get the current input location.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.