Coder Social home page Coder Social logo

addbar's Introduction

ADDBAR

ADDBAR is a python script which automatically crops the image portion of the pdf file(s) of atomic force microscopy (AFM) images produced by NanoScope Software (Veeco Instruments Inc.). In addition, a scale bar whose length is one-fifth of the width of the image is superimposed in the bottom-right corner.

Dependencies

All parsing, cropping, and manipulation of the input pdf file is done using the pyPDF library. No other dependencies are required.

All dependencies can be installed using pip. pip does not come pre-installed with the python virtual machine, so you need to install it manually.

  • Install pip (if you do not have it installed)

# yum install python-pip

or

$ sudo apt-get install python-pip

for linux machines.

  • Upgrade pip.

$ sudo pip install pip --upgrade

  • Install all required dependencies by typing

$ pip install -r requirements.txt

Usage

At the command line, type

$ python addbar.py
> Enter name of file (excluding '.pdf')

Enter the name of the pdf file (without typing '.pdf'). The file may be multiple pages. For example if you have a file named example.pdf, type example.

> How many output channels (usually 1 or 2)?
1

This question asks how many output channels there are in the pdf file. For instance, if each page has only the height data, the number of output channels is 1. If there are 2 output data channels, such as the height and amplitude data in the pdf file, then the number of output channels is 2.

> Output filename without '.pdf' (default: 'example-addbar.pdf')?

Type the name of the output file you want. The default (just pressing Enter) is the name of the input file with the -addbar suffix appended, in which case, a file named example-addbar.pdf, with all the cropped images and scale bars added, will be produced.

addbar's People

Contributors

jfkimberly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.