Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Deciphering a coordinate system in an XML file

  1. Mar 25, 2015 #1

    neu

    User Avatar

    Hello, firstly I have to make the usual apologies of ignorance and inexperience, but that's why I'm here!

    I have a library of XML files which each contain two sets of image data. Together they make something very similar to this:http://imgur.com/vjs7MRH

    The grey and red points are given in basic x,y,z coordinates, the white line picture is given in less obvious coordinate system which is shown below.

    Code (XML):
    <part>
    <skin>
    - <triangles>
    - <segment name="Step_0">
      <positions>-3\0\0\-2\0\0\-2.7029\-1.3017\0\-1.8705\-2.3455\0\-1.8019\-0.8678\0\-1.247\-1.5637\0\-0.445\-1.9499\0\-0.6676\-2.9248\0\0.6676\-2.9248\0\-1.247\1.5637\0\-2.7029\1.3017\0\-1.8705\2.3455\0\-1.8019\0.8678\0\-0.445\1.9499\0\0.445\1.9499\0\-0.6676\2.9248\0\1.8705\-2.3455\0\0.445\-1.9499\0\1.247\-1.5637\0\1.8019\-0.8678\0\2.7029\-1.3017\0\2\0\0\3\0\0\0.6676\2.9248\0\1.247\1.5637\0\1.8705\2.3455\0\1.8019\0.8678\0\2.7029\1.3017\0\2.7029\1.3017\152.5\0.6676\2.9248\152.5\1.8705\2.3455\152.5\3\0\152.5\-1.8705\2.3455\152.5\-3\0\152.5\-2.7029\1.3017\152.5\-0.6676\2.9248\152.5\-2.7029\-1.3017\152.5\-0.6676\-2.9248\152.5\-1.8705\-2.3455\152.5\1.8705\-2.3455\152.5\2.7029\-1.3017\152.5\0.6676\-2.9248\152.5\-2\0\152.5\-1.8019\-0.8678\152.5\-0.445\-1.9499\152.5\-1.247\-1.5637\152.5\-1.247\1.5637\152.5\-1.8019\0.8678\152.5\-0.445\1.9499\152.5\0.445\1.9499\152.5\1.247\-1.5637\152.5\0.445\-1.9499\152.5\1.8019\-0.8678\152.5\2\0\152.5\1.247\1.5637\152.5\1.8019\0.8678\152.5</positions>
      <indices>0\1\2\3\2\4\5\6\7\8\7\6\5\3\4\7\3\5\4\2\1\9\10\11\1\0\12\12\0\10\9\11\13\14\13\15\13\11\15\12\10\9\16\17\18\6\17\8\8\17\16\18\19\20\19\21\22\22\20\19\16\18\20\23\24\14\25\24\23\15\23\14\26\27\21\22\21\27\26\25\27\24\25\26\22\27\28\25\23\29\27\25\30\28\31\22\29\30\25\28\27\30\23\15\29\15\11\32\10\0\33\11\10\34\32\35\15\33\34\10\32\11\34\15\35\29\0\2\36\3\7\37\2\3\38\36\33\0\37\38\3\36\2\38\7\8\37\8\16\39\20\22\31\16\20\40\39\41\8\31\40\20\39\16\40\8\41\37\36\42\33\43\36\38\37\44\45\44\37\41\43\38\45\45\38\37\42\36\43\32\34\46\47\33\42\34\33\47\48\32\46\35\48\49\35\32\48\46\34\47\50\51\39\41\51\44\39\51\41\40\52\50\31\53\52\52\40\31\40\50\39\49\54\29\29\54\30\49\29\35\53\28\55\28\53\31\28\30\55\55\30\54\12\47\42\13\48\46\9\46\47\42\1\12\46\9\13\9\47\12\13\49\48\24\54\49\21\53\55\26\55\54\49\14\24\55\26\21\26\54\24\13\14\49\19\52\53\17\51\50\18\50\52\53\21\19\50\18\17\18\52\19\17\44\51\5\45\44\1\42\43\4\43\45\44\6\5\43\4\1\4\45\5\17\6\44</indices>
      </segment>
    [18 more segments]
    </triangles>
    </skin>
    </part>
    I've left out the rest of the code and other segments for brevity.

    Interestingly, this segment had double the number of <indices> elements than <positions> elements, however other segments have less than double.

    I have tried plotting this data in various ways to no avail.

    I think the backslash delimitation is part of the DICOM format syntax.

    Any help or suggestions of what this might be will be very much appreciated!.

    Thanks
     
    Last edited by a moderator: Apr 10, 2015
  2. jcsd
  3. Mar 25, 2015 #2

    jedishrfu

    Staff: Mentor

    Since it says triangles then perhaps the points are grouped to make triangles:

    1x/1y/1z/2x/2y/2z/3x/3y/3z where the 1,2,3 are the corners of the triangle and the 1x/1y/1z are the 3D coordinates of the 1st corner.
     
  4. Apr 2, 2015 #3

    Svein

    User Avatar
    Science Advisor

    It would help if you showed the XML header (where they refer to a DTD - Document Type Definition).
     
  5. Apr 10, 2015 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Or alternatively, an XSD - XML Schema Definition.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Deciphering a coordinate system in an XML file
  1. XQuery XML help (Replies: 1)

  2. Understanding XML (Replies: 3)

  3. File output (Replies: 4)

Loading...