Anyone know how to read Analyze ObjectMap files?

Thanks very much for the advice everyone. :+1:

Based on the clues given here, we were able to go back to Analyze and export both the CT image and the object map as Analyze 7.5 .hdr/.img files with the same pixel dimensions. Loading those in Slicer, the A/P direction was flipped and the label volume had identity IJKToRAS transform. Flipping in A/P and copying over the matrix with the python code below gave this image:

ctPath = "/opt/data/SlicerSpine/Muscle data/Muscle data/Muscle data/E15558S301.hdr"
objPath = "/opt/data/SlicerSpine/Muscle data/Muscle data/15558_ObjectMap.hdr"

ctNode = slicer.util.loadVolume(ctPath)
labelNode = slicer.util.loadLabelVolume(objPath)

ijkToRAS = vtk.vtkMatrix4x4()
ctNode.GetIJKToRASMatrix(ijkToRAS)
ijkToRAS.SetElement(1,1, -1 * ijkToRAS.GetElement(1,1))
ctNode.SetIJKToRASMatrix(ijkToRAS)
labelNode.SetIJKToRASMatrix(ijkToRAS)

Converting to a segmentation and using Fill between Slices gave this result, which looks promising. We have over 100 of these so we hope to be able to train a MONAI Label model to segment these muscles.

I’ll also note that while the .hrd / .img files worked in the end, it looked like the same pixel data could be extracted using the objparser python code, but the header doesn’t include the pixel geometry so you need the .hdr of the source image for the object map to be of use (probably the ITK code could also work to get the pixels, but I didn’t have a chance to try). The object map file does include all the label identifiers so ultimately I will be using that information to assign the proper names to the muscles.

3 Likes