| 174 | } |
| 175 | |
| 176 | bool mitk::CustomTagParser::IsT1Sequence(std::string preparationType, |
| 177 | std::string recoveryMode, |
| 178 | std::string spoilingType, |
| 179 | std::string revisionString) |
| 180 | { |
| 181 | bool isT1 = false; |
| 182 | |
| 183 | // if a forced parse strategy is set, use that one |
| 184 | if ("T1" == m_ParseStrategy) |
| 185 | { |
| 186 | return true; |
| 187 | } |
| 188 | if ("CEST/WASABI" == m_ParseStrategy) |
| 189 | { |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | if (("T1Recovery" == preparationType) || ("T1Inversion" == preparationType)) |
| 194 | { |
| 195 | isT1 = true; |
| 196 | } |
| 197 | |
| 198 | // How to interpret the recoveryMode depends on the age of the sequence |
| 199 | // older sequences use 0 = false and 1 = true, newer ones 1 = false and 2 = true. |
| 200 | // A rough rule of thumb is to assume that if the SpoilingType is 0, then the first |
| 201 | // convention is chosen, if it is 1, then the second applies. Otherwise |
| 202 | // we assume revision 1485 and newer to follow the new convention. |
| 203 | // This unfortunate heuristic is due to somewhat arbitrary CEST sequence implementations. |
| 204 | if (!isT1) |
| 205 | { |
| 206 | std::string thisIsTrue = "1"; |
| 207 | std::string thisIsFalse = "0"; |
| 208 | if ("0" == spoilingType) |
| 209 | { |
| 210 | thisIsFalse = "0"; |
| 211 | thisIsTrue = "1"; |
| 212 | } |
| 213 | else if ("1" == spoilingType) |
| 214 | { |
| 215 | thisIsFalse = "1"; |
| 216 | thisIsTrue = "2"; |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | int revisionNrWeAssumeToBeDifferenciating = 1485; |
| 221 | if (std::stoi(revisionString) - revisionNrWeAssumeToBeDifferenciating < 0) |
| 222 | { |
| 223 | thisIsFalse = "0"; |
| 224 | thisIsTrue = "1"; |
| 225 | } |
| 226 | else |
| 227 | { |
| 228 | thisIsFalse = "1"; |
| 229 | thisIsTrue = "2"; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | if (thisIsFalse == recoveryMode) |
no outgoing calls
no test coverage detected