| 33 | RTPlanReader::~RTPlanReader(){} |
| 34 | |
| 35 | std::vector<itk::SmartPointer<BaseData> > RTPlanReader::Read() |
| 36 | { |
| 37 | std::vector<itk::SmartPointer<mitk::BaseData> > result; |
| 38 | |
| 39 | auto tagsOfInterest = m_DICOMTagsOfInterestService->GetTagsOfInterest(); |
| 40 | DICOMTagPathList tagsOfInterestList; |
| 41 | for (const auto& tag : tagsOfInterest){ |
| 42 | tagsOfInterestList.push_back(tag.first); |
| 43 | } |
| 44 | |
| 45 | std::string location = GetInputLocation(); |
| 46 | mitk::StringList files = { location }; |
| 47 | mitk::DICOMDCMTKTagScanner::Pointer scanner = mitk::DICOMDCMTKTagScanner::New(); |
| 48 | scanner->SetInputFiles(files); |
| 49 | scanner->AddTagPaths(tagsOfInterestList); |
| 50 | scanner->Scan(); |
| 51 | |
| 52 | mitk::DICOMDatasetAccessingImageFrameList frames = scanner->GetFrameInfoList(); |
| 53 | if (frames.empty()){ |
| 54 | MITK_ERROR << "Error reading the RTPLAN file" << std::endl; |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | auto findings = ExtractPathsOfInterest(tagsOfInterestList, frames); |
| 59 | |
| 60 | //just create empty image. No image information available in RTPLAN. But properties will be attached. |
| 61 | Image::Pointer dummyImage = Image::New(); |
| 62 | SetProperties(dummyImage, findings); |
| 63 | |
| 64 | result.push_back(dummyImage.GetPointer()); |
| 65 | |
| 66 | return result; |
| 67 | } |
| 68 | |
| 69 | RTPlanReader* RTPlanReader::Clone() const |
| 70 | { |