IJK coordinates are voxel indices. If you don’t have a volume, only models then there are no voxels, and there are no IJK coordinates.
A segmentation can store various representations. If it contains labelmap representation then you can retrieve its geometry using this code snippet:
segmentationNode = getNode('Segmentation')
commonGeometryString = segmentationNode.GetSegmentation().DetermineCommonLabelmapGeometry(slicer.vtkSegmentation.EXTENT_UNION_OF_SEGMENTS, None)
commonGeometryImage = slicer.vtkOrientedImageData()
slicer.vtkSegmentationConverter.DeserializeImageGeometry(commonGeometryString, commonGeometryImage, False)
ijkToRas = vtk.vtkMatrix4x4()
This is so complex because it the geometry of the internal binary labelmap representations of a segmentation is an internal implementation details that generally you should generally not rely on. For example, if you import a model and “Crop to reference image geometry” representation conversion option is disabled then internal labelmap’s geometry may change.
Instead, if you want to manipulate labelmap representation in segments, it is simpler and more clear if you export the internal labelmap representation of segments to labelmap volume node(s).