SPIEPy


NameSPIEPy JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummarySPIEPy (Scanning Probe Image Enchanter using Python) is a Python library to improve automatic processing of SPM images.
upload_time2023-11-27 08:25:06
maintainer
docs_urlhttps://pythonhosted.org/SPIEPy/
authorStephan Zevenhuizen
requires_python>=3.8
licenseBSD-2-Clause
keywords spm scanning probe microscopy image analysis flattening nano nanotechnology
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python is a great language to use for automatic processing of scientific data.
Scanning probe microscopes (SPM) produce scientific data in the form of images,
images of surfaces that can have atomic or molecular resolutions. The microscope
produces surfaces that are not level. Before you can analyse the surface, the
surface must first be levelled (flattened). This Python library provides
routines to flatten the surface and to generate statistical data on surface
structures. Surfaces with contaminations, step edges and atomic or molecular
resolution can be handled.

SPIEPy and SPIW - MATLAB Toolbox [`source`_] are related projects. SPIEPy uses
many algorithms originally designed by the SPIW project. The performance of
these algorithms is discussed in REVIEW OF SCIENTIFIC INSTRUMENTS **84**, 113701
(2013) [`DOI`_].

.. _source: http://sourceforge.net/projects/spiw/
.. _DOI: http://dx.doi.org/10.1063/1.4827076

The library SPIEPy has the packages spiepy with the modules for the tasks
described above and spiepy.demo to generate sample data. With this sample data,
you can familiarize yourself with SPIEPy.

Dependencies
------------
SPIEPy requires the NumPy library (http://www.numpy.org), SciPy library
(http://scipy.org) and the Matplotlib library (http://matplotlib.org).

Installation
------------
Using pip::

	> pip install SPIEPy

CLASSES
-------
Im
	SPIEPy_image_structure, set attribute ``data`` with a 2D ndarray of image
	data, set all other attributes with the metadata of the image.
		
FUNCTIONS
---------
Flattening functions:

- flatten_by_iterate_mask
- flatten_by_peaks
- flatten_poly_xy
- flatten_xy

Locating functions:

- locate_masked_points_and_remove
- locate_regions
- locate_steps
- locate_troughs_and_peaks

Masking functions:

- mask_by_mean
- mask_by_troughs_and_peaks
- mask_tidy

Measuring functions:

- measure_feature_properties

Demo functions:

- list_demo_files
- load_demo_file

DATA
----
NANOMAP
	Colormap which is the standard orange colormap used my most SPM software.

Help
----
On the interpreter console use the built-in help function to get the help page
of the module, function, ...

.. code-block:: pycon

	>>> import spiepy, spiepy.demo
	>>> help(spiepy)
	...
	>>> help(spiepy.demo)
	...
	>>> help(spiepy.flatten_by_iterate_mask)
	...

**Documentation:** https://webspace.science.uu.nl/~zeven101/SPIEPy/

Example usage
-------------
.. code-block:: python

	# -*- coding: utf-8 -*-
	#
	#   Copyright © 2014 - 2017 Stephan Zevenhuizen
	#   Flattening terrace image, (09-10-2017).
	#

	import spiepy, spiepy.demo
	import matplotlib.pyplot as plt
	import numpy as np

	im = spiepy.Im()
	demos = spiepy.demo.list_demo_files()
	print(demos)
	im.data = spiepy.demo.load_demo_file(demos[1])

	plt.imshow(im.data, cmap = spiepy.NANOMAP, origin = 'lower')
	print('Original image.')
	plt.show()

	im_out, _ = spiepy.flatten_xy(im)
	plt.imshow(im_out.data, cmap = spiepy.NANOMAP, origin = 'lower')
	print('Preflattened image.')
	plt.show()

	mask = spiepy.locate_steps(im_out, 4)
	plot_image = np.ma.array(im_out.data, mask = mask)
	palette = spiepy.NANOMAP
	palette.set_bad('#00ff00', 1.0)
	plt.imshow(plot_image, cmap = palette, origin = 'lower')
	print('Preflattened image, mask.')
	plt.show()

	im_final, _ = spiepy.flatten_xy(im, mask)
	plt.imshow(im_final.data, cmap = spiepy.NANOMAP, origin = 'lower')
	print('Flattened image.')
	plt.show()

	y, x = np.histogram(im_out.data, bins = 200)
	ys, xs = np.histogram(im_final.data, bins = 200)
	fig, ax = plt.subplots()
	ax.plot(x[:-1], y, '-b', label = 'Standard plane flattening')
	ax.plot(xs[:-1], ys, '-r', label = 'SPIEPy stepped plane flattening')
	ax.legend(loc = 2, fancybox = True, framealpha = 0.2)
	ax.set_xlabel('z (nm)')
	ax.set_ylabel('count')
	plt.show()

Authors & affiliations
----------------------
Stephan J. M. Zevenhuizen [#]_

..	[#] Condensed Matter and Interfaces, Debye Institute for Nanomaterials
	Science, Utrecht University, Utrecht, The Netherlands.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "SPIEPy",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/SPIEPy/",
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "SPM,scanning,probe,microscopy,image,analysis,flattening,nano,nanotechnology",
    "author": "Stephan Zevenhuizen",
    "author_email": "S.J.M.Zevenhuizen@uu.nl",
    "download_url": "https://files.pythonhosted.org/packages/b6/72/2645ff6cb4cc3838060926cc6edb3d17e95938ec148b1c8f8d59c4dbd13a/SPIEPy-0.2.1.tar.gz",
    "platform": null,
    "description": "Python is a great language to use for automatic processing of scientific data.\r\nScanning probe microscopes (SPM) produce scientific data in the form of images,\r\nimages of surfaces that can have atomic or molecular resolutions. The microscope\r\nproduces surfaces that are not level. Before you can analyse the surface, the\r\nsurface must first be levelled (flattened). This Python library provides\r\nroutines to flatten the surface and to generate statistical data on surface\r\nstructures. Surfaces with contaminations, step edges and atomic or molecular\r\nresolution can be handled.\r\n\r\nSPIEPy and SPIW - MATLAB Toolbox [`source`_] are related projects. SPIEPy uses\r\nmany algorithms originally designed by the SPIW project. The performance of\r\nthese algorithms is discussed in REVIEW OF SCIENTIFIC INSTRUMENTS **84**, 113701\r\n(2013) [`DOI`_].\r\n\r\n.. _source: http://sourceforge.net/projects/spiw/\r\n.. _DOI: http://dx.doi.org/10.1063/1.4827076\r\n\r\nThe library SPIEPy has the packages spiepy with the modules for the tasks\r\ndescribed above and spiepy.demo to generate sample data. With this sample data,\r\nyou can familiarize yourself with SPIEPy.\r\n\r\nDependencies\r\n------------\r\nSPIEPy requires the NumPy library (http://www.numpy.org), SciPy library\r\n(http://scipy.org) and the Matplotlib library (http://matplotlib.org).\r\n\r\nInstallation\r\n------------\r\nUsing pip::\r\n\r\n\t> pip install SPIEPy\r\n\r\nCLASSES\r\n-------\r\nIm\r\n\tSPIEPy_image_structure, set attribute ``data`` with a 2D ndarray of image\r\n\tdata, set all other attributes with the metadata of the image.\r\n\t\t\r\nFUNCTIONS\r\n---------\r\nFlattening functions:\r\n\r\n- flatten_by_iterate_mask\r\n- flatten_by_peaks\r\n- flatten_poly_xy\r\n- flatten_xy\r\n\r\nLocating functions:\r\n\r\n- locate_masked_points_and_remove\r\n- locate_regions\r\n- locate_steps\r\n- locate_troughs_and_peaks\r\n\r\nMasking functions:\r\n\r\n- mask_by_mean\r\n- mask_by_troughs_and_peaks\r\n- mask_tidy\r\n\r\nMeasuring functions:\r\n\r\n- measure_feature_properties\r\n\r\nDemo functions:\r\n\r\n- list_demo_files\r\n- load_demo_file\r\n\r\nDATA\r\n----\r\nNANOMAP\r\n\tColormap which is the standard orange colormap used my most SPM software.\r\n\r\nHelp\r\n----\r\nOn the interpreter console use the built-in help function to get the help page\r\nof the module, function, ...\r\n\r\n.. code-block:: pycon\r\n\r\n\t>>> import spiepy, spiepy.demo\r\n\t>>> help(spiepy)\r\n\t...\r\n\t>>> help(spiepy.demo)\r\n\t...\r\n\t>>> help(spiepy.flatten_by_iterate_mask)\r\n\t...\r\n\r\n**Documentation:** https://webspace.science.uu.nl/~zeven101/SPIEPy/\r\n\r\nExample usage\r\n-------------\r\n.. code-block:: python\r\n\r\n\t# -*- coding: utf-8 -*-\r\n\t#\r\n\t#   Copyright \u00a9 2014 - 2017 Stephan Zevenhuizen\r\n\t#   Flattening terrace image, (09-10-2017).\r\n\t#\r\n\r\n\timport spiepy, spiepy.demo\r\n\timport matplotlib.pyplot as plt\r\n\timport numpy as np\r\n\r\n\tim = spiepy.Im()\r\n\tdemos = spiepy.demo.list_demo_files()\r\n\tprint(demos)\r\n\tim.data = spiepy.demo.load_demo_file(demos[1])\r\n\r\n\tplt.imshow(im.data, cmap = spiepy.NANOMAP, origin = 'lower')\r\n\tprint('Original image.')\r\n\tplt.show()\r\n\r\n\tim_out, _ = spiepy.flatten_xy(im)\r\n\tplt.imshow(im_out.data, cmap = spiepy.NANOMAP, origin = 'lower')\r\n\tprint('Preflattened image.')\r\n\tplt.show()\r\n\r\n\tmask = spiepy.locate_steps(im_out, 4)\r\n\tplot_image = np.ma.array(im_out.data, mask = mask)\r\n\tpalette = spiepy.NANOMAP\r\n\tpalette.set_bad('#00ff00', 1.0)\r\n\tplt.imshow(plot_image, cmap = palette, origin = 'lower')\r\n\tprint('Preflattened image, mask.')\r\n\tplt.show()\r\n\r\n\tim_final, _ = spiepy.flatten_xy(im, mask)\r\n\tplt.imshow(im_final.data, cmap = spiepy.NANOMAP, origin = 'lower')\r\n\tprint('Flattened image.')\r\n\tplt.show()\r\n\r\n\ty, x = np.histogram(im_out.data, bins = 200)\r\n\tys, xs = np.histogram(im_final.data, bins = 200)\r\n\tfig, ax = plt.subplots()\r\n\tax.plot(x[:-1], y, '-b', label = 'Standard plane flattening')\r\n\tax.plot(xs[:-1], ys, '-r', label = 'SPIEPy stepped plane flattening')\r\n\tax.legend(loc = 2, fancybox = True, framealpha = 0.2)\r\n\tax.set_xlabel('z (nm)')\r\n\tax.set_ylabel('count')\r\n\tplt.show()\r\n\r\nAuthors & affiliations\r\n----------------------\r\nStephan J. M. Zevenhuizen [#]_\r\n\r\n..\t[#] Condensed Matter and Interfaces, Debye Institute for Nanomaterials\r\n\tScience, Utrecht University, Utrecht, The Netherlands.\r\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause",
    "summary": "SPIEPy (Scanning Probe Image Enchanter using Python) is a Python library to improve automatic processing of SPM images.",
    "version": "0.2.1",
    "project_urls": {
        "documentation": "https://webspace.science.uu.nl/~zeven101/SPIEPy/"
    },
    "split_keywords": [
        "spm",
        "scanning",
        "probe",
        "microscopy",
        "image",
        "analysis",
        "flattening",
        "nano",
        "nanotechnology"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7581714b8fe36d24278954e185a6e98045d2bac1e9533ba2e08b8640fc40c4c6",
                "md5": "4ed5a9e13ff5def0292caf6a239cb36e",
                "sha256": "d7149766915440165518a3e9312cc219bcc7c7f6c29239017fbf20b21052b2e7"
            },
            "downloads": -1,
            "filename": "SPIEPy-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4ed5a9e13ff5def0292caf6a239cb36e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4439866,
            "upload_time": "2023-11-27T08:25:03",
            "upload_time_iso_8601": "2023-11-27T08:25:03.885737Z",
            "url": "https://files.pythonhosted.org/packages/75/81/714b8fe36d24278954e185a6e98045d2bac1e9533ba2e08b8640fc40c4c6/SPIEPy-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6722645ff6cb4cc3838060926cc6edb3d17e95938ec148b1c8f8d59c4dbd13a",
                "md5": "2e7d307b1c9b882b2abf74251b7b4e18",
                "sha256": "a0fd399b838e6b408dab5e4e29e8bfabec19a68187bc770ab28c62b5ebe4b0f8"
            },
            "downloads": -1,
            "filename": "SPIEPy-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2e7d307b1c9b882b2abf74251b7b4e18",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4439860,
            "upload_time": "2023-11-27T08:25:06",
            "upload_time_iso_8601": "2023-11-27T08:25:06.528504Z",
            "url": "https://files.pythonhosted.org/packages/b6/72/2645ff6cb4cc3838060926cc6edb3d17e95938ec148b1c8f8d59c4dbd13a/SPIEPy-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-27 08:25:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "spiepy"
}
        
Elapsed time: 3.78509s