Coder Social home page Coder Social logo

mrc2png's Introduction

MRC to PNG Converter

This script converts MRC (Microscopy Data) files to PNG format. MRC files are commonly used in electron microscopy to store 3D volume data. Converting them to PNG format makes it easier to view and share the images.

Features

  • Converts MRC files to PNG format.
  • Supports specifying root directory and wildcard patterns for MRC files.
  • Allows reversing the order of frames and setting the resolution of the output PNG.

Usage

  1. Download the compiled executable file: dist/mrc2png.

  2. In a terminal, navigate to where you downloaded mrc2png, then run:

    ./mrc2png <root_dir> [options]

    Replace <root_dir> with the path to the root directory containing the MRC files.

    Options:

    • -r, --reverse: Reverse the order of frames.
    • -s, --resolution <resolution>: Set the resolution of the output PNG. Available options: "Full", "1920x1080", "1280x720", "640x480". Default: "Full".
    • -p, --pattern <pattern>: Specify a wildcard pattern for MRC files. Default: "*.mrc". For example, -p *preview.mrc will only convert MRC files whose names end with preview.mrc.
  3. For convenience, you can also add the executable file PATH to the end of your ~/.bashrc:

    export PATH="path_to_your_executable_file":$PATH

    Then restart the terminal and just use as:

    mrc2png <root_dir> [options]

For Customizing and Developing

Requirements

  • Python 3.6+
  • Required Python packages: numpy, mrcfile, tifffile, Pillow

Installation

  1. Clone the repository:

    git clone https://github.com/elemeng/mrc2png.git
  2. Navigate to the repository directory:

    cd mrc2png
  3. Install the Rye package manager:

    Linux and macOS:

    curl -sSf https://rye-up.com/get | bash

    Windows:

    Download and run the installer from Rye Releases.

  4. Install dependencies:

    rye sync
  5. Start coding!

mrc2png's People

Contributors

elemeng avatar

Watchers

 avatar

mrc2png's Issues

Where is the file 'dist/mrc2png'

Hi,

sorry for the beginners question but where is the file mentioned in step 1 (dist/mrc2png) in the Usage paragraph?

Thank you!
Best regards!

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.