MCPcopy Create free account
hub / github.com/Kitware/VTK / imagedataSerializer

Function imagedataSerializer

Web/Python/vtkmodules/web/render_window_serializer.py:920–941  ·  view source on GitHub ↗
(parent, dataset, datasetId, context, depth, requested_fields = ["Normals", "TCoords"])

Source from the content-addressed store, hash-verified

918
919
920def 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# -----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

getReferenceIdFunction · 0.90
extractRequiredFieldsFunction · 0.85
class_nameFunction · 0.85
rangeClass · 0.50
GetSpacingMethod · 0.45
GetOriginMethod · 0.45
GetDimensionsMethod · 0.45

Tested by

no test coverage detected