Deciphering a coordinate system in an XML file

AI Thread Summary
The discussion centers around handling a library of XML files containing image data represented in a specific coordinate system. The XML structure includes segments with positions and indices, where the positions represent 3D coordinates and the indices define how these coordinates form triangles. A notable observation is that one segment has double the number of indices compared to positions, suggesting a complex relationship in how the data is structured. The user is seeking assistance in plotting this data and suspects that the backslash delimitation may relate to DICOM format syntax. There is a suggestion to provide the XML header or a Document Type Definition (DTD) or XML Schema Definition (XSD) for better context and understanding of the data structure.
neu
Messages
228
Reaction score
3
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.

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:
Technology news on Phys.org
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.
 
It would help if you showed the XML header (where they refer to a DTD - Document Type Definition).
 
Svein said:
It would help if you showed the XML header (where they refer to a DTD - Document Type Definition).
Or alternatively, an XSD - XML Schema Definition.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top