Skip to content

Commit

Permalink
Update ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
r03ert0 authored Aug 16, 2023
1 parent 088be7a commit 887cb11
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ from microdraw import microdraw as mic

### Download and upload datasets from microdraw
`download_all_regions_from_dataset(source, project, token, microdraw_url='https://microdraw.pasteur.fr')`
Download all regions in all slices in a dataset
Download all regions in all slices in a dataset.

`download_all_regions_from_dataset_slice(source, project, slce, token, backups=False, microdraw_url='https://microdraw.pasteur.fr')`
Download all regions in a dataset slice
Download all regions in a slice in a dataset.

`download_dataset_definition(source)`
Download a dataset. A dataset can contain several slices, each with several regions
Expand All @@ -24,7 +24,10 @@ from microdraw import microdraw as mic
Download microdraw contours as polygons, taking care of childrens, lines and bezier curves.

`download_project_definition(project, token)`
Download a project. A project can contain several datasets
Download a project. A project can contain several datasets.

`upload_polygons_to_microdraw_slice(source, project, slice_index, token, polygons, name, rgb, host="https://microdraw.pasteur.fr/api/upload")`
Upload polygons to a microdraw slice.

### Load and save datasets locally
`load_dataset(path)`
Expand All @@ -33,6 +36,22 @@ from microdraw import microdraw as mic
`save_dataset(data, path)`
save dataset in json format

### Conversion between MicroDraw json and polygons
`convert_polygons_to_microdraw_json(lines, name, rgb)`
Convert an array of lines (a series of vertices) into Microdraw JSON
format (which is the default Paper.js format)

`paperjs_path_to_polygon(co)`
Convert Paper.js paths to a polygon (a line made of consecutive vertices).

Note: Paper.js Bézier curves are encoded as px, py, ax, ay, bx, by,
where px, py is an anchor point, ax, ay is the previous handle and
bx, by the next handle. SVG path tools use a more standard encoding:
p1x,p1y, b1x, b1y, a2x, a2y, p2x, p2y, where p1x, p1y is the start
anchor point, p2x, p2y the end anchor point, b1x, b1y is the
handle coming out from p1x, p1y, and a2x, a2y is the handle entering
into the end anchor point.

### Others
`assignments(a, b, P, projection_type='line')`

Expand All @@ -56,10 +75,6 @@ from microdraw import microdraw as mic
in edge_soup. Returns an array of lines where each element is a
continuous line composed of string of neighbouring vertices

`convert_polygons_to_microdraw_json(lines, name, rgb)`
Convert an array of lines (a series of vertices) into Microdraw JSON
format (which is the default Paper.js format)

`dataset_as_volume(dataset, filter=None)`
Combine all regions into a single mesh. This mesh does not have triangles, only region contours.
dataset: the dataset from which to obtain the region contours
Expand Down Expand Up @@ -104,17 +119,6 @@ from microdraw import microdraw as mic
`vert_point_and_coord` and edges in `contour`. The indices in
`contour` are re-indexed accordingly.

`paperjs_path_to_polygon(co)`
Convert Paper.js paths to a polygon (a line composed of consecutive vertices).

Note: Paper.js Bézier curves are encoded as px, py, ax, ay, bx, by,
where px, py is an anchor point, ax, ay is the previous handle and
bx, by the next handle. SVG path tools use a more standard encoding:
p1x,p1y, b1x, b1y, a2x, a2y, p2x, p2y, where p1x, p1y is the start
anchor point, p2x, p2y the end anchor point, b1x, b1y is the
handle coming out from p1x, p1y, and a2x, a2y is the handle entering
into the end anchor point.

`raw_contour(v, f, x)`
Obtain the contour produced by slicing the mesh with vertices v
and faces f at coordinate x in the last dimension. Produces a
Expand Down

0 comments on commit 887cb11

Please sign in to comment.