{
  "name": "napari-stl-exporter",
  "display_name": "napari-stl-exporter",
  "visibility": "public",
  "icon": "",
  "categories": [],
  "schema_version": "0.1.0",
  "on_activate": null,
  "on_deactivate": null,
  "contributions": {
    "commands": [
      {
        "id": "napari-stl-exporter.write_labels",
        "title": "Write Labels",
        "python_name": "napari_stl_exporter._writer:napari_write_labels",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.write_surface",
        "title": "Write Surface",
        "python_name": "napari_stl_exporter._writer:napari_write_surfaces",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.make_pyramid_label",
        "title": "Create a label image of a pyramid",
        "python_name": "napari_stl_exporter._sample_data:make_pyramid_label",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.make_pyramid_surface",
        "title": "Create a surface image of a pyramid",
        "python_name": "napari_stl_exporter._sample_data:make_pyramid_surface",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.import_surface",
        "title": "Read surface data from supported file types",
        "python_name": "napari_stl_exporter._reader:get_reader",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.convert_image_to_surface",
        "title": "Convert 2D image data to surface",
        "python_name": "napari_stl_exporter._image_to_surface:image_to_surface_widget",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      },
      {
        "id": "napari-stl-exporter.extrude",
        "title": "Extrude mesh",
        "python_name": "napari_stl_exporter._image_to_surface:extrude_widget",
        "short_title": null,
        "category": null,
        "icon": null,
        "enablement": null
      }
    ],
    "readers": [
      {
        "command": "napari-stl-exporter.import_surface",
        "filename_patterns": [
          "*.stl",
          "*.ply",
          "*.obj"
        ],
        "accepts_directories": false
      }
    ],
    "writers": [
      {
        "command": "napari-stl-exporter.write_labels",
        "layer_types": [
          "labels"
        ],
        "filename_extensions": [
          ".stl",
          ".ply",
          ".obj"
        ],
        "display_name": "labels"
      },
      {
        "command": "napari-stl-exporter.write_surface",
        "layer_types": [
          "surface"
        ],
        "filename_extensions": [
          ".stl",
          ".ply",
          ".obj"
        ],
        "display_name": "surface"
      }
    ],
    "widgets": [
      {
        "command": "napari-stl-exporter.convert_image_to_surface",
        "display_name": "2D Image to surface",
        "autogenerate": false
      },
      {
        "command": "napari-stl-exporter.extrude",
        "display_name": "Extrude mesh",
        "autogenerate": false
      }
    ],
    "sample_data": [
      {
        "command": "napari-stl-exporter.make_pyramid_label",
        "key": "PLL",
        "display_name": "Pyramid label image"
      },
      {
        "command": "napari-stl-exporter.make_pyramid_surface",
        "key": "PSL",
        "display_name": "Pyramid surface"
      },
      {
        "command": "napari-stl-exporter.make_landscape_image",
        "key": "LEM",
        "display_name": "Landscape elevation model"
      }
    ],
    "themes": null,
    "menus": {},
    "submenus": null,
    "keybindings": null,
    "configuration": []
  },
  "package_metadata": {
    "metadata_version": "2.1",
    "name": "napari-stl-exporter",
    "version": "0.1.5",
    "dynamic": null,
    "platform": null,
    "supported_platform": null,
    "summary": "Exports label images to 3D-printable stl files.",
    "description": "# napari-stl-exporter\n\n[![License](https://img.shields.io/pypi/l/napari-stl-exporter.svg?color=green)](https://github.com/jo-mueller/napari-stl-exporter/raw/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-stl-exporter.svg?color=green)](https://pypi.org/project/napari-stl-exporter)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-stl-exporter.svg?color=green)](https://python.org)\n[![tests](https://github.com/jo-mueller/napari-stl-exporter/workflows/tests/badge.svg)](https://github.com/jo-mueller/napari-stl-exporter/actions)\n[![codecov](https://codecov.io/gh/jo-mueller/napari-stl-exporter/branch/main/graph/badge.svg?token=9zctLzazD9)](https://codecov.io/gh/jo-mueller/napari-stl-exporter)\n\nThis plugin allows to import and export surface data in Napari to common file formats. The generated file formats can be read by other common applications, and - in particular - allow *3D-printing*.\n\n![](https://github.com/jo-mueller/napari-stl-exporter/raw/main/doc/model_and_printed_model.png)\n\n\n### Supported file formats:\nCurrently supported file formats for export include and rely on the [vedo io API](https://vedo.embl.es/autodocs/content/vedo/io.html#vedo.io).\n* *.stl*: [Standard triangle language](https://en.wikipedia.org/wiki/STL_%28file_format%29)\n* *.ply*: [Polygon file format](https://en.wikipedia.org/wiki/PLY_(file_format))\n* *.obj*: [Wavefront object](https://en.wikipedia.org/wiki/Wavefront_.obj_file)\n\n### Supported Napari layers:\n\nCurrently supported Napari layer types are:\n* [Surface layers](https://napari.org/howtos/layers/surface.html)\n* [Label layers](https://napari.org/howtos/layers/labels.html): The label data is converted to surface data under the hood using the [marching cubes algorithm](https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.marching_cubes) implemented in [scikit-image](https://scikit-image.org/) and is then exported using [Vedo](https://vedo.embl.es/). Warning: This can be slow for large image data!\n\n### Import/export\n\n**Interactively:** To export the data, simply save the selected layer with `File > Save Selected Layer(s)` and specify the file ending to be `some_file.[file_ending]`, for supported file types, see above. Similarly, supported file types can be imported into Napari with `File > `\n\n**From code**: A [Napari Label layer](https://napari.org/api/napari.layers.Labels.html) can be added to the viewer as described in the [napari reference](https://napari.org/gallery/add_labels.html?highlight=add_labels) with this code snippet:\n\n```python\nimport napari\nimport numpy as np\n\n# Load and binarize image\nlabel_image = np.zeros((100, 100, 100), dtype=int)\nlabel_image[25:75, 25:75, 25:75] = 1\n\n# Add data to viewer\nviewer = napari.Viewer()\nlabel_layer = viewer.add_labels(data, name='3D object')\n\n# save the layer as 3D printable file to disc\nnapari.save_layers(r'/some/path/test.stl', [label_layer])\n```\n\n### Sample data\nYou can create sample label/surface data for export using the built-in functions as shown here:\n\n![](https://github.com/jo-mueller/napari-stl-exporter/raw/main/doc/1_sample_data.png)\n\n...or from code with\n\n```Python\nimport napari_stl_exporter\n\npyramid = napari_stl_exporter.make_pyramid_surface()\n\n```\n\n### 3D-printing\nTo actually send your object to a 3D-printer, it has to be further converted to the *.gcode* format with a Slicer program. The latter convert the 3D object to machine-relevant parameters (printing detail, motor trajectories, etc). Popular slicers are:\n\n* [Slic3r](https://slic3r.org/): Documentation [here](https://manual.slic3r.org/intro/overview)\n* [Prusa Slicer](https://www.prusa3d.com/prusaslicer/): Tutorial [here](https://help.prusa3d.com/en/article/first-print-with-prusaslicer_1753)\n\n*Note*: You can also upload the STL file to [github.com](https://github.com) and interact with it in the browser:\n\n![](https://github.com/jo-mueller/napari-stl-exporter/raw/main/doc/pyramid_browser_screenshot.png)\n\n#### Digital elevation models\n\nDIgital elevation models (DEMs) can be printed with the napari-stl-exporter following these steps:\n\n1. Go to the [open topography repository](https://portal.opentopography.org/raster?opentopoID=OTSDEM.032021.4326.2) and select a region of your choice, then download it as a GeoTiff file (`.tif`, intensity encodes elevation)\n2. Open the downloaded tif image use the image conversion plugin (\u00b4Plugins > napari-stl-exporter > 2D image to surface\u00b4) to convert the downloaded image to a surface. CHeck the `solidify` option to make it readily 3D-printable.\n\n![](https://github.com/jo-mueller/napari-stl-exporter/raw/main/doc/landscape_to_surface.png)\n\n3. Export the created surface layer as `.stl` or `.ply` file. Open it in your Slicer of choice (you may have to scale it according to the size limitations of your printer) and off you go!\n\n----------------------------------\n\nThis [napari] plugin was generated with [Cookiecutter] using with [@napari]'s [cookiecutter-napari-plugin] template.\n\n<!--\nDon't miss the full getting started guide to set up your new package:\nhttps://github.com/napari/cookiecutter-napari-plugin#getting-started\n\nand review the napari docs for plugin developers:\nhttps://napari.org/docs/plugins/index.html\n-->\n\n## Installation\n\nYou can install `napari-stl-exporter` via [pip]:\n\n    pip install napari-stl-exporter\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [BSD-3] license,\n\"napari-stl-exporter\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/jo-mueller/napari-stl-exporter/issues) along with a detailed description or post to image.sc and tag ```El_Pollo_Diablo```\n\n[napari]: https://github.com/napari/napari\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n",
    "description_content_type": "text/markdown",
    "keywords": null,
    "home_page": "https://github.com/jo-mueller/napari-stl-exporter.git",
    "download_url": null,
    "author": "Johannes Soltwedel",
    "author_email": "johannes_richard.soltwedel@tu-dresden.de",
    "maintainer": null,
    "maintainer_email": null,
    "license": "BSD-3-Clause",
    "classifier": [
      "Development Status :: 3 - Alpha",
      "Intended Audience :: Developers",
      "Framework :: napari",
      "Topic :: Software Development :: Testing",
      "Programming Language :: Python",
      "Programming Language :: Python :: 3",
      "Programming Language :: Python :: 3.7",
      "Programming Language :: Python :: 3.8",
      "Programming Language :: Python :: 3.9",
      "Operating System :: OS Independent",
      "License :: OSI Approved :: BSD License"
    ],
    "requires_dist": [
      "napari",
      "scikit-image",
      "vedo (>=2023.4.6)",
      "npe2",
      "numpy"
    ],
    "requires_python": ">=3.7",
    "requires_external": null,
    "project_url": [
      "Project Site, https://github.com/jo-mueller/napari-stl-exporter",
      "Report Issues, https://github.com/jo-mueller/napari-stl-exporter/issues",
      "Documentation, https://pypi.org/project/napari-stl-exporter/",
      "User Support, https://github.com/jo-mueller/napari-stl-exporter/issues",
      "Twitter, https://twitter.com/jm_mightypirate"
    ],
    "provides_extra": null,
    "provides_dist": null,
    "obsoletes_dist": null
  },
  "npe1_shim": false
}