Specifying coordinate system in surface mesh file

Hi,

I have a related question regarding file formats and coordinate systems.

We’re having 3d images and models (meshes) that are generated with ITK. We promised to publish the data such that it’s compatible with ITK and currently store the images as .mha files and the meshes as .vtk files.

However, when others want to view the data with Slicer one has to transform either the mesh or the volume so that they align.

Is there a way to store image volumes and corresponding meshes so that they align in ITK and Slicer?

Best,
Christian

I would say the best would be to provide an ITK code example that applies the transform after the reader step. As @lassoan and @fedorov mentioned, there’s no accepted standard to represent the coordinate system of polydata formats except in dicom (to our knowledge).

On the other hand, a basic dicom surface segmentation format is relatively simple, so it could be easiest to add support for that. Surface segmentations are not widely used they are standard and perhaps we should encourage the use of it.

I did a prototype of a surface segmentation reader for Slicer but didn’t have any public sample data so I never finished it. I did work for the data I had. I think it would be feasible to do something similar for ITK and also create a basic exporter for both system.

It would be great to finally solve this annoying issue.

I would try to add a custom tag in the header of the mesh file that follows how anatomical orientation is already specified in a well-established file format. For example, we could use NRRD format’s space attribute: space: left-posterior-superior.

Using some DICOM definition would be nice, too, but I think in DICOM the space is LPS by definition, so I’m not sure if there is a way to specify other anatomical orientations.

It would depend on each file format how this metadata could be stored. For example, in STL there is a comment line and there are examples how to store additional metadata.

While we are at it, it might be useful to also add a unit field. As in medical imaging everybody uses mm, but if you export from CAD software, blender, etc. then sometimes the unit is m, inch, 1/10 inch, etc.

I agree, it would be great to add the ability to save/load DICOM surface segmentation objects. For the next 10-20 years we also need to offer robust saving/loading of other commonly formats (STL, PLY, …).

Thanks for the answers.

Our plan was also to explain the issue to users of the data and provide examples how to deal with it.

I was just hoping that there might be an off the shelf solution that doesn’t need extra explanation. It seems to be such a trivial task.

For vtk formats you can store anything you want in field data for the dataset. For example, I have saved color, origin and spacing.

Yes, for now adding a custom flag in the vtk metadata and some example itk import code is probably the best.

Added a ticket to track this task: Save coordinate system in surface mesh file · Issue #4408 · Slicer/Slicer · GitHub

2 Likes