How can I calculate an area on a CT image. I can calculate volumes (mm^3) but not areas (mm^2)

It computes the area of the closed curve, even if the curve points are not coplanar because they were picked from a model surface. A soap-bubble-like surface is computed for 3D curves and surface of that is reported.

To see that surface, you can use this code snippet:

curve=slicer.util.getNodesByClass("vtkMRMLMarkupsClosedCurveNode")[0]
crossSectionSurface = vtk.vtkPolyData()
areaMm2 = slicer.modules.markups.logic().GetClosedCurveSurfaceArea(curve, crossSectionSurface)
crossSectionSurfaceModel = slicer.modules.models.logic().AddModel(crossSectionSurface)
crossSectionSurfaceModel.SetName("{0} surface".format(curve.GetName()))
crossSectionSurfaceModel.CreateDefaultDisplayNodes()
crossSectionSurfaceModel.GetDisplayNode().BackfaceCullingOff()
crossSectionSurfaceModel.GetDisplayNode().SetColor(curve.GetDisplayNode().GetColor())
crossSectionSurfaceModel.GetDisplayNode().SetOpacity(0.5)
crossSectionSurfaceModel.SetDescription("Area[mm2] = {0:.2f}".format(areaMm2))
print("Curve {0}: surface area = {1:.2f} mm2".format(curve.GetName(), areaMm2))