| 183 | |
| 184 | |
| 185 | mitk::Point3D mitk::DICOMStringToPoint3D( const std::string& s, bool& successful ) |
| 186 | { |
| 187 | Point3D p; |
| 188 | successful = true; |
| 189 | |
| 190 | try |
| 191 | { |
| 192 | std::vector<std::string> strs; |
| 193 | boost::split( strs, s, boost::is_any_of( "\\" ) ); |
| 194 | if ( strs.size() == 3 ) |
| 195 | { |
| 196 | for ( int i = 0; i < 3; ++i ) |
| 197 | { |
| 198 | p[i] = OFStandard::atof( strs[i].c_str() ); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | catch ( const std::exception& /*e*/ ) |
| 203 | { |
| 204 | p.Fill( 0.0 ); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | return p; |
| 209 | } |