Correct scan drift distortion
Project description
Scan distortion correction
This package corrects scan distortion by using orthogonal pairs.
This is the Python translation from the code of Colin Ophus. The MATLAB code can be found here. It can also be found here. The implementation is based on his paper.
The translation from MATLAB to Python is finished, all SPmerge01linear,
SPmerge02 and SPmerge03 are availabe to use. The usage is pretty much the
same with MATLAB (see example.py or example.ipynb). The detail of the usage
can be found in the original README or the original
repository.
The MATLAB-to-Python translation provides a convenient interface where MATLAB is not available or Python is the preferred language in your analysis pipeline. The initial translation focuses on consistency between the MATLAB and Python version, after ensure the correctness then more changes will be made. A certain degree of parallelism is introduced in the Python version.
The tests compare output from Python to MATLAB version at different breakpoints,
the MATLAB version comparing is in matlab_modified. Some modifications are
made during the translation, mainly to address floating-point errors.
Installation
The package is available in conda-forge:
conda install -c conda-forge scanning_drift_corr
To install via pip:
pip install scanning_drift_corr
To install locally in editable mode, clone the repository and in the root directory run
pip install -e .
Version 1.0.0 can be used with Python version >= 3.7 but the parallel
implementation is broken in Windows/macOS :( Subsequent version supports Python
version >= 3.8 due to the usage of shared_memory in the standard library
multiprocessing, and the parallel implementation works in different systems.
However, see notes below.
Usage
After installing, you can try to run example.py. This script illustrates
basic usage of the Python interface.
A Jupyter notebook example.ipynb is also available.
Notes on parallel implementation
SPmerge01linear and SPmerge02 can be provided with parallel=True for
parallel computation. This works well in Unix system where processes are
forked, but in Windows/macOS processes are spawned and the parallel
implementation is (usually) slower than the serial one. The default behaviour
for Unix system is parallel=True and for Windows/macOS is parallel=False.
You are welcome to experiment yourself. See here
for details.
TODO
- refactoring of the codes (currently everything flying around)
- handle rectangular image
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scanning_drift_corr-1.0.1.tar.gz.
File metadata
- Download URL: scanning_drift_corr-1.0.1.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3506995a12a692235861f4c422a3fc57af15a629c4ebddf75ad6cc3bc1d27f80
|
|
| MD5 |
a45c42304f7010913ff8d39a29785f6c
|
|
| BLAKE2b-256 |
fa9e84c63998558f4a109d3617f5dd4cc5e6e91cfdff8436801f4704cc19223e
|
File details
Details for the file scanning_drift_corr-1.0.1-py3-none-any.whl.
File metadata
- Download URL: scanning_drift_corr-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
949826f9bf739b3126357fab212ea099aff67a370444ff3e08c5359456f7d49e
|
|
| MD5 |
1fa78706530703dfc39b51582b9820f2
|
|
| BLAKE2b-256 |
5a184ae6fd2ce465ce371c34a94b416abd699ad06cee67cad41afcdb4832a11f
|