class_docstr: Reads an svg file and exports paths to a JSON format.
  
  Only segments and Bezier curves are supported
code: def _type_and_pts(self, obj):
      if isinstance(obj, svg.Bezier):
          my_type = "bezier"
          pts = [p.coord() for p in obj.pts]
      elif isinstance(obj, svg.Segment):
          my_type = "segment"
          pts = [p.coord() for p in (obj.start, obj.end)]
      else:
          msg = f"{obj.__class__} is not a supported class"
          raise TypeError(msg)
  
      # svg has its origin in the top left whereas
      # matplotlib has its origin at the bottom left
      # need to apply a mirror symmetry
      pt_min, pt_max = self.svg.bbox()
      y_range = pt_max.y - pt_min.y
  
      pts = [(x, y_range - y) for x, y in pts]
  
      return {"type": my_type, "pts": pts}
  
file_path: nilearn/nilearn/plotting/glass_brain_files/svg_to_json_converter.py
imports: import json
  import re
  import sys
label_desc: Use image node_id 3 for calling the SVGToJSONConverter obj's underlying member method code with example usage: obj._type_and_pts(obj) and returns: dict