comparison Core/DicomParsing/IDicomTranscoder.cpp @ 3951:5fe8c6d3212e transcoding

removed useless information "hasSopInstanceUidChanged"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 May 2020 21:06:53 +0200
parents 1f33ed7f82e6
children
comparison
equal deleted inserted replaced
3950:5797ca4f3b8d 3951:5fe8c6d3212e
99 } 99 }
100 } 100 }
101 101
102 102
103 void IDicomTranscoder::CheckTranscoding(IDicomTranscoder::DicomImage& transcoded, 103 void IDicomTranscoder::CheckTranscoding(IDicomTranscoder::DicomImage& transcoded,
104 bool hasSopInstanceUidChanged,
105 DicomTransferSyntax sourceSyntax, 104 DicomTransferSyntax sourceSyntax,
106 const std::string& sourceSopInstanceUid, 105 const std::string& sourceSopInstanceUid,
107 const std::set<DicomTransferSyntax>& allowedSyntaxes, 106 const std::set<DicomTransferSyntax>& allowedSyntaxes,
108 bool allowNewSopInstanceUid) 107 bool allowNewSopInstanceUid)
109 { 108 {
114 throw OrthancException(ErrorCode_InternalError); 113 throw OrthancException(ErrorCode_InternalError);
115 } 114 }
116 115
117 std::string targetSopInstanceUid = GetSopInstanceUid(parsed); 116 std::string targetSopInstanceUid = GetSopInstanceUid(parsed);
118 117
119 if (hasSopInstanceUidChanged && (targetSopInstanceUid == sourceSopInstanceUid))
120 {
121 throw OrthancException(ErrorCode_InternalError);
122 }
123
124 if (!hasSopInstanceUidChanged && (targetSopInstanceUid != sourceSopInstanceUid))
125 {
126 throw OrthancException(ErrorCode_InternalError);
127 }
128
129 if (parsed.getDataset()->tagExists(DCM_PixelData)) 118 if (parsed.getDataset()->tagExists(DCM_PixelData))
130 { 119 {
131 if (!allowNewSopInstanceUid && (targetSopInstanceUid != sourceSopInstanceUid)) 120 if (!allowNewSopInstanceUid && (targetSopInstanceUid != sourceSopInstanceUid))
132 { 121 {
133 throw OrthancException(ErrorCode_InternalError); 122 throw OrthancException(ErrorCode_InternalError);
134 } 123 }
135 } 124 }
136 else 125 else
137 { 126 {
138 if (hasSopInstanceUidChanged || 127 if (targetSopInstanceUid != sourceSopInstanceUid)
139 targetSopInstanceUid != sourceSopInstanceUid)
140 { 128 {
141 throw OrthancException(ErrorCode_InternalError, 129 throw OrthancException(ErrorCode_InternalError,
142 "No pixel data: Transcoding must not change the SOP instance UID"); 130 "No pixel data: Transcoding must not change the SOP instance UID");
143 } 131 }
144 } 132 }
150 } 138 }
151 139
152 if (allowedSyntaxes.find(sourceSyntax) != allowedSyntaxes.end()) 140 if (allowedSyntaxes.find(sourceSyntax) != allowedSyntaxes.end())
153 { 141 {
154 // No transcoding should have happened 142 // No transcoding should have happened
155 if (targetSopInstanceUid != sourceSopInstanceUid || 143 if (targetSopInstanceUid != sourceSopInstanceUid)
156 hasSopInstanceUidChanged)
157 { 144 {
158 throw OrthancException(ErrorCode_InternalError); 145 throw OrthancException(ErrorCode_InternalError);
159 } 146 }
160 } 147 }
161 148