Deciphering a coordinate system in an XML file

In summary, the person is asking for help with understanding an XML file which contains image data. The person has two similar files which together form a 3D image. The person has tried to plot the data in various ways but has not been successful.
  • #1
neu
230
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
  • #2
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.
 
  • #3
It would help if you showed the XML header (where they refer to a DTD - Document Type Definition).
 
  • #4
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.
 

1. What is a coordinate system in an XML file?

A coordinate system in an XML file is a set of rules and conventions for defining and representing spatial data. It includes information such as the units of measurement, the origin point, and the direction of axes.

2. How is a coordinate system represented in an XML file?

A coordinate system in an XML file is typically represented using a combination of elements and attributes. This can vary depending on the specific XML schema being used, but common elements include crs (coordinate reference system) and axisLabels, while common attributes include units and origin.

3. Why is it important to decipher a coordinate system in an XML file?

Deciphering a coordinate system in an XML file is important because it allows us to accurately interpret and analyze spatial data. Without understanding the coordinate system, we may misinterpret the data and make incorrect conclusions or decisions.

4. How can I determine the coordinate system in an XML file?

The best way to determine the coordinate system in an XML file is to refer to the documentation or metadata associated with the file. This should provide information on the coordinate system used, including the schema, units, and any transformations that may have been applied.

5. Can multiple coordinate systems be used in the same XML file?

Yes, it is possible for an XML file to contain multiple coordinate systems. This can be useful when working with data from different sources or with different projections. However, it is important to clearly define and document which coordinate system is being used for each set of data within the file.

Similar threads

  • Programming and Computer Science
Replies
19
Views
981
  • Programming and Computer Science
Replies
2
Views
319
Replies
3
Views
2K
  • Advanced Physics Homework Help
Replies
11
Views
1K
Replies
1
Views
989
  • Programming and Computer Science
Replies
2
Views
2K
  • General Discussion
Replies
18
Views
11K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Programming and Computer Science
Replies
6
Views
2K
Back
Top