Mercurial > hg > orthanc
comparison OrthancServer/ServerJobs/SplitStudyJob.h @ 3941:771dbd9eb3bd transcoding
class CleaningInstancesJob to share cleaning code by merge/split jobs
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 18 May 2020 18:20:19 +0200 |
parents | 94f4a18a79cc |
children |
comparison
equal
deleted
inserted
replaced
3940:3661e2a72482 | 3941:771dbd9eb3bd |
---|---|
31 **/ | 31 **/ |
32 | 32 |
33 | 33 |
34 #pragma once | 34 #pragma once |
35 | 35 |
36 #include "../../Core/JobsEngine/SetOfInstancesJob.h" | |
37 #include "../../Core/DicomFormat/DicomTag.h" | 36 #include "../../Core/DicomFormat/DicomTag.h" |
38 #include "../DicomInstanceOrigin.h" | 37 #include "../DicomInstanceOrigin.h" |
38 #include "CleaningInstancesJob.h" | |
39 | 39 |
40 namespace Orthanc | 40 namespace Orthanc |
41 { | 41 { |
42 class ServerContext; | 42 class ServerContext; |
43 | 43 |
44 class SplitStudyJob : public SetOfInstancesJob | 44 class SplitStudyJob : public CleaningInstancesJob |
45 { | 45 { |
46 private: | 46 private: |
47 typedef std::map<std::string, std::string> SeriesUidMap; | 47 typedef std::map<std::string, std::string> SeriesUidMap; |
48 typedef std::map<DicomTag, std::string> Replacements; | 48 typedef std::map<DicomTag, std::string> Replacements; |
49 | 49 |
50 | 50 |
51 ServerContext& context_; | |
52 std::set<DicomTag> allowedTags_; | 51 std::set<DicomTag> allowedTags_; |
53 bool keepSource_; | |
54 std::string sourceStudy_; | 52 std::string sourceStudy_; |
55 std::string targetStudy_; | 53 std::string targetStudy_; |
56 std::string targetStudyUid_; | 54 std::string targetStudyUid_; |
57 SeriesUidMap seriesUidMap_; | 55 SeriesUidMap seriesUidMap_; |
58 DicomInstanceOrigin origin_; | 56 DicomInstanceOrigin origin_; |
64 void Setup(); | 62 void Setup(); |
65 | 63 |
66 protected: | 64 protected: |
67 virtual bool HandleInstance(const std::string& instance); | 65 virtual bool HandleInstance(const std::string& instance); |
68 | 66 |
69 virtual bool HandleTrailingStep(); | |
70 | |
71 public: | 67 public: |
72 SplitStudyJob(ServerContext& context, | 68 SplitStudyJob(ServerContext& context, |
73 const std::string& sourceStudy); | 69 const std::string& sourceStudy); |
74 | 70 |
75 SplitStudyJob(ServerContext& context, | 71 SplitStudyJob(ServerContext& context, |
89 { | 85 { |
90 return targetStudyUid_; | 86 return targetStudyUid_; |
91 } | 87 } |
92 | 88 |
93 void AddSourceSeries(const std::string& series); | 89 void AddSourceSeries(const std::string& series); |
94 | |
95 bool IsKeepSource() const | |
96 { | |
97 return keepSource_; | |
98 } | |
99 | |
100 void SetKeepSource(bool keep); | |
101 | 90 |
102 bool LookupTargetSeriesUid(std::string& uid, | 91 bool LookupTargetSeriesUid(std::string& uid, |
103 const std::string& series) const; | 92 const std::string& series) const; |
104 | 93 |
105 void Replace(const DicomTag& tag, | 94 void Replace(const DicomTag& tag, |