(parent, dataset, datasetId, context, depth, requested_fields = ["Normals", "TCoords"])
| 918 | |
| 919 | |
| 920 | def imagedataSerializer(parent, dataset, datasetId, context, depth, requested_fields = ["Normals", "TCoords"]): |
| 921 | if hasattr(dataset, "GetDirectionMatrix"): |
| 922 | direction = [dataset.GetDirectionMatrix().GetElement(0, i) for i in range(9)] |
| 923 | else: |
| 924 | direction = [1, 0, 0, 0, 1, 0, 0, 0, 1] |
| 925 | |
| 926 | # Extract dataset fields |
| 927 | fields = [] |
| 928 | extractRequiredFields(fields, parent, dataset, context, "*") |
| 929 | |
| 930 | return { |
| 931 | "parent": getReferenceId(parent), |
| 932 | "id": datasetId, |
| 933 | "type": class_name(dataset), |
| 934 | "properties": { |
| 935 | "spacing": dataset.GetSpacing(), |
| 936 | "origin": dataset.GetOrigin(), |
| 937 | "dimensions": dataset.GetDimensions(), |
| 938 | "direction": direction, |
| 939 | "fields": fields, |
| 940 | }, |
| 941 | } |
| 942 | |
| 943 | |
| 944 | # ----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected